def GetProperties(self): if not len(self.properties): self.properties = [ (xlt("Name"), self.name, self.GetImageId('Role')), ("OID", self.info['oid']), (xlt("Can Login"), YesNo(self.info['rolcanlogin'])), (xlt("Superuser"), YesNo(self.info['rolsuper'])), (xlt("Catalog Update"), YesNo(self.info['rolcatupdate'])), (xlt("Create DB"), YesNo(self.info['rolcreatedb'])), (xlt("Create Role"), YesNo(self.info['rolcreaterole'])), (xlt("Inherits rights"), YesNo(self.info['rolinherit'])), ] until = self.info['rolvaliduntil'] if not until or until.year == 9999: until = xlt("never") else: until = prettyDate(until) self.properties.append((xlt("Expires"), until)) self.AddChildrenProperty(self.info['memberof'], xlt("Member of"), self.GetImageId("Group")) self.AddChildrenProperty(self.info['members'], xlt("Members"), self.GetImageId("User")) self.AddChildrenProperty(self.info['rolconfig'], xlt("Variables"), -1) return self.properties
def GetProperties(self): if not len(self.properties): self.properties = [ (xlt("Name"), self.name, self.GetImageId('Role')), ( "OID", self.info['oid']), (xlt("Can Login"), YesNo(self.info['rolcanlogin'])), (xlt("Superuser"), YesNo(self.info['rolsuper'])), (xlt("Catalog Update"), YesNo(self.info['rolcatupdate'])), (xlt("Create DB"), YesNo(self.info['rolcreatedb'])), (xlt("Create Role"), YesNo(self.info['rolcreaterole'])), (xlt("Inherits rights"), YesNo(self.info['rolinherit'])), ] until=self.info['rolvaliduntil'] if not until or until.year == 9999: until=xlt("never") else: until=prettyDate(until) self.properties.append((xlt("Expires"), until)) self.AddChildrenProperty(self.info['memberof'], xlt("Member of"), self.GetImageId("Group")) self.AddChildrenProperty(self.info['members'], xlt("Members"), self.GetImageId("User")) self.AddChildrenProperty(self.info['rolconfig'], xlt("Variables"), -1) return self.properties
def GetProperties(self): if not self.properties: self.RefreshVolatile(True) self.properties = [(xlt("Name"), self.name), (xlt("Mailbox path"), self.mailboxPath), (xlt("Flags"), ", ".join(self.flags))] if self.CanSelect(): self.AddProperty(xlt("My rights"), self.myrights) self.AddProperty(xlt("Comment"), self.annotations.Get('/comment')) lu = self.annotations.Get('/lastupdate') if lu: self.AddProperty(xlt("Last update"), prettyDate(GetImapDate(lu))) # need that? # chk=(self.annotations.Get('/check') == "true") # self.AddYesNoProperty(xlt("Check"), chk) # if chk: # self.AddProperty(xlt("Check period"), self.annotations.Get('/checkperiod')) sz = self.annotations.Get('/size') if sz != None: self.AddSizeProperty(xlt("Size"), sz) squat = self.annotations.Get(squatAnnotation) if squat != None: self.AddProperty(xlt("Squat"), squat) if self.quota: items = [] for resource, quota in self.quota.items(): root, filled, total = quota if root == self.mailboxPath: items.append( xlt("%s: %s of %s") % (resource, floatToSize( filled, 1024), floatToSize(total, 1024))) else: items.append( xlt("%s: %s of %s (root=%s)") % (resource, floatToSize( filled, 1024), floatToSize(total, 1024), root)) self.AddChildrenProperty(items, xlt("Quota"), -1) else: self.AddProperty(xlt("Quota"), xlt("none")) if self.acl: imageid = self.GetImageId("User") for user, acl in self.acl.items(): self.properties.append((user, acl, imageid)) return self.properties
def GetProperties(self): if not self.properties: self.RefreshVolatile(True) self.properties=[ ( xlt("Name"), self.name), ( xlt("Mailbox path"), self.mailboxPath), ( xlt("Flags"), ", ".join(self.flags)) ] if self.CanSelect(): self.AddProperty(xlt("My rights"), self.myrights) self.AddProperty(xlt("Comment"), self.annotations.Get('/comment')) lu=self.annotations.Get('/lastupdate') if lu: self.AddProperty(xlt("Last update"), prettyDate(GetImapDate(lu))) # need that? # chk=(self.annotations.Get('/check') == "true") # self.AddYesNoProperty(xlt("Check"), chk) # if chk: # self.AddProperty(xlt("Check period"), self.annotations.Get('/checkperiod')) sz=self.annotations.Get('/size') if sz != None: self.AddSizeProperty(xlt("Size"), sz) squat=self.annotations.Get(squatAnnotation) if squat != None: self.AddProperty(xlt("Squat"), squat) if self.quota: items=[] for resource, quota in self.quota.items(): root, filled, total = quota if root == self.mailboxPath: items.append(xlt("%s: %s of %s") % (resource, floatToSize(filled, 1024), floatToSize(total, 1024))) else: items.append(xlt("%s: %s of %s (root=%s)") % (resource, floatToSize(filled, 1024), floatToSize(total, 1024), root) ) self.AddChildrenProperty(items, xlt("Quota"), -1) else: self.AddProperty(xlt("Quota"), xlt("none")) if self.acl: imageid=self.GetImageId("User") for user, acl in self.acl.items(): self.properties.append((user, acl, imageid)) return self.properties
def SetValue(self, value): if value: self.ctl.SetValue(prettyDate(value, True)) else: self.ctl.SetValue("")