Mit dieser Anleitung wird erklärt, wie Passwörter an vertrauensvolle Personen verteilt werden können.
This file contains hidden or 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 RedisCache(_RedisCache): | |
""" | |
Wrapper to redis cache that creates status keys for the time a value is | |
created. | |
Idea from https://github.com/funkybob/puppy | |
""" | |
def get_or_set(self, key, callback, timeout=None, update_time=6): | |
""" | |
Get a key if it exists. Creates it if other case. |
This file contains hidden or 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 IdManyRelatedField(ManyRelatedField): | |
field_name_suffix = '_ids' | |
def bind(self, field_name, parent): | |
self.source = field_name[:-len(self.field_name_suffix)] | |
super().bind(field_name, parent) | |
class IdPrimaryKeyRelatedField(PrimaryKeyRelatedField): | |
""" |
This file contains hidden or 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
import re | |
from django.db import models | |
from django import forms | |
class HexFormField(forms.CharField): | |
default_error_messages = { | |
'invalid': 'Enter a valid hexfigure: e.g. "ff0022"', | |
} |
This file contains hidden or 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
import os | |
import sys | |
from time import sleep | |
from usb.core import find as usb_find, USBError | |
def call_usb(func): | |
def wrapper(self, *args, **kwargs): | |
try: | |
func(self, *args, **kwargs) |
NewerOlder