本文整理汇总了Python中notifier.Notifier类的典型用法代码示例。如果您正苦于以下问题:Python Notifier类的具体用法?Python Notifier怎么用?Python Notifier使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Notifier类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
def run (repository):
n = Notifier( title=NOTIFIER_TITLE )
n.message( message=( "committer::run( '%s' )" % repository ) )
# - create a lock file
file_lock = open( Config.PATH_TETHERBALL_COMMIT, 'w' )
file_lock.write( str( os.getpid() ) )
file_lock.close()
# timeout
time.sleep( SEC_SLEEP )
try:
str_last = subprocess.check_output( COMMAND, shell=True )
ms_now = int( time.time() * 1000 )
if str_last != '':
ms_last = int( str_last.strip() )
else:
ms_last = ms_now - int(SEC_SLEEP * 1000) - 1
if (ms_now - ms_last) > (SEC_SLEEP * 1000):
_run_main(repository)
else:
run(repository)
except Exception, e:
l = Logger(Config)
l.debug( 'Failed on committer.py: %s' % e)
示例2: notify
def notify(jobid, ntypes):
log.debug("ntypes in notify is {}".format(ntypes))
for ntype in ntypes:
log.info("Putting result into notifier queue:{} \
with addr:{}".format(ntype["ntype"], ntype["naddr"]))
notifier = Notifier(config.redisserver, ntype["ntype"])
notifier.notify(jobid, ntype["naddr"])
示例3: main
def main():
config_json = json.load(codecs.open("config_release.json", "r", encoding="UTF-8"))
db_config = config_json["database"]
smtp_config = config_json["smtp"]
santa_config = config_json["santa"]
postgres = PostgresInjection(db_config)
with Shuffler(postgres, santa_config) as shuffler:
shuffler.work()
notifier = Notifier(postgres, smtp_config, santa_config)
notifier.notify_unawared()
示例4: update_view
def update_view(manufacturers):
list_store = gtk.ListStore(gtk.gdk.Pixbuf, str, str)
list_store.set_sort_column_id(1, gtk.SORT_ASCENDING)
game_count = 0
for manufacturer in manufacturers:
for device in manufacturer.get_devices():
for folder in device.get_folders():
for game in folder.get_games():
list_store.append([CoverLoader.load(util.ApplicationManager.get_path(), manufacturer, device, game, 184, 256), game.get_name(), folder.get_path()])
game_count += 1
CoverViewManager._icon_view.set_model(list_store)
Notifier.create_info_notification("Search Result", "{0} media{1} found".format(game_count, "" if game_count == 1 else "s"))
示例5: __init__
def __init__(self, mic, profile, logger):
self.persona = profile['persona']
self.mic = mic
self.profile = profile
self.brain = Brain(mic, profile, logger)
self.notifier = Notifier(profile, logger)
self.logger = logger
示例6: __init__
def __init__(self, parent = None, settings_path = ""):
super(zcswebapp, self).__init__(parent)
self.setWindowTitle('zcswebapp')
self.settings_path = settings_path
self.notifier = Notifier(Resources.APP_NAME, Resources.get_path('zcswebapp.png'))
self.settings = QSettings(self.settings_path + '/zcswebapp.cfg', QSettings.IniFormat)
self.identifier = self.settings.value("Domain")
if Unity is not None:
self.launcher = Unity.LauncherEntry.get_for_desktop_id("zcswebapp.desktop")
else:
self.launcher = DummyLauncher(self)
self.webSettings()
self.leftPane = LeftPane(self)
webView = Wrapper(self)
webView.page().networkAccessManager().setCookieJar(self.cookiesjar)
self.stackedWidget = QtGui.QStackedWidget()
self.stackedWidget.addWidget(webView)
centralWidget = QtGui.QWidget(self)
layout = QtGui.QHBoxLayout()
layout.setContentsMargins(0, 0, 0, 0)
layout.setSpacing(0)
layout.addWidget(self.leftPane)
layout.addWidget(self.stackedWidget)
centralWidget.setLayout(layout)
self.setCentralWidget(centralWidget)
self.addMenu()
self.tray = Systray(self)
self.systray(zcswebapp.minimized)
self.installEventFilter(self)
if self.identifier is None:
webView.load(QtCore.QUrl(Resources.SIGNIN_URL))
else:
webView.load(QtCore.QUrl(self.domain()))
webView.show()
示例7: __init__
def __init__(self, persona, mic, profile):
self._logger = logging.getLogger(__name__)
self.persona = persona
self.mic = mic
self.profile = profile
self.brain = Brain(mic, profile)
self.notifier = Notifier(profile)
示例8: __init__
def __init__(self,conn):
WADebug.attach(self);
self.conn = conn;
super(WAEventHandler,self).__init__();
self.notifier = Notifier();
self.connMonitor = ConnMonitor();
self.connMonitor.connected.connect(self.networkAvailable);
self.connMonitor.disconnected.connect(self.networkDisconnected);
#self.connMonitor.sleeping.connect(self.networkUnavailable);
#self.connMonitor.checked.connect(self.checkConnection);
self.mediaHandlers = []
self.sendTyping.connect(self.conn.sendTyping);
self.sendPaused.connect(self.conn.sendPaused);
self.getLastOnline.connect(self.conn.getLastOnline);
self.connected.connect(self.conn.resendUnsent);
self.pingTimer = QTimer();
self.pingTimer.timeout.connect(self.sendPing)
self.pingTimer.start(180000);
示例9: Conversation
class Conversation(object):
def __init__(self, persona, speaker, profile):
self.persona = persona
self.speaker = speaker
self.profile = profile
self.notifier = Notifier(profile)
self.brain = Brain(speaker, profile)
def handleForever(self):
while True:
notifications = self.notifier.getAllNotifications()
for notif in notifications:
self.speaker.say(notif)
threshold, transcribed = self.speaker.passiveListen(self.persona)
if not threshold or not transcribed:
continue
input = self.speaker.activeListenToAllOptions(threshold)
if input:
self.brain.query(self.profile, transcribed)
示例10: test_notify
def test_notify():
ntype1 = str(uuid.uuid1())
ntype2 = str(uuid.uuid1())
ntypes = [{"ntype": ntype1, "naddr": "127.0.0.1"}, {"ntype": ntype2, "naddr": "[email protected]"}]
notifier1 = Notifier(config.redisserver, ntype1)
notifier2 = Notifier(config.redisserver, ntype2)
notify("test-id", ntypes)
jid, data = notifier1.get()
assert data == "127.0.0.1"
jid, data = notifier2.get()
assert data == "[email protected]"
示例11: __init__
def __init__(self, parent = None, settings_path = ""):
super(ScudCloud, self).__init__(parent)
self.setWindowTitle('ScudCloud')
self.settings_path = settings_path
self.notifier = Notifier(Resources.APP_NAME, Resources.get_path('scudcloud.png'))
self.settings = QSettings(self.settings_path + '/scudcloud.cfg', QSettings.IniFormat)
self.identifier = self.settings.value("Domain")
if Unity is not None:
self.launcher = Unity.LauncherEntry.get_for_desktop_id("scudcloud.desktop")
else:
self.launcher = DummyLauncher(self)
self.webSettings()
self.leftPane = LeftPane(self)
self.stackedWidget = QtGui.QStackedWidget()
centralWidget = QtGui.QWidget(self)
layout = QtGui.QHBoxLayout()
layout.setContentsMargins(0, 0, 0, 0)
layout.setSpacing(0)
layout.addWidget(self.leftPane)
layout.addWidget(self.stackedWidget)
centralWidget.setLayout(layout)
self.setCentralWidget(centralWidget)
self.startURL = Resources.SIGNIN_URL
if self.identifier is not None:
self.startURL = self.domain()
self.addWrapper(self.startURL)
self.addMenu()
self.tray = Systray(self)
self.systray(ScudCloud.minimized)
self.installEventFilter(self)
self.statusBar().showMessage('Loading Slack...')
示例12: __init__
def __init__(self, parent=None):
super(ScudCloud, self).__init__(parent)
self.setWindowTitle('ScudCloud')
self.notifier = Notifier(self.APP_NAME, get_resource_path('scudcloud.png'))
self.settings = QSettings(expanduser("~")+"/.scudcloud", QSettings.IniFormat)
self.identifier = self.settings.value("Domain")
if Unity is not None:
self.launcher = Unity.LauncherEntry.get_for_desktop_id("scudcloud.desktop")
else:
self.launcher = DummyLauncher(self)
self.leftPane = LeftPane(self)
self.cookiesjar = PersistentCookieJar(self)
webView = Wrapper(self)
webView.page().networkAccessManager().setCookieJar(self.cookiesjar)
self.stackedWidget = QtGui.QStackedWidget()
self.stackedWidget.addWidget(webView)
centralWidget = QtGui.QWidget(self)
layout = QtGui.QHBoxLayout()
layout.setContentsMargins(0, 0, 0, 0)
layout.setSpacing(0)
layout.addWidget(self.leftPane)
layout.addWidget(self.stackedWidget)
centralWidget.setLayout(layout)
self.setCentralWidget(centralWidget)
self.addMenu()
self.tray = Systray(self)
self.systray()
self.installEventFilter(self)
self.zoom()
if self.identifier is None:
webView.load(QtCore.QUrl(self.SIGNIN_URL))
else:
webView.load(QtCore.QUrl(self.domain()))
webView.show()
示例13: __init__
def __init__(self, persona, mic, profile, house):
self.persona = persona
self.mic = mic
self.profile = profile
self.brain = Brain(mic, profile, house)
self.notifier = Notifier(profile, house)
self.house = house
示例14: run
def run (path, repository):
#imports
import daemon
# daemonize
pid = daemon.createDaemon()
# spit pid
try:
file_pid = open( os.path.join( Config.PATH_TETHERBALL_PROC, repository ), 'w' )
file_pid.write( str(pid) )
file_pid.close()
except Exception, e:
# l = Logger(Config)
# l.debug( "Failed to write pid into file: %s" )
n = Notifier( title=NOTIFIER_TITLE )
n.message( message=("Failed to write pid into file: %s" % e) )
示例15: __init__
def __init__(self, persona, mic, profile):
self._logger = logging.getLogger(__name__)
self.queue = Queue.Queue()
self.persona = persona
self.mic = mic
self.profile = profile
self.brain = Brain(mic, profile)
self.notifier = Notifier(profile)
self.mic.queue = self.queue
self.listener = Listener(mic, profile, self.queue)