This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package default; | |
import com.microsoft.azure.storage.blob.BlobRange; | |
import com.microsoft.azure.storage.blob.BlockBlobURL; | |
import com.microsoft.azure.storage.blob.DownloadResponse; | |
import com.microsoft.azure.storage.blob.ReliableDownloadOptions; | |
import java.io.IOException; | |
import java.nio.ByteBuffer; | |
import java.nio.channels.SeekableByteChannel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from adhcoracy4.phases import register_module, ModuleType, PhaseType | |
from .models import MyModel | |
from .views import MyDashBoardView, MyCollectView | |
Collect(PhaseType): | |
description = _('Human readable phase name') | |
view = MyCollectView | |
features = { | |
'crud': (MyModel, 'myapp_name.MyOtherModel') # model as class or django style model string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@property | |
def idea_topics_names(self): | |
choices = dict(IDEA_TOPIC_CHOICES) | |
return [ choices[topic] for topic in self.idea_topics ] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if action = "create": | |
project = instance.project | |
if 'action_target' in instance._meta.action_target: | |
action.target = getattr(instance, instance._meta.action_target) | |
if 'content_object' in instance: | |
action.traget = instance.content_object | |
if 'module' in instance: | |
action.target = instance.module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from adhcoracy4.maps.models import AreaSettings | |
SETTINGS_WIDGETS = { | |
AreaSettings: { | |
'polygon': MapChoosePolygonPresets | |
} | |
} | |
def get_module_settings_form(settings_instance_or_modelref): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Idea(module_models.Item): | |
slug = models.SlugField(max_length=512, unique=True) | |
name = models.CharField(max_length=512) | |
description = models.TextField() | |
image = models.ImageField(upload_to='ideas/images', blank=True, | |
validators=[validators.validate_hero_image]) | |
def __str__(self): | |
return self.name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# projects/mixins.py | |
class ProjectMixin(): | |
def get_project(self): | |
pass | |
def get_context_data(self, **kwargs): | |
kwargs['project'] = self.get_project() | |
return super().get_context_data(**kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# process/__init__.py | |
class BasePhasePermissions(): | |
can_edit = False | |
can_delete = False | |
# idea_collection/phases.py | |
from . import process | |
class PhasePermissions(process.BasePhasePermissions): | |
can_edit = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// handles response from the Read MIFARE Data message | |
post(new Route(Constants.readBlockCallbackUrl) { | |
@Override | |
public Object handle(Request request, Response response) { | |
JSONObject jsonParameters = (JSONObject) JSONValue.parse(request.body()); | |
String operationId = (String) jsonParameters.get("operationId"); | |
String sessionId = pendingOperations.get(operationId); | |
pendingOperations.remove(operationId); | |
int statusCode = ((Long)jsonParameters.get("statusCode")).intValue(); | |
if (statusCode != HTTP_OK) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PATH=/home/yves/repos/policycompass/nix/env/bin:/home/yves/.nix-profile/bin:/home/yves/.nix-profile/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/sbin:/sbin:~/bin:~/.scripts:`(gem env gempath | cut -d ':' -f 2 )`/bin&&\ | |
mkdir -p var/lib/tomcat/webapps&&\ | |
gem install --user compass&&\ | |
./carneades/src/CarneadesWeb/scripts/build_war.sh --deploy /home/yves/repos/policycompass/var/lib/tomcat/webapps/carneades.war | |
Building native extensions. This could take a while... | |
ERROR: Error installing compass: | |
ERROR: Failed to build gem native extension. | |
/nix/store/kn475x0hqa96vxhb3f6czfpm714n80hc-ruby-1.9.3-p484/bin/ruby extconf.rb | |
checking for ffi_call() in -lffi... *** extconf.rb failed *** |
NewerOlder