本文整理汇总了Python中variety.Util.Util.log_all方法的典型用法代码示例。如果您正苦于以下问题:Python Util.log_all方法的具体用法?Python Util.log_all怎么用?Python Util.log_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类variety.Util.Util
的用法示例。
在下文中一共展示了Util.log_all方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from variety.Util import Util [as 别名]
# 或者: from variety.Util.Util import log_all [as 别名]
def main():
if datetime.datetime.now() - datetime.datetime.strptime(REL_DATE, "%Y-%m-%d") > datetime.timedelta(
days=180):
print VarietyWindow.OUTDATED_MSG
return
# Ctrl-C
signal.signal(signal.SIGINT, sigint_handler)
signal.signal(signal.SIGTERM, sigint_handler)
signal.signal(signal.SIGQUIT, sigint_handler)
Util.makedirs(os.path.expanduser(u"~/.config/variety/"))
arguments = map(_u, sys.argv[1:])
# validate arguments and set up logging
options, args = VarietyWindow.VarietyWindow.parse_options(arguments)
set_up_logging(options.verbose)
monkeypatch_ssl()
if options.verbose > 2:
Util.log_all(VarietyWindow.VarietyWindow)
if options.verbose > 3:
Util.log_all(ThumbsManager.ThumbsManager)
Util.log_all(ThumbsWindow.ThumbsWindow)
bus = dbus.SessionBus()
# ensure singleton
if bus.request_name(DBUS_KEY) != dbus.bus.REQUEST_NAME_REPLY_PRIMARY_OWNER:
if not arguments:
arguments = ["--preferences"]
safe_print(_("Variety is already running. Sending the command to the running instance."),
"Variety is already running. Sending the command to the running instance.")
method = bus.get_object(DBUS_KEY, DBUS_PATH).get_dbus_method("process_command")
result = method(arguments)
if result:
safe_print(result)
return
# Run the application.
window = VarietyWindow.VarietyWindow()
global VARIETY_WINDOW
VARIETY_WINDOW = window
service = VarietyService(window)
bus.call_on_disconnection(window.on_quit)
window.start(arguments)
GObject.timeout_add(2000, check_quit)
GObject.threads_init()
Gdk.threads_init()
Gdk.threads_enter()
Gtk.main()
Gdk.threads_leave()