本文整理汇总了Python中helper.QHelper.str方法的典型用法代码示例。如果您正苦于以下问题:Python QHelper.str方法的具体用法?Python QHelper.str怎么用?Python QHelper.str使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类helper.QHelper
的用法示例。
在下文中一共展示了QHelper.str方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set
# 需要导入模块: from helper import QHelper [as 别名]
# 或者: from helper.QHelper import str [as 别名]
def set( cls, sender, recipient, message, ts=None ):
cls.setPath( sender, recipient )
if not ts:
ts = time.time()
cls.handle()[str( ts )] = {
'ts':str( int( ts ) ),
'sender':QHelper.str( sender ),
'recipient':QHelper.str( recipient ),
'message':QHelper.str( message )
}
cls.handle().sync()
示例2: reportSubmitCallback
# 需要导入模块: from helper import QHelper [as 别名]
# 或者: from helper.QHelper import str [as 别名]
def reportSubmitCallback( self ):
QHelper.log( '::CONNECT:QReportView:reportSubmit' )
data = self.values()
reportData = 'report %sh %sm on %s %s' % (
QHelper.str( data.get( 'h', '0' ) ),
QHelper.str( data.get( 'm', '0' ) ),
QHelper.str( data.get( 'project', '' ) ),
QHelper.str( data.get( 'summary', '' ) ),
)
print '::REPORT:MESSAGE', reportData
QHelper.master().emit( QtCore.SIGNAL( 'transportSignal' ), 'sendMessage', DBConf.get( 'bot' ), reportData )
self.hide()
示例3: projectDataCallback
# 需要导入模块: from helper import QHelper [as 别名]
# 或者: from helper.QHelper import str [as 别名]
def projectDataCallback( self, projectData ):
print '::QProjctData', projectData.items()
QHelper.log( '::CONNECT:QProjectData:projectData', projectData )
self.clear()
data = '<table width="100%" cellspacing="4" cellpadding="0">'
n=0
for k, v in projectData.items():
print k,v
if QHelper.str( k ) in ['_id', '_rev']:
continue
n+=1
data += '<tr>'
data += '<th style="background:'+(n%2 and '#f6f6f6' or '#fcfcfc')+';">' + str( k ) + '</th>'
data += '<td style="">' + self.plain( v ) + '</td>'
data += '</tr>'
data += '</table>'
text = '<span style="font-weight:bold; color:#66f;">[%s]</span><br />%s<br />' % (
self.project,
data
)
self.write( text )
print '::WROTE'