本文整理汇总了Python中spectlib.watch.Watch.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Watch.__init__方法的具体用法?Python Watch.__init__怎么用?Python Watch.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类spectlib.watch.Watch
的用法示例。
在下文中一共展示了Watch.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from spectlib.watch import Watch [as 别名]
# 或者: from spectlib.watch.Watch import __init__ [as 别名]
def __init__(self, specto, id, values):
watch_values = [("username", spectlib.config.String(True)),
("password", spectlib.config.String(True)),
("label", spectlib.config.String(False))]
url = "https://mail.google.com"
self.standard_open_command = spectlib.util.return_webpage(url)
#Init the superclass and set some specto values
Watch.__init__(self, specto, id, values, watch_values)
if self.open_command == self.standard_open_command: #check if google apps url has to be used
if "@" in self.username and not "@gmail.com" and not "@googlemail.com" in self.username:
url = "http://mail.google.com/a/" + self.username.split("@")[1] # We use mail.google.com instead of gmail.com because of the trademark issue in Germany
self.standard_open_command = spectlib.util.return_webpage(url)
self.open_command = self.standard_open_command
self.use_network = True
self.icon = icon
self.type_desc = type_desc
self.cache_file = os.path.join(self.specto.CACHE_DIR, "gmail" + self.username + ".cache")
#watch specific values
self.oldMsg = 0
self.newMsg = 0
self.mail_info = Email_collection()
self.read_cache_file()
示例2: __init__
# 需要导入模块: from spectlib.watch import Watch [as 别名]
# 或者: from spectlib.watch.Watch import __init__ [as 别名]
def __init__(self, specto, id, values):
watch_values = [("folder", spectlib.config.String(True))]
self.icon = icon
self.standard_open_command = 'xdg-open %s' % values['folder']
self.type_desc = type_desc
#Init the superclass and set some specto values
Watch.__init__(self, specto, id, values, watch_values)
self.use_network = True
self.repositoy_info = []
self.remote_branch_label = ""
self.local_changes = []
self.remote_changes = []
# Kind of changes to check for, and there are two copies
# so it is possible to make different checks for local/remote
self.local_check_kinds = [pysvn.wc_status_kind.modified,\
pysvn.wc_status_kind.added,\
pysvn.wc_status_kind.deleted,\
pysvn.wc_status_kind.replaced,\
pysvn.wc_status_kind.merged,\
]
self.remote_check_kinds = [pysvn.wc_status_kind.modified,\
pysvn.wc_status_kind.added,\
pysvn.wc_status_kind.deleted,\
pysvn.wc_status_kind.replaced,\
pysvn.wc_status_kind.merged,\
]
#Init the pysvn client, and error style
self.svn_client = pysvn.Client()
self.svn_client.exception_style = 0
示例3: __init__
# 需要导入模块: from spectlib.watch import Watch [as 别名]
# 或者: from spectlib.watch.Watch import __init__ [as 别名]
def __init__(self, specto, id, values):
watch_values = [("receivedimmsg_", spectlib.config.Boolean(False)),
("receivedchatmsg_", spectlib.config.Boolean(False)),
("buddystatuschanged_", spectlib.config.Boolean(False)),
("buddysignedon_", spectlib.config.Boolean(False)),
("buddysignedoff_", spectlib.config.Boolean(False))
]
self.icon = icon
self.standard_open_command = ''
self.type_desc = type_desc
#Init the superclass and set some specto values
Watch.__init__(self, specto, id, values, watch_values)
self.dbus = True
self.message = ""
self.extra_info = ""
# Use the dbus interface we saw in dbus-notify
self.dbus_interface = "im.pidgin.purple.PurpleInterface"
self.dbus_path = "/im/pidgin/purple/PurpleObject"
self.dbus_name = "im.pidgin.purple.PurpleService"
self.signals = {
"ReceivedImMsg": self.ReceivedImMsg,
"ReceivedChatMsg": self.ReceivedChatMsg,
"BuddyStatusChanged": self.BuddyStatusChanged,
"BuddySignedOn": self.BuddySignedOn,
"BuddySignedOff": self.BuddySignedOff,
}
示例4: __init__
# 需要导入模块: from spectlib.watch import Watch [as 别名]
# 或者: from spectlib.watch.Watch import __init__ [as 别名]
def __init__(self, specto, id, values):
watch_values = []
self.icon = icon
self.current_song = ""
self.standard_open_command = 'amarok'
self.type_desc = type_desc
#Init the superclass and set some specto values
Watch.__init__(self, specto, id, values, watch_values)
self.dbus = True
self.message = ""
self.extra_info = ""
# Use the dbus interface we saw in dbus-notify
self.dbus_interface = "org.kde.Amarok"
self.dbus_path = "/org/kde/Amarok"
self.dbus_name = "org.kde.Amarok"
self.signals = {"TrackChange": self.playingUriChanged}
def playingUriChanged(self, title, artist, album, track):
self.message = "%s - %s\nTrack: %s" %(artist, album, track)
self.current_song = "%s - %s" % (artist, track)
self.watch_changed()
示例5: __init__
# 需要导入模块: from spectlib.watch import Watch [as 别名]
# 或者: from spectlib.watch.Watch import __init__ [as 别名]
def __init__(self, refresh, port, specto, id, name = _("Unknown Process Watch")):
Watch.__init__(self, specto)
self.name = name
self.refresh = refresh
self.port = port
self.id = id
self.error = False
self.actually_updated=False
self.running = self.check_port()
示例6: __init__
# 需要导入模块: from spectlib.watch import Watch [as 别名]
# 或者: from spectlib.watch.Watch import __init__ [as 别名]
def __init__(self, refresh, file, mode, specto, id, name = _("Unknown File Watch")):
Watch.__init__(self, specto)
self.name = name
self.refresh = refresh
self.file = file
self.mode = mode
self.id = id
self.error = False
self.first_time = False
self.actually_updated = False
示例7: __init__
# 需要导入模块: from spectlib.watch import Watch [as 别名]
# 或者: from spectlib.watch.Watch import __init__ [as 别名]
def __init__(self, specto, name, refresh, url, id, error_margin):
Watch.__init__(self, specto) #init superclass
self.refresh = refresh
self.id = id
self.url_ = url
if self.url_ == "":
self.specto.logger.log(_("Watch: \"%s\" has error: empty url") % self.error, "error", self.__class__)
self.name = name
self.error_margin = error_margin#the amount in percent (as a float) of what the filesize must change to consider the page changed
self.error = False
示例8: __init__
# 需要导入模块: from spectlib.watch import Watch [as 别名]
# 或者: from spectlib.watch.Watch import __init__ [as 别名]
def __init__(self, refresh, host, username, password, ssl, specto, id, name = _("Unknown Mail Watch")):
Watch.__init__(self, specto)
self.name = name
self.refresh = refresh
self.host = host
self.user = username
self.password = password
self.id = id
self.error = False
self.ssl = ssl
示例9: __init__
# 需要导入模块: from spectlib.watch import Watch [as 别名]
# 或者: from spectlib.watch.Watch import __init__ [as 别名]
def __init__(self, refresh, username, password, specto, id, name = _("Unknown Mail Watch")):
Watch.__init__(self, specto)
self.name = name
self.refresh = refresh
if "@" not in username:
self.user = username + "@gmail.com"
else:
self.user = username
self.password = password
self.id = id
self.error = False
示例10: __init__
# 需要导入模块: from spectlib.watch import Watch [as 别名]
# 或者: from spectlib.watch.Watch import __init__ [as 别名]
def __init__(self, specto, id, values):
watch_values = [("port", spectlib.config.Integer(True))]
self.icon = icon
self.standard_open_command = ''
self.type_desc = type_desc
self.status = ""
#Init the superclass and set some specto values
Watch.__init__(self, specto, id, values, watch_values)
self.running = self.check_port()
示例11: __init__
# 需要导入模块: from spectlib.watch import Watch [as 别名]
# 或者: from spectlib.watch.Watch import __init__ [as 别名]
def __init__(self, specto, id, values):
watch_values = [("username", spectlib.config.String(True))]
self.standard_open_command = ""
#Init the superclass and set some specto values
Watch.__init__(self, specto, id, values, watch_values)
self.use_network = True
self.icon = icon
self.type_desc = type_desc
self.extra_information = ""
self.previous_song = ""
示例12: __init__
# 需要导入模块: from spectlib.watch import Watch [as 别名]
# 或者: from spectlib.watch.Watch import __init__ [as 别名]
def __init__(self, specto, id, values):
watch_values = [("process", spectlib.config.String(True))]
self.icon = icon
self.standard_open_command = values['process']
self.type_desc = type_desc
self.status = ""
#Init the superclass and set some specto values
Watch.__init__(self, specto, id, values, watch_values)
self.running_initially = self.check_process()
示例13: __init__
# 需要导入模块: from spectlib.watch import Watch [as 别名]
# 或者: from spectlib.watch.Watch import __init__ [as 别名]
def __init__(self, specto, id, values):
watch_values = [("file", String(True))]
self.icon = icon
self.open_command = ''
self.type_desc = type_desc
self.standard_open_command = "xdg-open '%s'" % values['file']
#Init the superclass and set some specto values
Watch.__init__(self, specto, id, values, watch_values)
self.cache_file = os.path.join(self.specto.CACHE_DIR, "file" + self.file.replace("/", "_") + ".cache")
self.first_time = False
示例14: __init__
# 需要导入模块: from spectlib.watch import Watch [as 别名]
# 或者: from spectlib.watch.Watch import __init__ [as 别名]
def __init__(self, specto, id, values):
watch_values = [("folder", spectlib.config.String(True))]
self.icon = icon
self.standard_open_command = "xdg-open '%s'" % values['folder']
self.type_desc = type_desc
#Init the superclass and set some specto values
Watch.__init__(self, specto, id, values, watch_values)
self.cache_file = os.path.join(self.specto.CACHE_DIR, "folder" + self.folder.replace("/", "_") + ".cache")
self.first_time = False
self.info = {}
self.info['removed'] = [0, ""]
self.info['created'] = [0, ""]
self.info['modified'] = [0, ""]
示例15: __init__
# 需要导入模块: from spectlib.watch import Watch [as 别名]
# 或者: from spectlib.watch.Watch import __init__ [as 别名]
def __init__(self, refresh, host, username, password, ssl, specto, id, name = _("Unknown Mail Watch")):
Watch.__init__(self, specto)
self.name = name
self.refresh = refresh
self.host = host
self.user = username
self.password = password
self.id = id
self.error = False
self.ssl = ssl
cacheSubDir__ = os.environ['HOME'] + "/.specto/cache/"
if not os.path.exists(cacheSubDir__):
os.mkdir(cacheSubDir__)
cacheFileName = "pop" + name + ".cache"
self.cacheFullPath_ = os.path.join(cacheSubDir__, cacheFileName)