本文整理汇总了Python中Windows.elevate_privileges方法的典型用法代码示例。如果您正苦于以下问题:Python Windows.elevate_privileges方法的具体用法?Python Windows.elevate_privileges怎么用?Python Windows.elevate_privileges使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Windows
的用法示例。
在下文中一共展示了Windows.elevate_privileges方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import Windows [as 别名]
# 或者: from Windows import elevate_privileges [as 别名]
def __init__(self, uac=True, shred_paths=None):
if uac and 'nt' == os.name and Windows.elevate_privileges():
# privileges escalated in other process
sys.exit(0)
import RecognizeCleanerML
RecognizeCleanerML.RecognizeCleanerML()
register_cleaners()
self.create_window()
gobject.threads_init()
if shred_paths:
self.shred_paths(shred_paths)
return
if options.get("first_start") and 'posix' == os.name:
pref = PreferencesDialog(self.window, self.cb_refresh_operations)
pref.run()
options.set('first_start', False)
if online_update_notification_enabled and options.get("check_online_updates"):
self.check_online_updates()
if 'nt' == os.name:
# BitDefender false positive. BitDefender didn't mark BleachBit as infected or show
# anything in its log, but sqlite would fail to import unless BitDefender was in "game mode."
# http://bleachbit.sourceforge.net/forum/074-fails-errors
try:
import sqlite3
except ImportError, e:
print e
print dir(e)
self.append_text(
_("Error loading the SQLite module: the antivirus software may be blocking it."), 'error')