Пример #1
0
def reset_character(ev):
    grind_table_state['checked'] = set()
    for char in grind_table_state['characters']:
        grind_table_state['characters'][char] = char_dict.copy()
        grind_table_state['arti_check'].add(char)
    grind_table_state['artifacts'] = set()
    for val in grind_table_state['total']:
        grind_table_state['total'][val] = 0
    for elt in doc.get(selector='input[type=checkbox]'):
        if 'char_select' in elt.attrs['class']:
            doc[elt.id].checked = False
        else:
            doc[elt.id].checked = True
    for elt in doc.get(selector='select'):
        elt.selectedIndex = 0
    for elt in doc.get(selector='TR[data-id]'):
        elt.attrs['class'] = 'unchecked'
    for elt in doc.get(selector='.saved_arti'):
        del doc[elt.id]

    for key in storage.keys():
        if key.startswith(storage_key) and not key.endswith('-user'):
            del storage[key]
    calculate_change()
    update_visible()
Пример #2
0
    def _list_files(self):
        """ returns a list of files this person has on storage,
          return empty list [] if unsuccessful
      """

        _list = []
        for _file in storage.keys():
            if not _file.startswith('/pyschool'): continue
            try:
                _fileobj = FileObject.FileObject()
                #_fileobj=FileSystemBase.FileObject()
                _fileobj.from_json(storage[_file])
            except Exception as e:
                #not a FileObject file..
                console.log(str(e))
                console.log('not a fileobject...', _file)
                continue

            _list.append({
                'filename':
                _fileobj.get_filename(),
                'modified_date':
                _fileobj.get_attribute('modified_date')
            })

        return {'status': 'Okay', 'filelist': _list}
Пример #3
0
    def _list_files(self):
        """ returns a list of files this person has on storage,
          return empty list [] if unsuccessful
      """
        try:
            return {'status': 'Okay', 'filelist': storage.keys()}
        except:
            pass

        return []
Пример #4
0
def reset_inventory(ev):
    for val in grind_table_state['user']:
        grind_table_state['user'][val] = 0
    for elt in doc.get(selector='input[type=number]'):
        elt.value = 0

    for key in storage.keys():
        if key.startswith(storage_key) and key.endswith('-user'):
            del storage[key]
    calculate_change()
  def _list_files(self):
      """ returns a list of files this person has on storage,
          return empty list [] if unsuccessful
      """

      _list=[]
      for _file in storage.keys():
          if not _file.startswith('/pyschool'): continue
          try:
            _fileobj=FileObject.FileObject()
            #_fileobj=FileSystemBase.FileObject()
            _fileobj.from_json(storage[_file])
          except Exception as e:
            #not a FileObject file..
            console.log(str(e))
            console.log('not a fileobject...', _file)
            continue

          _list.append({'filename': _fileobj.get_filename(), 
                        'modified_date': _fileobj.get_attribute('modified_date')})

      return {'status': 'Okay', 'filelist': _list}
def del_storage(key):
    nkey = f"{storage_key}-{key}"
    if nkey in storage.keys():
        del storage[nkey]
Пример #7
0
def load_data():
    b64_map = {}
    for key in storage.keys():
        b64_map[key] = storage.get(key)
    return b64_map