Skip to content

Commit

Permalink
ready for Seafile 4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Henri Wahl committed Oct 6, 2015
1 parent 1327751 commit b1c11b1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions seafadm
Original file line number Diff line number Diff line change
Expand Up @@ -500,22 +500,22 @@ def GetUsers():
users = dict()
for d in GetData("/sys/useradmin/", section="right-panel"):
try:
used_space, quota = d[3].text.strip().split("/")
used_space, quota = d[2].text.strip().split("/")
quota = quota.strip()
quota, unit = quota.split(" ")
# calculate space in megabytes
quota = format(float(quota)*1024**SIZE_UNITS.index(unit.lower())/1024**2, ".1f")
except:
used_space = d[3]
except Exception, err:
used_space = d[2]
quota = "None"
used_space = used_space.strip()
used_space, unit = used_space.split(" ")
# calculate space in megabytes
used_space = format(float(used_space)*1024**SIZE_UNITS.index(unit.lower())/1024**2, ".1f")
creation = d[4].contents[0].strip().split("/")[0].strip()
creation = d[3].contents[0].strip().split("/")[0].strip()
user = User(EMail=str(d[0].text.strip()), Creation=creation, UsedSpace = used_space, Quota = quota)
if isinstance(d[5], bs4.element.Tag):
user.ID=d[5].a["data-url"].strip("/").split("/")[-1]
if isinstance(d[4], bs4.element.Tag):
user.ID=d[4].a["data-url"].strip("/").split("/")[-1]
users[user.EMail] = (user)
return users

Expand Down

0 comments on commit b1c11b1

Please sign in to comment.