Пример #1
0
 def create(self, **kwds):
     """create page"""
     # get list of standard specs from WMCore and new ones from local area
     #loc_specs_dir = os.path.join(self.spdir, 'Specs') # local specs
     #loc_specs = spec_list(loc_specs_dir, 'Specs')
     #all_specs = list(set(self.std_specs + loc_specs))
     #all_specs.sort()
     all_specs = self.std_specs
     spec = kwds.get('form', '')
     if not spec:
         spec = self.std_specs[0]
     # make spec first in all_specs list
     if spec in all_specs:
         all_specs.remove(spec)
     all_specs = [spec] + all_specs
     jsondata = get_request_template_from_type(spec)
     # create templatized page out of provided forms
     self.update_scripts()
     content = self.templatepage(
         'create',
         table=json2table(jsondata, web_ui_names()),
         jsondata=json2form(jsondata, indent=2, keep_first_value=True),
         name=spec,
         scripts=[s for s in self.sdict.keys() if s != 'ts'],
         specs=all_specs)
     return self.abs_page('create', content)
Пример #2
0
    def get(self, name):
        """
        Spec templete API call.

        :arg str name: name to appear in the result message.
        :returns: row with response, here 1 item list with message.

        """
        result = get_request_template_from_type(name)
        return [result]
Пример #3
0
 def get(self, name):
     """
     Spec templete API call.
     
     :arg str name: name to appear in the result message.
     :returns: row with response, here 1 item list with message.
     
     """
     result = get_request_template_from_type(name)
     return [result]
Пример #4
0
 def create(self, **kwds):
     """create page"""
     # get list of standard specs from WMCore and new ones from local area
     loc_specs_dir = os.path.join(self.spdir, 'Specs') # local specs
     loc_specs = spec_list(loc_specs_dir, 'Specs')
     all_specs = list(set(self.std_specs + loc_specs))
     all_specs.sort()
     spec = kwds.get('form', '')
     if  not spec:
         spec = self.std_specs[0]
     # make spec first in all_specs list
     if  spec in all_specs:
         all_specs.remove(spec)
     all_specs = [spec] + all_specs
     jsondata = get_request_template_from_type(spec)
     # create templatized page out of provided forms
     self.update_scripts()
     content = self.templatepage('create', table=json2table(jsondata, web_ui_names()),
             jsondata=json2form(jsondata, indent=2, keep_first_value=True), name=spec,
             scripts=[s for s in self.sdict.keys() if s!='ts'],
             specs=all_specs)
     return self.abs_page('create', content)