本文整理匯總了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')