Ejemplo n.º 1
0
 def _load_dirent(self, dirent_json):
     dirent_json = utf8lize(dirent_json)
     path = posixpath.join(self.path, dirent_json['name'])
     if dirent_json['type'] == 'file':
         return SeafFile(self.repo, path, dirent_json['id'], dirent_json['size'])
     else:
         return SeafDir(self.repo, path, dirent_json['id'], 0)
Ejemplo n.º 2
0
 def _load_dirent(self, dirent_json):
     dirent_json = utf8lize(dirent_json)
     path = posixpath.join(self.path, dirent_json['name'])
     if dirent_json['type'] == 'file':
         return SeafFile(self.repo, path, dirent_json['id'], dirent_json['size'])
     else:
         return SeafDir(self.repo, path, dirent_json['id'], 0)
Ejemplo n.º 3
0
    def from_json(cls, client, group_json):
        group_json = utf8lize(group_json)
        group_id = group_json['group_id']
        name = group_json['name']
        email = group_json['email']
        is_admin = group_json['is_admin']
        role = group_json['role']

        return cls(client, group_id, name, email, is_admin, role)
Ejemplo n.º 4
0
    def from_json(cls, client, repo_json):
        repo_json = utf8lize(repo_json)

        repo_id = repo_json['id']
        repo_name = repo_json['name']
        encrypted = repo_json['encrypted']
        perm = repo_json['permission']
        owner = repo_json['owner']

        return cls(client, repo_id, repo_name, encrypted, owner, perm)
Ejemplo n.º 5
0
    def from_json(cls, client, repo_json):
        repo_json = utf8lize(repo_json)

        repo_id = repo_json['id']
        repo_name = repo_json['name']
        encrypted = repo_json['encrypted']
        perm = repo_json['permission']
        owner = repo_json['owner']

        return cls(client, repo_id, repo_name, encrypted, owner, perm)
Ejemplo n.º 6
0
    def from_json(cls, client, account_json):
        account_json = utf8lize(account_json)
        account_id = account_json['id']
        email = account_json['email']
        create_time = account_json['create_time']
        is_active = account_json['is_active']
        is_staff = account_json['is_staff']
        usage = account_json['usage']
        total = account_json['total']

        return cls(client, account_id, email, create_time, is_active, is_staff, usage, total)