def __init__(self, scripts=list(), styles=list(), label=None, data=''): scripts = [os.path.join(SCRIPTS_PATH, 'textarea.js')] + scripts styles = [os.path.join(STYLES_PATH, 'textarea.css')] + styles Module.__init__(self, scripts=scripts, styles=styles) self.label = label self.data = data
def main(): print('Login: '******'', flush=True) login = stdin.readline() password = getpass('Password: '******'format' : 'json'}) json_string = '\n'.join(response.text.split('\n')[1:]) data = json.loads(json_string) module = Module( name=data['title'], description=data['description'], places=420, start=data['begin'], end=data['end'], register_start=data['begin'], register_end=data['end_register'], credits=data['user_credits'], ) module.save() for activity in data['activites']: project = Activity( module=module, name=activity['title'], type=ACT_TYPE.get(activity['type_code'], Activity.TD), description=activity['description'], places=420, start=data['begin'], end=activity['end'], register_start=data['begin'], register_end=data['end_register'], group_size=data.get('nb_max', 1), peer_number=data.get('min_peer_note', 4) ) project.save()
def __init__(self, scripts=list(), styles=list(), label=None, default_value=None, disabled=False): scripts = [os.path.join(SCRIPTS_PATH, 'input.js')] + scripts Module.__init__(self, scripts=scripts, styles=styles) self.label = label self.default_value = default_value self.disabled = disabled
def __init__(self, xml_tag): self.xml_tag = xml_tag self.selected = [] Module.__init__(self, scripts=[os.path.join(SCRIPTS_PATH, 'fancy_tree.js')]) # This modules automatically manages occurrences self.is_managing_occurences = True
def __init__(self, scripts=list(), styles=list(), label=None, options=dict(), disabled=False, selected=None): scripts = [os.path.join(SCRIPTS_PATH, 'options.js')] + scripts Module.__init__(self, scripts=scripts, styles=styles) self.options = options self.label = label self.disabled = disabled self.selected = selected
def __init__(self, scripts=list(), styles=list(), popup_content=None, button_label='Save'): scripts = [os.path.join(SCRIPTS_PATH, 'popup.js')] + scripts Module.__init__(self, scripts=scripts, styles=styles) if popup_content is None: raise ModuleError("'popup_content' and is required. Cannot instantiate an empty popup") self.popup_content = popup_content self.button_label = button_label
def __init__(self, scripts=list(), styles=list(), label=None, default_value=None, modclass=None): scripts = [os.path.join(SCRIPTS_PATH, 'sync_input.js')] + scripts Module.__init__(self, scripts=scripts, styles=styles) if modclass is None: raise ModuleError("'modclass' is required.") self.modclass = modclass self.label = label self.default_value = default_value
def mutate_and_get_payload(root, info, **input): user = get_user(info) or None module = Module( name=input.get('name'), short_description=input.get('short_description'), owned_by=user, ) module.save() return CreateModule(module=module)
def __init__(self, scripts=list(), styles=list(), button_label='Send', label=None, default_value=None): Module.__init__(self, scripts=scripts, styles=styles) self.button_label = button_label self.label = label self.default_value = default_value
def __init__(self, scripts=list(), styles=list(), label=None, name=None, options=None, selected=list()): scripts = [os.path.join(SCRIPTS_PATH, 'checkboxes.js')] + scripts styles = [os.path.join(STYLES_PATH, 'checkboxes.css')] + styles Module.__init__(self, scripts=scripts, styles=styles) if name is None: raise ModuleError("The name can't be empty.") self.selected = selected self.options = options if options is not None else dict() self.label = label
def __init__(self, scripts=list(), styles=list(), label=None, name=None, options=None, selected=[]): scripts = [os.path.join(SCRIPTS_PATH, 'checkboxes.js')] + scripts styles = [os.path.join(STYLES_PATH, 'checkboxes.css')] + styles Module.__init__(self, scripts=scripts, styles=styles) if name is None: raise ModuleError("The name can't be empty.") self.selected = selected self.options = options if options is not None else dict() self.label = label
def create_db(data): for module in data: module_name = module['name'] if len(module['name']) < 400 else module['name'][:400] m = Module(name=module_name, attr_count=len(module['attributes'])) m.save() for attr in module['attributes']: a = Attribute(name=attr['attrName'], data_repo=attr['dataRepo'], java_class=attr['javaClass'], cti=attr['cti'], module=m) a.save() attributes = Attribute.objects.all() for attr in attributes: attr.num_dependencies = dcs.get_num_dependencies(attr.name)['dependencies'] attr.num_dependents = dcs.get_num_dependencies(attr.name)['dependents'] attr.save()
def get_node(cls, info, id): logger.error('get node') logger.error(id) logger.error(info) if id is not None: if id == 'default': return Module() else: return Module.objects.get(pk=id) return None
def mutate_and_get_payload(root, info, **input): user = get_user(info) or None if not input.get('id'): module = Module() else: model, pk = from_global_id(input.get('id')) module = Module.objects.get(id=pk) or Module() module.owned_by = user module.name = input.get('name') module.short_description = input.get('short_description') module.save() return UpsertModule(module=module)
def __init__(self): Module.__init__(self)
def _get_module(self, request): Module._get_module(self, request)
def _get_display(self, request): Module._get_display(self, request)
def _get_result(self, request): Module._get_result(self, request)
def _post_display(self, request): Module._post_display(self, request)
def __init__(self, scripts=list(), styles=list(), label=None): scripts = [os.path.join(SCRIPTS_PATH, 'autocomplete.js')] + scripts Module.__init__(self, scripts=scripts, styles=styles) self.label = label
def _post_result(self, request): Module._post_result(self, request)
def __init__(self): Module.__init__(self, scripts=[os.path.join(SCRIPTS_PATH, 'namepid.js')])
def __init__(self): Module.__init__( self, scripts=[os.path.join(SCRIPTS_PATH, 'relevantdate.js')])
def __init__(self): Module.__init__(self, scripts=[os.path.join(SCRIPTS_PATH, 'namepid.js')]) # This modules automatically manages occurences self.is_managing_occurences = True
def __init__(self): Module.__init__(self, scripts=[os.path.join(SCRIPTS_PATH, 'relevantdate.js')])