本文整理汇总了Python中psr.sys.Sys.getpid方法的典型用法代码示例。如果您正苦于以下问题:Python Sys.getpid方法的具体用法?Python Sys.getpid怎么用?Python Sys.getpid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类psr.sys.Sys
的用法示例。
在下文中一共展示了Sys.getpid方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from psr.sys import Sys [as 别名]
# 或者: from psr.sys.Sys import getpid [as 别名]
def run(self):
""""""
self.cancelled = False
Sys.g.MPEVENT.clear()
print(Sys.g.LOG_LEVEL)
Cli("./", Sys.getpid(), self.cliargs, self, Sys.g.LOG_LEVEL)
self.emit("completed")
示例2: _write
# 需要导入模块: from psr.sys import Sys [as 别名]
# 或者: from psr.sys.Sys import getpid [as 别名]
def _write(sign, t=None, enter=True, args=''):
""""""
if Sys.g.DEBUG :
#~ DONT USE Sys.g.RLOCK
isChildProc = not Sys.g_is_main_proc()
bind_data = []
if t is not None :
bind_data += Sys.pdate(t.timetuple() if enter else Sys.datetime.now().timetuple(), isChildProc)
a, b, c, d, e = ('=> ' if enter else '<= '), '['+str(Sys.getpid()).rjust(5,' ')+']', ' '+sign+'(', Log._formatArgs(args), ') '
if not isChildProc :
Sys.echo(a , Sys.CLZ_IO , False)
Sys.echo(b , Sys.CLZ_PID if not isChildProc else Sys.CLZ_CPID, False)
Sys.echo(c , Sys.CLZ_FUNC, False)
try:
Sys.echo(d , Sys.CLZ_ARGS, False)
except :
Sys.echo('?nr_arg?' , Sys.CLZ_ARGS, False)
pass
Sys.echo(e , Sys.CLZ_FUNC, False)
bind_data += [(a, Const.CLZ_IO),(b, Const.CLZ_CPID if isChildProc else Const.CLZ_PID),(c , Const.CLZ_CFUNC if isChildProc else Const.CLZ_FUNC),(d , Const.CLZ_ARGS),(e , Const.CLZ_CFUNC if isChildProc else Const.CLZ_FUNC)]
if not enter and t is not None :
bind_data += Sys.pdelta(t, '', isChildProc)
else :
bind_data += Sys.dprint(dbcall=isChildProc)
if isChildProc :
Sys.sendMainProcMsg(1, bind_data)
else :
Sys.wlog(bind_data)
示例3: on_start
# 需要导入模块: from psr.sys import Sys [as 别名]
# 或者: from psr.sys.Sys import getpid [as 别名]
def on_start(self):
""""""
Sys.g.GUI_PRINT_STDOUT = False
Sys.g.GUI = True
init(conf.PRG_NAME, False, Sys.getpid(), True, Const.LOG_ALL)
self.conf = ImpraConf(KiniFile('impra2.ini'))
self.populate_profiles()
self.populate_config()
self.taskLabel = ImpraThread.TASK_LABEL
self.taskStock = ImpraThread.TASK_STOCK
self.progressbar = self.get('progressbar1')
self.textview = self.get('textview1')
try :
self.textview.override_background_color(Gtk.StateFlags.NORMAL, Gdk.RGBA(0, 0, 0, 1.0))
self.textview.modify_font(Pango.font_description_from_string ('DejaVu Sans Mono Book 11' if Sys.isUnix() else 'Lucida Conosle 11'))
except :
pass
self.textbuffer = self.textview.get_buffer()
self.tags = self.buildTxtTags(self.textbuffer)
self.initWidgetByThread('impra-1', self.textview, self.textbuffer, self.progressbar, self.tags)
self.initWidgetByThread('MainThread', self.textview, self.textbuffer, self.progressbar, self.tags)
self.tree = self.get('treeview1')
self.tree.connect('row-activated', self.on_row_select)
self.tree.get_selection().connect('changed', self.on_tree_selection_changed)
self.launch_thread(self.on_ended)
self.searchCatg = self.get('comboboxtext1')
self.searchUser = self.get('comboboxtext4')
self.searchAccount = self.get('comboboxtext5')
self.filterIds = None
self.index = None
self.taskList = {}
self.threads_work = [False, False]
示例4: __init__
# 需要导入模块: from psr.sys import Sys [as 别名]
# 或者: from psr.sys.Sys import getpid [as 别名]
def __init__(self, debug=False, color=True, loglvl=Const.LOG_NEVER):
""""""
self.encmode = conf.DEFVAL_ENCMODE
self.splitmode = False
self.compression = conf.DEFVAL_COMP
self.mix = conf.DEFVAL_MIXMODE
self.random = conf.DEFVAL_RANDOMMODE
self.nproc = conf.DEFVAL_NPROC
self.src = None
self.dst = None
self.kpath = None
Sys.g.GUI = True
init(conf.PRG_NAME, debug, Sys.getpid(), color, loglvl)
示例5: __init__
# 需要导入模块: from psr.sys import Sys [as 别名]
# 或者: from psr.sys.Sys import getpid [as 别名]
def __init__(self, task, nproc=2, delay=None, event=None, *args, **kwargs):
""""""
self.readers = []
self.plist = []
self.onstart_bind = None
self.onrun_bind = None
self.onend_bind = None
for id in range(nproc):
r, w = Pipe(duplex=False)
self.readers.append(r)
# (process, wpipe)
p = Process(target=Worker, args=tuple([Sys.g.PRJ_NAME, Sys.g.DEBUG, Sys.g.GUI, Sys.g.COLOR_MODE, Sys.g.LOG_LEVEL, Sys.getpid(), event, id, w, delay, task])+tuple(args), kwargs=kwargs)
self.plist.append((p, w))