本文整理汇总了Python中wh.xlt函数的典型用法代码示例。如果您正苦于以下问题:Python xlt函数的具体用法?Python xlt怎么用?Python xlt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xlt函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, parentWin):
adm.Dialog.__init__(self, parentWin, None, "LoggingDialog")
_TimerOwner.__init__(self)
self.Bind(wx.EVT_CLOSE, self.OnClose)
self.Bind("Apply", self.OnApply)
nb=self['notebook']
panel=LoggingPanel(self, nb)
nb.InsertPage(0, panel, xlt(panel.panelName))
panel=QueryLoggingPanel(self, nb)
nb.InsertPage(1, panel, xlt(panel.panelName))
self.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED, self.OnPageChange)
self['LogLevelFile'].SetRange(0, len(self.loglevels)-1)
self['LogLevelQuery'].SetRange(0, len(self.querylevels)-1)
self.Bind("LogLevelFile LogLevelQuery", wx.EVT_COMMAND_SCROLL, self.OnLevel)
self.LogLevelFile=self.loglevels.index(logger.loglevel)
self.LogLevelQuery=self.querylevels.index(logger.querylevel)
self.LogFileLog = logger.logfile
self.LogFileQuery=logger.queryfile
self.OnLevel()
ah=AcceleratorHelper(self)
ah.Add(wx.ACCEL_CTRL, 'C', self.BindMenuId(self.OnCopy))
ah.Realize()
开发者ID:andreas-p,项目名称:admin4,代码行数:27,代码来源:LoggingDialog.py
示例2: Check
def Check(self):
ok=True
if not self.rds:
ok=self.CheckValid(ok, self.Recordname, xlt(("Enter %s") % self.RecordNameStatic))
if self.rdtype == rdatatype.CNAME:
foundSame=self.node.cnames.get(self.Recordname)
foundOther=self.node.hosts4.get(self.Recordname)
if not foundOther:
foundOther=self.node.hosts6.get(self.Recordname)
if not foundOther:
foundOther=self.node.ptrs.get(self.Recordname)
if not foundOther:
# SIG, NXT and KEY allowed
foundOther=self.node.others.get(self.Recordname)
ok=self.CheckValid(ok, not foundOther, xlt("CNAME collides with existing record"))
else:
foundSame=self.node.others.get(self.Recordname, {}).get(self.rdtype)
# SIG, NXT and KEY: CNAME allowed
foundCname=self.node.cnames.get(self.Recordname)
ok=self.CheckValid(ok, not foundCname, xlt("Record collides with existing CNAME record"))
ok=self.CheckValid(ok, not foundSame, xlt("Record of same type and name already exists"))
ok=self.CheckValid(ok, timeToFloat(self.TTL), xlt("Please enter valid TTL value"))
return ok
开发者ID:andreas-p,项目名称:admin4,代码行数:25,代码来源:Zone.py
示例3: GetIdFromMax
def GetIdFromMax(self, objectClass, attrName):
if self.GetServer().GetIdGeneratorStyle():
# using SambaUnixIdPool
dn=self.GetServer().GetSambaUnixIdPoolDN()
if not dn:
if hasattr(self.dialog, "sambaDomainName"):
dn=self.smbDomains.get(self.dialog.sambaDomainName)
if not dn:
res=self.GetServer().SearchSubConverted(["objectClass=sambaDomain", "sambaDomainName=%s" % self.dialog.sambaDomainName ])
if res:
dn=res[0][0]
self.smbDomains[self.dialog.sambaDomainName] = dn
else:
self.dialog.SetStatus(xlt("Either sambaUnixIdPoolDN must be configured or a samba domain specified."))
return
if dn:
res=ConvertResult(self.GetConnection().SearchBase(dn, "(objectClass=sambaUnixIdPool)", attrName))
if res:
id=int(res[0][1].get(attrName.lower())[0])
self.dialog.SetValue(attrName, id)
self.GetConnection().Modify(dn, {attrName: id+1})
return True
else:
self.dialog.SetStatus(xlt("Couldn't read %s from %s") % (attrName, dn))
return False
else:
# using max+1 method
maxId=0
res=self.GetServer().SearchSubConverted(["objectClass=%s" % objectClass, "%s=*" % attrName], attrName)
for _dn, info in res:
uid=int(info[attrName][0])
maxId = max(maxId, uid)
self.dialog.SetValue(attrName, maxId+1)
self.dialog.SetStatus("Generated %(attr)s from highest used %(attr)s" % {"attr": attrName})
return False
开发者ID:ed00m,项目名称:admin4,代码行数:35,代码来源:SpecificEntry.py
示例4: OnAddMember
def OnAddMember(self, evt):
lv=self['Members']
res=self.GetServer().SearchSubConverted("(uid=*)", "uid cn displayName")
candidates=[]
for _dn, info in res:
uid=info['uid'][0]
name=info.get("displayName")
if not name:
name=info.get('cn')
if name:
name=name[0]
if lv.FindItem(-1, uid) < 0:
if uid == name:
candidates.append(uid)
else:
candidates.append("%s %s" % (uid, name))
candidates.sort(key=unicode.lower)
dlg=wx.MultiChoiceDialog(self, xlt("Add member"), xlt("Add member to group"), candidates)
if dlg.ShowModal() == wx.ID_OK:
uids=[]
for row in range(lv.GetItemCount()):
uids.append(lv.GetItemText(row, 0))
for i in dlg.GetSelections():
cr=candidates[i].split()
uid=cr[0]
row=lv.AppendItem(-1, uid)
lv.SetStringItem(row, 1, " ".join(cr[1:]))
lv.SetItemData(row, -1)
uids.append(uid)
self.dialog.SetValue(self.memberUidOid, uids, self)
开发者ID:ed00m,项目名称:admin4,代码行数:34,代码来源:Group.py
示例5: Display
def Display(self, node, _detached):
if node != self.lastNode:
def _typename(row):
n= [row['typename'], ['NULL', 'NOT NULL'][row['attnotnull']] ]
default=row['adsrc']
if default != None:
if default == "nextval('%s_%s_seq'::regclass)" % (node.info['relname'], row['attname']):
if n[0] == "integer":
n[0] = "serial"
elif n[0] == "bigint":
n[0] = "bigserial"
else:
logger.debug("Unknown serial type %s for %s", n[0], default)
n.append("DEFAULT")
n.append(default)
else:
n.append("DEFAULT")
n.append(default)
return " ".join(n)
self.lastNode=node
self.control.ClearAll()
add=self.control.AddColumnInfo
add(xlt("Name"), 20, colname='attname')
add(xlt("Type"), -1, proc=_typename)
self.RestoreListcols()
node.populateColumns()
icon=node.GetImageId('column')
values=[]
for col in node.columns:
values.append( (col, icon))
self.control.Fill(values, 'attname')
开发者ID:ed00m,项目名称:admin4,代码行数:34,代码来源:Table.py
示例6: executeQuery
def executeQuery(self, sql):
self.output.SetEmpty()
self.worker=None
self.EnableMenu(self.datamenu, self.OnRefresh, False)
self.EnableMenu(self.datamenu, self.OnCancelRefresh, True)
self.startTime=localTimeMillis();
self.worker=worker=self.tableSpecs.GetCursor().ExecuteAsync(sql)
worker.start()
self.SetStatus(xlt("Refreshing data..."));
self.SetStatusText("", self.STATUSPOS_ROWS)
self.pollWorker()
self.EnableMenu(self.datamenu, self.OnCancelRefresh, False)
self.EnableMenu(self.datamenu, self.OnRefresh, True)
txt=xlt("%d rows") % worker.GetRowcount()
if not self.notebook.GetSelection() and self.filter.LimitCheck and self.filter.LimitValue == worker.GetRowcount():
txt += " LIMIT"
self.SetStatusText(txt, self.STATUSPOS_ROWS)
if worker.cancelled:
self.SetStatus(xlt("Cancelled."));
self.output.SetData(worker.GetResult())
elif worker.error:
errlines=worker.error.error.splitlines()
self.output.SetEmpty()
self.SetStatus(errlines[0]);
else:
self.SetStatus(xlt("OK."));
self.output.SetData(worker.GetResult())
开发者ID:andreas-p,项目名称:admin4,代码行数:35,代码来源:DataTool.py
示例7: Display
def Display(self, node, _detached):
if not node or node != self.lastNode:
self.storeLastItem()
if not self.prepare(node):
return
node=self.lastNode
self.control.AddColumn(xlt("Address"), 10)
self.control.AddColumn(xlt("Target"), 30)
self.control.AddColumn(xlt("TTL"), 5)
self.RestoreListcols()
icon=node.GetImageId('ptr')
ips=[]
for ptr in node.ptrs.keys():
rds=node.ptrs[ptr]
name=DnsAbsName(ptr, node.partialZonename)
try:
adr=DnsRevAddress(name)
except:
adr="%s <invalid>" % ptr
ips.append( (adr, rds[0].target, floatToTime(rds.ttl, -1)))
for ip in sorted(ips, key=(lambda x: filledIp(x[0]))):
self.control.AppendItem(icon, list(ip))
self.restoreLastItem()
开发者ID:andreas-p,项目名称:admin4,代码行数:28,代码来源:Zone.py
示例8: GetProperties
def GetProperties(self):
if not self.properties:
sec=self.settings['security']
if sec.startswith('SSL'):
pass
elif sec.startswith('TLS'):
if self.connection.tls: sec="TLS"
else: sec=xlt("unsecured connection")
self.annotations=self.connection.GetAnnotations('')
self.properties= [
( xlt("Name"),self.name),
( xlt("Protocol"), self.connection.PROTOCOL_VERSION),
( xlt("Address"), self.address),
( xlt("Security"), sec),
( xlt("Port"), self.settings["port"]),
( xlt("User"), self.user),
( xlt("Connected"), YesNo(self.IsConnected())),
( xlt("Autoconnect"), YesNo(self.settings.get('autoconnect'))),
]
self.AddProperty("Server", self.connection.id.get('name'))
self.AddProperty("Version", self.connection.id.get('version'))
fs=self.annotations.Get('/freespace')
if fs != None:
self.AddSizeProperty(xlt("Free space"), float(fs)*1024)
# if self.IsConnected():
# self.AddChildrenProperty(list(self.connection.capabilities), xlt("Capabilities"), -1)
return self.properties
开发者ID:andreas-p,项目名称:admin4,代码行数:30,代码来源:Server.py
示例9: OnRefreshRate
def OnRefreshRate(self, evt=None):
rr=self.RefreshRate
if rr == self['RefreshRate'].GetMax():
rr=0
self.RefreshStatic=xlt("stopped")
else:
if rr > 19:
rr = (rr-19)*300 +300
elif rr > 15:
rr = (rr-15)*60 + 60
elif rr > 12:
rr = (rr-12)*10 + 30
elif rr > 8:
rr = (rr-8)*5 +10
elif rr > 6:
rr = (rr-6)*2 +6
if rr < 60:
self.RefreshStatic=xlt("%d sec") % rr
else:
self.RefreshStatic=xlt("%d min") % (rr/60)
if not evt or evt.GetEventType() == wx.wxEVT_SCROLL_THUMBRELEASE:
adm.config.Write("RefreshRate", rr, self, self.panelName)
self.refreshTimeout=rr
self.StartTimer()
开发者ID:ed00m,项目名称:admin4,代码行数:25,代码来源:page.py
示例10: Go
def Go(self):
self.initDomains()
SpecificEntry.Go(self)
if not self.sambaGroupMapping:
return
if self.dialog.node and self.sambaSid:
ss=self.sambaSid.split('-')
self.sambaRid = ss[7]
self.sambaDomainSid='-'.join(ss[:-1])
self.sambaDomainName = self.sambaDomainSid
self.EnableControls("sambaDomainSid sambaRid ridGen", False)
wkg=smbWellKnownGroups.get(self.sambaRid)
if wkg:
self.GroupTypeLabel=xlt("Well Known Group")
self.GroupType=xlt(wkg)
else:
sgt=smbGroupTypes.get(self.dialog.GetAttrValue("sambaGroupType"))
if sgt:
self.GroupType=xlt(sgt)
else:
self.GroupType=xlt("Domain Group")
else:
self.dialog.SetValue("sambaGroupType", 2)
self.GroupType=xlt("Domain Group")
self.OnChangeDomain()
开发者ID:andreas-p,项目名称:admin4,代码行数:28,代码来源:Samba.py
示例11: registerToggles
def registerToggles(self, toolbar, statusbar):
""" have toolbar and/or statusbar toggle in viewmenu """
if toolbar:
self.viewmenu.AddCheck(self.OnToggleToolBar, xlt("Toolbar"), xlt("Show or hide tool bar"), adm.config.Read("ToolbarShown", True, self))
if statusbar:
self.viewmenu.AddCheck(self.OnToggleStatusBar, xlt("Statusbar"), xlt("Show or hide status bar"), adm.config.Read("StatusbarShown", True, self))
开发者ID:ed00m,项目名称:admin4,代码行数:7,代码来源:frame.py
示例12: OnAddSnippet
def OnAddSnippet(self, evt):
sql=self.getSql()
if sql:
dlg=wx.TextEntryDialog(self, xlt("Snippet name"), xlt("Add snippet"))
if dlg.ShowModal() == wx.ID_OK:
name=dlg.GetValue()
self.snippets.AppendSnippet(name, sql)
self.SetStatus(xlt("Snipped stored."))
开发者ID:ed00m,项目名称:admin4,代码行数:8,代码来源:QueryTool.py
示例13: Check
def Check(self):
ok=True
if not self.node:
ok=self.CheckValid(ok, self.Hostname, xlt("Host name cannot be empty"))
ok=self.CheckValid(ok, not adm.config.existsServer(self, self.HostName), xlt("Host name already in use"))
ok=self.CheckValid(ok, self.HostAddress, xlt("Host address cannot be empty"))
ok=self.CheckValid(ok, self.Port, xlt("Port cannot be 0"))
return ok
开发者ID:andreas-p,项目名称:admin4,代码行数:8,代码来源:Server.py
示例14: __init__
def __init__(self, node):
self.lastError=None
self.wasConnected=False
self.ldap=None
self.node=node
self.subschema=None
self.base=None
ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_ALLOW)
ldap.set_option(ldap.OPT_REFERRALS,0)
if node.settings['security'] == "ssl":
protocol="ldaps"
else:
protocol="ldap"
uri="%s://%s:%d" % (protocol, node.settings['host'], node.settings['port'])
try:
spot="Connect"
self.ldap=ldap.ldapobject.SimpleLDAPObject(uri)
if node.settings['security'] == "tls":
spot="StartTLS"
self.ldap.start_tls_s()
ldap.timeout=node.timeout
spot=xlt("OptReferrals")
self.ldap.set_option(ldap.OPT_REFERRALS,0)
user=node.settings['user']
spot=xlt("Bind")
if user:
self.ldap.simple_bind_s(user, node.password)
else:
self.ldap.simple_bind_s("", "")
except Exception as e:
self.ldap=None
self.lastError = str(e)
raise adm.ConnectionException(self.node, spot, self.lastError)
try:
result=self.ldap.search_s("", ldap.SCOPE_BASE, "(objectClass=*)", ['*','+'] )
self.base=result[0][1]
try:
subschemaDN=self.base['subschemaSubentry'][0]
# result=self.ldap.search_s(subschemaDN, ldap.SCOPE_BASE, "(objectClass=*)", ['*','+'] )
result=self.ldap.search_s(subschemaDN, ldap.SCOPE_BASE, "(objectClass=*)", ['ldapSyntaxes', 'attributeTypes', 'objectclasses', 'matchingRules', 'matchingRuleUse'] )
self.subschema=ldap.schema.SubSchema(result[0][1])
except Exception as e:
logger.debug("Didn't get subschema: %s", str(e))
pass
except Exception as e:
logger.debug("Didn't get config: %s", str(e))
pass
开发者ID:andreas-p,项目名称:admin4,代码行数:58,代码来源:_ldap.py
示例15: OnGridRightClick
def OnGridRightClick(self, evt):
property = self.grid.GetSelection()
if property:
oid = property.GetName()
if oid:
name = self.dialog.attribs[oid].name
cm = Menu(self.dialog)
cm.Add(self.OnDelAttrs, xlt("Remove %s") % name, xlt('Remove attribute "%s"') % name)
cm.Popup(evt)
开发者ID:saydulk,项目名称:admin4,代码行数:9,代码来源:GenericEntry.py
示例16: GetInfo
def GetInfo(self):
if self.IsConnected():
le=self.GetLastError()
if le:
return xlt("Connection error: %s") % le
else:
return xlt("connected")
else:
return xlt("not connected")
开发者ID:andreas-p,项目名称:admin4,代码行数:9,代码来源:node.py
示例17: OnExecute
def OnExecute(parentWin, node):
dlg=wx.TextEntryDialog(parentWin, xlt("New mailbox path"), xlt("Move mailbox %s") % node.mailboxPath)
dlg.SetValue(node.mailboxPath)
if dlg.ShowModal() == wx.ID_OK:
newPath=dlg.GetValue()
rc=node.GetConnection().RenameMailbox(node.mailboxPath, newPath)
if rc:
node.parentNode.Refresh()
return False
开发者ID:ed00m,项目名称:admin4,代码行数:9,代码来源:Mailbox.py
示例18: run
def run(self):
update=OnlineUpdate()
if update.IsValid():
adm.updateInfo=update
if update.UpdateAvailable():
wx.CallAfter(self.frame.OnUpdate)
elif update.exception:
wx.CallAfter(wx.MessageBox,
xlt("Connection error while trying to retrieve update information from the update server.\nCheck network connectivity and proxy settings!"),
xlt("Communication error"), wx.ICON_EXCLAMATION)
开发者ID:andreas-p,项目名称:admin4,代码行数:10,代码来源:Update.py
示例19: saveFile
def saveFile(self, proc):
try:
ok=proc(self, self.editor.GetText(), self.filePatterns, xlt("Save SQL Query"))
if ok:
self.SetStatus(xlt("Saved SQL query to %s") % self.fileManager.filename)
self.sqlChanged=False
self.updateMenu()
else:
self.StatusText(xlt("Nothing saved"))
except:
self.SetStatus(xlt("Failed to save to %s") % self.fileManager.filename)
开发者ID:ed00m,项目名称:admin4,代码行数:11,代码来源:QueryTool.py
示例20: OnDelete
def OnDelete(self, evt):
node=self.tree.GetNode()
if node and hasattr(node, "Delete"):
if not adm.ConfirmDelete(xlt("Delete \"%s\"?") % node.name, xlt("Deleting %s") % node.typename):
return
if node.Delete():
node.RemoveFromTree()
self.SetStatus(xlt("%s \"%s\" deleted.") % (node.typename, node.name))
else:
self.SetStatus(xlt("%s \"%s\" NOT deleted: %s.") % (node.typename, node.name, node.GetServer().GetLastError()))
开发者ID:ed00m,项目名称:admin4,代码行数:11,代码来源:frame.py
注:本文中的wh.xlt函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论