예제 #1
0
    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
예제 #2
0
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()
예제 #3
0
    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
예제 #4
0
    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
예제 #5
0
    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
예제 #6
0
    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
예제 #7
0
    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
예제 #8
0
    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
예제 #9
0
    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
예제 #10
0
    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
예제 #11
0
    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
예제 #12
0
    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)
예제 #13
0
    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
예제 #14
0
 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
예제 #15
0
    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
예제 #16
0
    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
예제 #17
0
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()
예제 #18
0
 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
예제 #19
0
    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)
예제 #20
0
 def __init__(self):
     Module.__init__(self)
예제 #21
0
 def _get_module(self, request):
     Module._get_module(self, request)
예제 #22
0
 def _get_display(self, request):
     Module._get_display(self, request)
예제 #23
0
 def _get_result(self, request):
     Module._get_result(self, request)
예제 #24
0
 def _post_display(self, request):
     Module._post_display(self, request)
예제 #25
0
    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
예제 #26
0
 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')])
예제 #29
0
 def __init__(self):
     Module.__init__(self,
                     scripts=[os.path.join(SCRIPTS_PATH, 'namepid.js')])
     # This modules automatically manages occurences
     self.is_managing_occurences = True
예제 #30
0
 def __init__(self):
     Module.__init__(self)
예제 #31
0
 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
예제 #32
0
 def __init__(self):
     Module.__init__(self, scripts=[os.path.join(SCRIPTS_PATH, 'relevantdate.js')])
예제 #33
0
 def __init__(self):        
     Module.__init__(self, scripts=[os.path.join(SCRIPTS_PATH, 'namepid.js')])
예제 #34
0
    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