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
#!/bin/bash | |
# copy this file to /usr/local/sbin (or any other $PATH location) | |
# add to daily.cron | |
VAR_FILE="/var/lib/pacicron/sha" | |
MAIL_TO="root" | |
HOST=$(uname -n) | |
if [[ ! -f ${VAR_FILE} ]]; then | |
echo "${VAR_FILE} doesn't exits. Therefore creating." |
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
#!/usr/bin/env python | |
# could be added to .forward with "|$PATH/mailprint.py" | |
import sys | |
import email.feedparser as mailparser | |
""" | |
TODO | |
==== | |
* add quota |
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 |
NewerOlder