⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 growlnotifier.py

📁 属性sosuo算法
💻 PY
字号:
import objcimport Foundationimport prefsimport config###############################################################################DOWNLOAD_COMPLETE = 'Download Complete'DOWNLOAD_FAILED = 'Download Failed'###############################################################################bundlePath = '%s/Growl.framework' % Foundation.NSBundle.mainBundle().privateFrameworksPath()objc.loadBundle('Growl', globals(), bundle_path=bundlePath)###############################################################################def register():    notifier = GrowlNotifier.alloc().init()    GrowlApplicationBridge.setGrowlDelegate_(notifier)def notifyDownloadComplete(title):    GrowlApplicationBridge.notifyWithTitle_description_notificationName_iconData_priority_isSticky_clickContext_(        'Download Completed',        'Download of video \'%s\' is finished.' % title,        DOWNLOAD_COMPLETE,        objc.nil,        0,        objc.YES,        objc.nil)def notifyDownloadFailed(title):    GrowlApplicationBridge.notifyWithTitle_description_notificationName_iconData_priority_isSticky_clickContext_(        'Download Failed',        'Download of video \'%s\' has failed.' % title,        DOWNLOAD_FAILED,        objc.nil,        0,        objc.YES,        objc.nil)###############################################################################class GrowlNotifier (NSObject):        def registrationDictionaryForGrowl(self):        notifications = [DOWNLOAD_COMPLETE]        info = {'ApplicationName': config.get(prefs.LONG_APP_NAME),                'AllNotifications': notifications,                 'DefaultNotifications': notifications}        return info        ###############################################################################

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -