specto-commits Mailing List for Specto
Brought to you by:
kiddokiddo
You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(7) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(62) |
Feb
(22) |
Mar
(27) |
Apr
(13) |
May
(26) |
Jun
(49) |
Jul
(9) |
Aug
(28) |
Sep
(29) |
Oct
(30) |
Nov
|
Dec
|
|
From: wout <wo...@us...> - 2006-10-26 13:00:56
|
Update of /cvsroot/specto/specto In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv30446 Modified Files: ChangeLog Log Message: ChangeLog updated Index: ChangeLog =================================================================== RCS file: /cvsroot/specto/specto/ChangeLog,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** ChangeLog 25 Oct 2006 05:49:25 -0000 1.19 --- ChangeLog 26 Oct 2006 13:00:41 -0000 1.20 *************** *** 1,2 **** --- 1,5 ---- + 2006-10-26 Wout Clymans + * Added SSL support for pop3/imap email watches + 2006-10-24 Giulio lotti, Jean-François Fortin & Thomas McColgan * gettext support, finally Specto can be translated into different languages ! |
|
From: wout <wo...@us...> - 2006-10-26 12:59:28
|
Update of /cvsroot/specto/specto/src/specto In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv29003/src/specto Modified Files: add_watch.py edit_watch.py main.py watch.py watch_mail_imap.py watch_mail_pop3.py Log Message: * Added SSL support for pop3/imap email watches Index: main.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/main.py,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** main.py 25 Oct 2006 05:49:28 -0000 1.49 --- main.py 26 Oct 2006 12:59:13 -0000 1.50 *************** *** 180,188 **** if int(values['prot']) == 0: #check if pop3, imap or gmail is used import specto.watch_mail_pop3 ! self.watch_db[id] = specto.watch_mail_pop3.Mail_watch(values['refresh'], values['host'], values['username'], values['password'], self, id, values['name']) elif int(values['prot']) == 1: import specto.watch_mail_imap ! self.watch_db[id] = specto.watch_mail_imap.Mail_watch(values['refresh'], values['host'], values['username'], values['password'], self, id, values['name']) else: import specto.watch_mail_gmail --- 180,188 ---- if int(values['prot']) == 0: #check if pop3, imap or gmail is used import specto.watch_mail_pop3 ! self.watch_db[id] = specto.watch_mail_pop3.Mail_watch(values['refresh'], values['host'], values['username'], values['password'], values['ssl'], self, id, values['name']) elif int(values['prot']) == 1: import specto.watch_mail_imap ! self.watch_db[id] = specto.watch_mail_imap.Mail_watch(values['refresh'], values['host'], values['username'], values['password'], values['ssl'], self, id, values['name']) else: import specto.watch_mail_gmail *************** *** 278,281 **** --- 278,282 ---- if int(values['prot']) == 0 or int(values['prot']) == 1: new_values['host'] = values['host'] + new_values['ssl'] = values['ssl'] new_values['username'] = values['username'] *************** *** 306,310 **** if int(values['prot']) == 0 or int(values['prot']) == 1: new_values['host'] = values['host'] ! new_values['host'] = values['host'] new_values['username'] = values['username'] --- 307,312 ---- if int(values['prot']) == 0 or int(values['prot']) == 1: new_values['host'] = values['host'] ! new_values['ssl'] = values['ssl'] ! new_values['host'] = values['host'] new_values['username'] = values['username'] Index: watch_mail_pop3.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/watch_mail_pop3.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** watch_mail_pop3.py 25 Oct 2006 05:49:29 -0000 1.12 --- watch_mail_pop3.py 26 Oct 2006 12:59:13 -0000 1.13 *************** *** 41,45 **** prot = 0 ! def __init__(self, refresh, host, username, password, specto, id, name = _("Unknown Mail Watch")): Watch.__init__(self, specto) self.name = name --- 41,45 ---- prot = 0 ! def __init__(self, refresh, host, username, password, ssl, specto, id, name = _("Unknown Mail Watch")): Watch.__init__(self, specto) self.name = name *************** *** 50,53 **** --- 50,54 ---- self.id = id self.error = False + self.ssl = ssl cacheSubDir__ = os.environ['HOME'] + "/.specto/cache/" *************** *** 68,72 **** try: ! s = poplib.POP3(self.host) except error, e: self.error = True --- 69,76 ---- try: ! if self.ssl == True: ! s = poplib.POP3_SSL(self.host) ! else: ! s = poplib.POP3(self.host) except error, e: self.error = True *************** *** 118,119 **** --- 122,127 ---- """ Set the host for the watch. """ self.host = host + + def set_ssl(self, ssl): + """ Use ssl support. """ + self.ssl = ssl \ No newline at end of file Index: add_watch.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/add_watch.py,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** add_watch.py 26 Oct 2006 01:48:06 -0000 1.33 --- add_watch.py 26 Oct 2006 12:59:10 -0000 1.34 *************** *** 83,97 **** self.wTree.get_widget("label7").set_label(new_name) ! def check_host(self, *args): """ ! Check if we have to show the host fields or not. """ if self.chkGmail.get_active() == True: self.lblHost.hide() self.txtHost.hide() else: self.lblHost.show() self.txtHost.show() ! def change_file_type(self, *args): """ Check if a file watch or a folder watch has to be used. """ --- 83,101 ---- self.wTree.get_widget("label7").set_label(new_name) ! def show_mail_options(self, *args): """ ! Check if we have to show the host and ssl fields or not. """ if self.chkGmail.get_active() == True: self.lblHost.hide() self.txtHost.hide() + self.lblSsl.hide() + self.chkSsl.hide() else: self.lblHost.show() self.txtHost.show() ! self.lblSsl.show() ! self.chkSsl.show() ! def change_file_type(self, *args): """ Check if a file watch or a folder watch has to be used. """ *************** *** 142,148 **** --- 146,154 ---- prot = 0 values.update({'host': self.txtHost.get_text()}) + values.update({'ssl':self.chkSsl.get_active()}) elif self.chkImap.get_active() == True: prot = 1 values.update({'host': self.txtHost.get_text()}) + values.update({'ssl':self.chkSsl.get_active()}) else: prot = 2 *************** *** 305,309 **** ###create the mail options gui ! self.tblMail = gtk.Table(rows=4, columns=2, homogeneous=False) self.tblMail.set_row_spacings(6) self.tblMail.set_col_spacings(6) --- 311,315 ---- ###create the mail options gui ! self.tblMail = gtk.Table(rows=5, columns=2, homogeneous=False) self.tblMail.set_row_spacings(6) self.tblMail.set_col_spacings(6) *************** *** 321,335 **** self.chkPop3 = gtk.RadioButton(None, _("POP3")) self.chkPop3.set_active(True) ! self.chkPop3.connect("toggled", self.check_host) vbox_prot.pack_start(self.chkPop3, True, True, 0) self.chkPop3.show() self.chkImap = gtk.RadioButton(self.chkPop3, _("IMAP")) ! self.chkImap.connect("toggled", self.check_host) vbox_prot.pack_start(self.chkImap, True, True, 0) self.chkImap.show() self.chkGmail = gtk.RadioButton(self.chkPop3, _("Gmail")) ! self.chkGmail.connect("toggled", self.check_host) vbox_prot.pack_start(self.chkGmail, True, True, 0) self.chkGmail.show() --- 327,341 ---- self.chkPop3 = gtk.RadioButton(None, _("POP3")) self.chkPop3.set_active(True) ! self.chkPop3.connect("toggled", self.show_mail_options) vbox_prot.pack_start(self.chkPop3, True, True, 0) self.chkPop3.show() self.chkImap = gtk.RadioButton(self.chkPop3, _("IMAP")) ! self.chkImap.connect("toggled", self.show_mail_options) vbox_prot.pack_start(self.chkImap, True, True, 0) self.chkImap.show() self.chkGmail = gtk.RadioButton(self.chkPop3, _("Gmail")) ! self.chkGmail.connect("toggled", self.show_mail_options) vbox_prot.pack_start(self.chkGmail, True, True, 0) self.chkGmail.show() *************** *** 365,369 **** self.txtHost.show() self.tblMail.attach(self.txtHost, 1, 2, 3, 4) ! ###create the file options gui self.tblFile = gtk.Table(rows=2, columns=2, homogeneous=False) --- 371,385 ---- self.txtHost.show() self.tblMail.attach(self.txtHost, 1, 2, 3, 4) ! ! #ssl ! self.lblSsl = gtk.Label(_("Use SSL:")) ! self.lblSsl.set_alignment(xalign=0.0, yalign=0.5) ! self.lblSsl.show() ! self.tblMail.attach(self.lblSsl, 0, 1, 4, 5) ! ! self.chkSsl = gtk.CheckButton(None, True) ! self.chkSsl.show() ! self.tblMail.attach(self.chkSsl, 1, 2, 4, 5) ! ###create the file options gui self.tblFile = gtk.Table(rows=2, columns=2, homogeneous=False) Index: edit_watch.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/edit_watch.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** edit_watch.py 25 Oct 2006 05:49:27 -0000 1.17 --- edit_watch.py 26 Oct 2006 12:59:10 -0000 1.18 *************** *** 133,138 **** values.update( ! { 'host': self.txtHost.get_text(), ! 'username': self.txtUsername.get_text(), 'password': self.txtPassword.get_text(), 'prot': prot} --- 133,137 ---- values.update( ! {'username': self.txtUsername.get_text(), 'password': self.txtPassword.get_text(), 'prot': prot} *************** *** 143,147 **** --- 142,148 ---- if int(values['prot']) != 2: #gmail doesn't need a host + values.update({'host': self.txtHost.get_text(), 'ssl': self.chkSsl.get_active() }) self.specto.watch_db[self.watch.id].set_host(values['host']) + self.specto.watch_db[self.watch.id].set_ssl(values['ssl']) elif values['type'] == 2: #add a file *************** *** 273,276 **** --- 274,285 ---- self.txtHost = gtk.Entry() tblMail.attach(self.txtHost, 1, 2, 3, 4) + + #ssl + lblSsl = gtk.Label(_("Use SSL:")) + lblSsl.set_alignment(xalign=0.0, yalign=0.5) + tblMail.attach(lblSsl, 0, 1, 4, 5) + + self.chkSsl = gtk.CheckButton(None, True) + tblMail.attach(self.chkSsl, 1, 2, 4, 5) if self.watch.prot == 0: *************** *** 279,283 **** self.txtHost.set_text(self.watch.host) self.txtHost.show() ! elif self.watch.prot == 1: self.lblProtocol_text.set_text(_("Imap")) --- 288,298 ---- self.txtHost.set_text(self.watch.host) self.txtHost.show() ! lblSsl.show() ! self.chkSsl.show() ! if self.watch.ssl == 'True': ! self.chkSsl.set_active(True) ! else: ! self.chkSsl.set_active(False) ! elif self.watch.prot == 1: self.lblProtocol_text.set_text(_("Imap")) *************** *** 285,288 **** --- 300,310 ---- self.txtHost.set_text(self.watch.host) self.txtHost.show() + lblSsl.show() + self.chkSsl.show() + if self.watch.ssl == 'True': + self.chkSsl.set_active(True) + else: + self.chkSsl.set_active(False) + else: self.lblProtocol_text.set_text(_("Gmail")) Index: watch_mail_imap.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/watch_mail_imap.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** watch_mail_imap.py 25 Oct 2006 05:49:29 -0000 1.11 --- watch_mail_imap.py 26 Oct 2006 12:59:13 -0000 1.12 *************** *** 38,42 **** prot = 1 ! def __init__(self, refresh, host, username, password, specto, id, name = _("Unknown Mail Watch")): Watch.__init__(self, specto) self.name = name --- 38,42 ---- prot = 1 ! def __init__(self, refresh, host, username, password, ssl, specto, id, name = _("Unknown Mail Watch")): Watch.__init__(self, specto) self.name = name *************** *** 47,50 **** --- 47,51 ---- self.id = id self.error = False + self.ssl = ssl def start_watch(self): *************** *** 59,63 **** try: ! server = imaplib.IMAP4(self.host) except error, e: self.error = True --- 60,67 ---- try: ! if self.ssl == True: ! server = imaplib.IMAP4_SSL(self.host) ! else: ! server = imaplib.IMAP4(self.host) except error, e: self.error = True *************** *** 101,102 **** --- 105,110 ---- """ Set the host. """ self.host = host + + def set_ssl(self, ssl): + """ Use ssl support. """ + self.ssl = ssl \ No newline at end of file Index: watch.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/watch.py,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** watch.py 25 Oct 2006 05:49:28 -0000 1.49 --- watch.py 26 Oct 2006 12:59:13 -0000 1.50 *************** *** 187,190 **** --- 187,191 ---- if int(values['prot']) != 2: values['host'] = watch_options['host'] + values['ssl'] = watch_options['ssl'] values['username'] = watch_options['username'] values['password'] = watch_options['password'] |
|
From: Jeff F. <kid...@us...> - 2006-10-26 01:48:14
|
Update of /cvsroot/specto/specto/src/specto In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv16554/src/specto Modified Files: add_watch.py Log Message: Fix bug #68307 that prevented the user from entering addresses with something else than http:// in them. Index: add_watch.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/add_watch.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** add_watch.py 25 Oct 2006 05:49:27 -0000 1.32 --- add_watch.py 26 Oct 2006 01:48:06 -0000 1.33 *************** *** 132,136 **** if values['type'] == 0: #add a website values['url'] = self.txtUrl.get_text() ! if values['url'][0:7] != "http://": values['url'] = "http://" + values['url'] --- 132,136 ---- if values['type'] == 0: #add a website values['url'] = self.txtUrl.get_text() ! if values['url'][:7] != "http://" and values['url'][:8] != "https://" and values['url'][:6] != "ftp://": values['url'] = "http://" + values['url'] |
|
From: Jeff F. <kid...@us...> - 2006-10-25 21:12:47
|
Update of /cvsroot/specto/specto In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv6002 Modified Files: setup.py Log Message: Added German translation by Thomas McColgan Index: setup.py =================================================================== RCS file: /cvsroot/specto/specto/setup.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** setup.py 25 Oct 2006 05:49:26 -0000 1.14 --- setup.py 25 Oct 2006 21:12:42 -0000 1.15 *************** *** 21,25 **** return files ! i18n_languages = "fr"#list all the languages, separated by one whitespace def give_mo_file(lang): return "po/" + str(lang) + "/specto.mo" --- 21,25 ---- return files ! i18n_languages = "fr ro de"#list all the languages, separated by one whitespace def give_mo_file(lang): return "po/" + str(lang) + "/specto.mo" |
|
From: Jeff F. <kid...@us...> - 2006-10-25 21:12:46
|
Update of /cvsroot/specto/specto/po/de In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv6002/po/de Added Files: specto.mo specto.po Log Message: Added German translation by Thomas McColgan --- NEW FILE: specto.mo --- (This appears to be a binary file; contents omitted.) --- NEW FILE: specto.po --- # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR ORGANIZATION # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: Wed Oct 25 21:24:04 2006\n" "PO-Revision-Date: 2006-10-25 22:25+0100\n" "Last-Translator: Thomas McColgan <tho...@gm...>\n" "Language-Team: LANGUAGE <LL...@li...>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Generated-By: pygettext.py 1.4\n" #: src/specto/add_watch.py:160 msgid "file" msgstr "Datei" #: src/specto/add_watch.py:162 msgid "folder" msgstr "Ordner" #: src/specto/add_watch.py:277 #: src/specto/edit_watch.py:199 msgid "URL:" msgstr "URL:" #: src/specto/add_watch.py:291 #: src/specto/edit_watch.py:210 msgid "Error Margin (%):" msgstr "Fehlertoleranz (%):" #: src/specto/add_watch.py:312 #: src/specto/edit_watch.py:235 msgid "Protocol:" msgstr "Protokol:" #: src/specto/add_watch.py:321 msgid "POP3" msgstr "POP3" #: src/specto/add_watch.py:327 msgid "IMAP" msgstr "IMAP" #: src/specto/add_watch.py:332 #: src/specto/edit_watch.py:288 msgid "Gmail" msgstr "Gmail" #: src/specto/add_watch.py:338 msgid "User:" msgstr "Benutzer:" #: src/specto/add_watch.py:348 #: src/specto/edit_watch.py:257 msgid "Password:" msgstr "Passwort" #: src/specto/add_watch.py:359 #: src/specto/edit_watch.py:269 msgid "Host:" msgstr "Host:" #: src/specto/add_watch.py:374 #: src/specto/edit_watch.py:300 msgid "File/folder:" msgstr "Datei/Ordner:" #: src/specto/add_watch.py:384 #: src/specto/edit_watch.py:310 msgid "File" msgstr "Datei" #: src/specto/add_watch.py:390 #: src/specto/edit_watch.py:315 msgid "Folder" msgstr "Ordner" #: src/specto/add_watch.py:396 #: src/specto/edit_watch.py:321 msgid "Choose a file or folder" msgstr "Wählen sie eine Datei oder einen Ordner aus: " #: src/specto/edit_watch.py:67 msgid "Edit watch: " msgstr "Beobachtung bearbeiten:" #: src/specto/edit_watch.py:162 msgid "Watch : \"%s\" edited." msgstr "Beobachtung : \"%s\" bearbeitet." #: src/specto/edit_watch.py:174 msgid "removed logs from watch: \"%s\"" msgstr "Logs von Beobachtung entfernt: : \"%s\"" #: src/specto/edit_watch.py:246 msgid "Username:" msgstr "Benutzername:" #: src/specto/edit_watch.py:277 msgid "Pop3" msgstr "Pop3" #: src/specto/edit_watch.py:283 msgid "Imap" msgstr "Imap" #: src/specto/logger.py:100 msgid "\\w\\s*- DEBUG -\\s*\\w" msgstr "\\w\\s*- DEBUG -\\s*\\w" #: src/specto/logger.py:102 msgid "\\w\\s*- INFO -\\s*\\w" msgstr "\\w\\s*- INFO -\\s*\\w" #: src/specto/logger.py:104 msgid "\\w\\s*- WARNING -\\s*\\w" msgstr "\\w\\s*- WARNUNG -\\s*\\w" #: src/specto/logger.py:106 msgid "\\w\\s*- ERROR -\\s*\\w" msgstr "\\w\\s*- FEHLER -\\s*\\w" #: src/specto/logger.py:108 msgid "\\w\\s*- CRITICAL -\\s*\\w" msgstr "\\w\\s*- KRITISCH -\\s*\\w" #: src/specto/main.py:56 msgid "no GTK, activating console mode" msgstr "kein GTK, aktiviere Konsolenmodus" #: src/specto/main.py:138 msgid "Specto is already running!" msgstr "Specto läuft bereits!" #: src/specto/main.py:208 #: src/specto/watch.py:215 msgid "No updates yet." msgstr "Bisher keine Updates." #: src/specto/main.py:259 msgid "watch \"%s\" started" msgstr "Beobachtung \"%s\" gestartet" #: src/specto/main.py:264 msgid "watch \"%s\" stopped" msgstr "Beobachtung \"%s\" gestoppt" #: src/specto/main.py:435 #: src/specto/main.py:444 msgid "notifier: reappear" msgstr "Benachrichtiger: wiedererscheinen" #: src/specto/main.py:440 msgid "notifier: hide" msgstr "Benachrichtiger: verstecken" #: src/specto/main.py:454 msgid "preferences: create" msgstr "Einstellungen: erstellen" #: src/specto/main.py:457 msgid "preferences: reappear" msgstr "Einstellungen: wiedererscheinen" #: src/specto/main.py:464 msgid "error log: create" msgstr "Fehlerlog: erstellen" #: src/specto/main.py:466 msgid "error log: already visible" msgstr "Fehlerlog: bereits sichtbar" #: src/specto/main.py:469 msgid "error log: recreate" msgstr "Fehlerlog: wiederherstellen" #: src/specto/main.py:475 msgid "add watch: create" msgstr "Beobachtung hinzufügen: erstellen" #: src/specto/main.py:477 msgid "add watch: already visible" msgstr "Beobachtung hinzufügen: bereits sichtbar" #: src/specto/main.py:480 msgid "add watch: recreate" msgstr "Beobachtung hinzufügen: wiederherstellen" #: src/specto/main.py:494 msgid "edit watch: create" msgstr "Beobachtung hinzufügen: erstellen" #: src/specto/main.py:496 msgid "edit watch: already visible" msgstr "Beobachtung hinzufügen: bereits sichtbar" #: src/specto/main.py:499 msgid "edit watch: recreate" msgstr "Beobachtung hinzufügen: wiederherstellen" #: src/specto/main.py:522 msgid "Specto is currently checking a watch for updates. When it has finished checking, try quitting Specto again." msgstr "Specto überprüft eine Beobachtung auf Neuerungen. Versuchen Sie erneut zu beenden, wenn Specto zu Ende geprüft hat." #: src/specto/notifier.py:343 msgid "gmail <i>(%s unread)</i>" msgstr "gmail <i>(%s ungelesen)</i>" #: src/specto/notifier.py:372 msgid "watch \"%s\" opened" msgstr "Beobachtung \"%s\" geöffnet" #: src/specto/notifier.py:404 msgid "You can add all kinds of websites as watches. Static pages, RSS or Atom feeds, etc. Specto will automatically handle them." msgstr "Sie können alle Arten von Webseiten als Beobachtung hinzufügen. Statische Seiten, RSS oder Atom Feeds, etc. Specto wird sie automatisch untersuchen." #: src/specto/notifier.py:405 msgid "Website watches can use an error margin that allows you to set a minimum difference percentage. This allows you to adapt to websites that change constantly or have lots of advertising." msgstr "Bei Webseiten können sie eine Fehlertoleranz auswählen, die die minimale Ãnderung in Prozent angibt. Dies ermöglicht es z.B. Seiten mit viel Werbung die sich ständig ändert zu überwachen." #: src/specto/notifier.py:406 msgid "Single-click an existing watch to display information, and double-click it to open the content." msgstr "Klicken sie einfach auf eine existierende Beobachtung um Informationen anzuzeigen, und doppelt um den Inhalt zu öffnen." #: src/specto/notifier.py:407 msgid "Please set a reasonable refresh interval in order to save bandwidth and prevent you from being blocked from content providers." msgstr "Bitte wählen Sie ein vernünftiges Aktualisierungsintervall um Bandbreite zu sparen und damit webseitenbetreiber Sie nicht blockieren." #: src/specto/notifier.py:466 msgid "notifier: size set" msgstr "Benachrichtiger: GröÃe eingestellt" #: src/specto/notifier.py:468 msgid "notifier: size not set" msgstr "Benachrichtiger: GröÃe nicht eingestellt" #: src/specto/notifier.py:472 msgid "notifier: position set" msgstr "Benachrichtiger: Position eingestellt" #: src/specto/notifier.py:474 msgid "notifier: position not set" msgstr "Benachrichtiger: Position nicht eingestellt" #: src/specto/notifier.py:530 msgid "Active" msgstr "Aktiv" #: src/specto/notifier.py:538 msgid "Type" msgstr "Typ" #: src/specto/notifier.py:547 msgid "Name" msgstr "Name" #: src/specto/notifier.py:556 msgid "ID" msgstr "ID" #: src/specto/notifier.py:563 msgid "TYPE" msgstr "TYP" #: src/specto/notifier.py:585 msgid "Tip of the Day:" msgstr "Tip des Tages:" #: src/specto/notifier.py:605 #: src/specto/notifier.py:660 #: src/specto/notifier.py:715 msgid "<b>Name:</b>" msgstr "<b>Name:</b>" #: src/specto/notifier.py:617 #: src/specto/notifier.py:672 #: src/specto/notifier.py:727 msgid "<b>Last Updated:</b>" msgstr "<b>Letztes Update:</b>" #: src/specto/notifier.py:629 msgid "<b>Location:</b>" msgstr "<b>Ort:</b>" #: src/specto/notifier.py:641 msgid "<b>Error Margin:</b>" msgstr "<b>Fehlertoleranz:</b>" #: src/specto/notifier.py:684 msgid "<b>Host:</b>" msgstr "<b>Host:</b>" #: src/specto/notifier.py:696 msgid "<b>Username:</b>" msgstr "<b>Benutzername:</b>" #: src/specto/notifier.py:739 msgid "<b>File/folder:</b>" msgstr "<b>Datei/Ordner:</b>" #: src/specto/preferences.py:92 msgid "Preferences saved." msgstr "Einstellungen gespeichert." #: src/specto/trayicon.py:84 msgid "Hide window" msgstr "Fenster verstecken" #: src/specto/trayicon.py:86 msgid "Show window" msgstr "Fenster zeigen" #: src/specto/trayicon.py:99 msgid "No updated watches." msgstr "Keine aktualisierten Beobachtungen." #: src/specto/trayicon.py:101 msgid "Updated watches:\n" msgstr "Aktualisierte Beobachtungen:\n" #: src/specto/trayicon.py:105 msgid " website" msgstr "Webseite" #: src/specto/trayicon.py:105 msgid " websites" msgstr "Webseiten" #: src/specto/trayicon.py:114 msgid " mail" msgstr "Post" #: src/specto/trayicon.py:114 msgid " mails" msgstr "mails" #: src/specto/trayicon.py:125 msgid " file/folders" msgstr "Datei/Ordner" #: src/specto/trayicon.py:125 msgid " files/folders" msgstr "Dateien/Ordner" #: src/specto/watch.py:73 msgid "Watch \"%s\" updated!" msgstr "Beobachtung \"%s\" aktualisiert!" #: src/specto/watch.py:89 msgid "The website, <b>%s</b>, has been updated." msgstr "Die Webseite <b>%s</b> wurde aktualisiert." #: src/specto/watch.py:93 msgid "Your email account, <b>%s</b>, has new mail." msgstr "Ihr Email-Account <b>%s</b> hat neue Mail." #: src/specto/watch.py:99 msgid "Your email account, <b>%s</b>, has <b>%d</b> new mail." msgstr "Ihr Email-Account, <b>%s</b>, hat <b>%d</b> neue Mails." #: src/specto/watch.py:101 msgid "Your email account, <b>%s</b>, has <b>%d</b> new unread mails, totalling %s" msgstr "Ihr Email-Account <b>%s</b> hat <b>%d</b> neue ungelesene Mails, insgesamt %s." #: src/specto/watch.py:116 msgid "The file/folder, <b>%s</b>, has been updated." msgstr "Die Datei/Der Ordner , <b>%s</b>, wurde aktualisiert." #: src/specto/watch.py:118 msgid "Not implemented yet" msgstr "Noch nicht implementiert" #: src/specto/watch_file.py:43 msgid "Unknown File Watch" msgstr "Unbekannte Dateibeobachtung" #: src/specto/watch_file.py:61 #: src/specto/watch_mail_gmail.py:63 #: src/specto/watch_mail_imap.py:58 #: src/specto/watch_mail_pop3.py:67 #: src/specto/watch_web_static.py:74 msgid "Updating watch: \"%s\"" msgstr "Aktualisiere Beobachtung: \"%s\"" #: src/specto/watch_file.py:84 msgid "Watch: \"%s\" has an error" msgstr "Beobachtung: \"%s\" hat einen Fehler" #: src/specto/watch_file.py:98 msgid "update: %s was modified" msgstr "Update: %s wurde modifiziert" #: src/specto/watch_file.py:103 msgid "update: %s was created" msgstr "Update: %s wurde erstellt." #: src/specto/watch_file.py:117 msgid "Skipping %s" msgstr "Ãberspringe %s" #: src/specto/watch_file.py:126 msgid "update: %s removed" msgstr "Update: %s entfernt" #: src/specto/watch_mail_gmail.py:42 #: src/specto/watch_mail_imap.py:40 #: src/specto/watch_mail_pop3.py:43 msgid "Unknown Mail Watch" msgstr "Unbekannte Mailbeobachtung" #: src/specto/watch_mail_gmail.py:83 msgid "Watch: \"%s\" has error: wrong username/password" msgstr "Beobachtung: \"%s\" het einen Fehler: falscher Benutzername/Passwort" #: src/specto/watch_mail_imap.py:64 #: src/specto/watch_mail_imap.py:87 msgid "Watch: \"%s\" has error: %s" msgstr "Beobachtung: \"%s\" hat einen Fehler: %s" #: src/specto/watch_mail_imap.py:77 msgid "Mailbox does not exist" msgstr "Mailbox existiert nicht" #: src/specto/watch_mail_pop3.py:73 msgid "Watch: \"%s has error: " msgstr "Beobachtung: \"%s hat einen Fehler:" #: src/specto/watch_mail_pop3.py:87 #: src/specto/watch_web_static.py:94 msgid "Watch: \"%s\" has error: " msgstr "Beobachtung: \"%s\" hat einen Fehler:" #: src/specto/watch_web_static.py:61 msgid "Watch: \"%s\" has error: empty url" msgstr "Beobachtung: \"%s\" hat einen Fehler: leere URL" #: src/specto/watch_web_static.py:153 msgid "Difference percentage:%s (Watch: \"%s\")" msgstr "Abweichung Prozent:%s (Beobachtung \"%s\")" |
|
From: Jeff F. <kid...@us...> - 2006-10-25 20:46:13
|
Update of /cvsroot/specto/specto/po/de In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv25329/de Log Message: Directory /cvsroot/specto/specto/po/de added to the repository |
|
From: Jeff F. <kid...@us...> - 2006-10-25 05:54:44
|
Update of /cvsroot/specto/specto/doc In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv4792 Removed Files: quicktips.txt Log Message: Removed quicktips text file as it is now integrated directly in notifier.py for translations support --- quicktips.txt DELETED --- |
|
From: Jeff F. <kid...@us...> - 2006-10-25 05:50:00
|
Update of /cvsroot/specto/specto In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv920 Modified Files: AUTHORS ChangeLog TODO setup.py Added Files: make_messages.sh make_regenerate.sh pygettext.py Removed Files: ROADMAP Log Message: Gettext is here, grab it while it's hot! Thanks to Giulio and Thomas for making translations possible before the release! I fixed some glitches, changed the Tip of the Day mechanism, added 2 translations. If you would like to translate Specto in your language before the release, hurry up, this is the last day! I put some instructions on the wiki if you need help. Index: ChangeLog =================================================================== RCS file: /cvsroot/specto/specto/ChangeLog,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ChangeLog 21 Oct 2006 19:17:42 -0000 1.18 --- ChangeLog 25 Oct 2006 05:49:25 -0000 1.19 *************** *** 1,2 **** --- 1,10 ---- + 2006-10-24 Giulio lotti, Jean-François Fortin & Thomas McColgan + * gettext support, finally Specto can be translated into different languages ! + * new and better (translatable) quicktips + * small bug fixes + * added French translation + * added Romanian translation, thanks to Adrian Petrescu + * generic stuff for the 0.1 release (cleanup, roadmap, todos, etc) + 2006-10-21 Jean-François Fortin * (bug #65931) removing a watch did not remove "updated = False", which caused crashes and corruption --- ROADMAP DELETED --- --- NEW FILE: make_messages.sh --- #!/bin/bash #this script is for translators. It is used to regenerate the translations template file (po/specto.pot) when strings in specto have changed. find src -type f | xargs ./pygettext.py mv messages.pot po/specto.pot --- NEW FILE: pygettext.py --- #!/usr/bin/python # Originally written by Barry Warsaw <ba...@zo...> # # Minimally patched to make it even more xgettext compatible # by Peter Funk <pf...@ar...> """pygettext -- Python equivalent of xgettext(1) Many systems (Solaris, Linux, Gnu) provide extensive tools that ease the internationalization of C programs. Most of these tools are independent of the programming language and can be used from within Python programs. Martin von Loewis' work[1] helps considerably in this regard. There's one problem though; xgettext is the program that scans source code looking for message strings, but it groks only C (or C++). Python introduces a few wrinkles, such as dual quoting characters, triple quoted strings, and raw strings. xgettext understands none of this. Enter pygettext, which uses Python's standard tokenize module to scan Python source code, generating .pot files identical to what GNU xgettext[2] generates for C and C++ code. From there, the standard GNU tools can be used. A word about marking Python strings as candidates for translation. GNU xgettext recognizes the following keywords: gettext, dgettext, dcgettext, and gettext_noop. But those can be a lot of text to include all over your code. C and C++ have a trick: they use the C preprocessor. Most internationalized C source includes a #define for gettext() to _() so that what has to be written in the source is much less. Thus these are both translatable strings: gettext("Translatable String") _("Translatable String") Python of course has no preprocessor so this doesn't work so well. Thus, pygettext searches only for _() by default, but see the -k/--keyword flag below for how to augment this. [1] http://www.python.org/workshops/1997-10/proceedings/loewis.html [2] http://www.gnu.org/software/gettext/gettext.html NOTE: pygettext attempts to be option and feature compatible with GNU xgettext where ever possible. However some options are still missing or are not fully implemented. Also, xgettext's use of command line switches with option arguments is broken, and in these cases, pygettext just defines additional switches. Usage: pygettext [options] inputfile ... Options: -a --extract-all Extract all strings. -d name --default-domain=name Rename the default output file from messages.pot to name.pot. -E --escape Replace non-ASCII characters with octal escape sequences. -D --docstrings Extract module, class, method, and function docstrings. These do not need to be wrapped in _() markers, and in fact cannot be for Python to consider them docstrings. (See also the -X option). -h --help Print this help message and exit. -k word --keyword=word Keywords to look for in addition to the default set, which are: %(DEFAULTKEYWORDS)s You can have multiple -k flags on the command line. -K --no-default-keywords Disable the default set of keywords (see above). Any keywords explicitly added with the -k/--keyword option are still recognized. --no-location Do not write filename/lineno location comments. -n --add-location Write filename/lineno location comments indicating where each extracted string is found in the source. These lines appear before each msgid. The style of comments is controlled by the -S/--style option. This is the default. -o filename --output=filename Rename the default output file from messages.pot to filename. If filename is `-' then the output is sent to standard out. -p dir --output-dir=dir Output files will be placed in directory dir. -S stylename --style stylename Specify which style to use for location comments. Two styles are supported: Solaris # File: filename, line: line-number GNU #: filename:line The style name is case insensitive. GNU style is the default. -v --verbose Print the names of the files being processed. -V --version Print the version of pygettext and exit. -w columns --width=columns Set width of output to columns. -x filename --exclude-file=filename Specify a file that contains a list of strings that are not be extracted from the input files. Each string to be excluded must appear on a line by itself in the file. -X filename --no-docstrings=filename Specify a file that contains a list of files (one per line) that should not have their docstrings extracted. This is only useful in conjunction with the -D option above. If `inputfile' is -, standard input is read. """ import os import sys import time import getopt import tokenize import operator # for selftesting try: import fintl _ = fintl.gettext except ImportError: def _(s): return s __version__ = '1.4' default_keywords = ['_'] DEFAULTKEYWORDS = ', '.join(default_keywords) EMPTYSTRING = '' # The normal pot-file header. msgmerge and Emacs's po-mode work better if it's # there. pot_header = _('''\ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR ORGANIZATION # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\\n" "POT-Creation-Date: %(time)s\\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\\n" "Language-Team: LANGUAGE <LL...@li...>\\n" "MIME-Version: 1.0\\n" "Content-Type: text/plain; charset=CHARSET\\n" "Content-Transfer-Encoding: ENCODING\\n" "Generated-By: pygettext.py %(version)s\\n" ''') def usage(code, msg=''): if code: fd = sys.stderr else: fd = sys.stdout print >> fd, _(__doc__) % globals() if msg: print >> fd, msg sys.exit(code) escapes = [] def make_escapes(pass_iso8859): global escapes if pass_iso8859: # Allow iso-8859 characters to pass through so that e.g. 'msgid # "H[o-umlaut]he"' would result not result in 'msgid "H\366he"'. # Otherwise we escape any character outside the 32..126 range. mod = 128 else: mod = 256 for i in range(256): if 32 <= (i % mod) <= 126: escapes.append(chr(i)) else: escapes.append("\\%03o" % i) escapes[ord('\\')] = '\\\\' escapes[ord('\t')] = '\\t' escapes[ord('\r')] = '\\r' escapes[ord('\n')] = '\\n' escapes[ord('\"')] = '\\"' def escape(s): global escapes s = list(s) for i in range(len(s)): s[i] = escapes[ord(s[i])] return EMPTYSTRING.join(s) def safe_eval(s): # unwrap quotes, safely return eval(s, {'__builtins__':{}}, {}) def normalize(s): # This converts the various Python string types into a format that is # appropriate for .po files, namely much closer to C style. lines = s.split('\n') if len(lines) == 1: s = '"' + escape(s) + '"' else: if not lines[-1]: del lines[-1] lines[-1] = lines[-1] + '\n' for i in range(len(lines)): lines[i] = escape(lines[i]) lineterm = '\\n"\n"' s = '""\n"' + lineterm.join(lines) + '"' return s class TokenEater: def __init__(self, options): self.__options = options self.__messages = {} self.__state = self.__waiting self.__data = [] self.__lineno = -1 self.__freshmodule = 1 self.__curfile = None def __call__(self, ttype, tstring, stup, etup, line): # dispatch ## import token ## print >> sys.stderr, 'ttype:', token.tok_name[ttype], \ ## 'tstring:', tstring self.__state(ttype, tstring, stup[0]) def __waiting(self, ttype, tstring, lineno): opts = self.__options # Do docstring extractions, if enabled if opts.docstrings and not opts.nodocstrings.get(self.__curfile): # module docstring? if self.__freshmodule: if ttype == tokenize.STRING: self.__addentry(safe_eval(tstring), lineno, isdocstring=1) self.__freshmodule = 0 elif ttype not in (tokenize.COMMENT, tokenize.NL): self.__freshmodule = 0 return # class docstring? if ttype == tokenize.NAME and tstring in ('class', 'def'): self.__state = self.__suiteseen return if ttype == tokenize.NAME and tstring in opts.keywords: self.__state = self.__keywordseen def __suiteseen(self, ttype, tstring, lineno): # ignore anything until we see the colon if ttype == tokenize.OP and tstring == ':': self.__state = self.__suitedocstring def __suitedocstring(self, ttype, tstring, lineno): # ignore any intervening noise if ttype == tokenize.STRING: self.__addentry(safe_eval(tstring), lineno, isdocstring=1) self.__state = self.__waiting elif ttype not in (tokenize.NEWLINE, tokenize.INDENT, tokenize.COMMENT): # there was no class docstring self.__state = self.__waiting def __keywordseen(self, ttype, tstring, lineno): if ttype == tokenize.OP and tstring == '(': self.__data = [] self.__lineno = lineno self.__state = self.__openseen else: self.__state = self.__waiting def __openseen(self, ttype, tstring, lineno): if ttype == tokenize.OP and tstring == ')': # We've seen the last of the translatable strings. Record the # line number of the first line of the strings and update the list # of messages seen. Reset state for the next batch. If there # were no strings inside _(), then just ignore this entry. if self.__data: self.__addentry(EMPTYSTRING.join(self.__data)) self.__state = self.__waiting elif ttype == tokenize.STRING: self.__data.append(safe_eval(tstring)) # TBD: should we warn if we seen anything else? def __addentry(self, msg, lineno=None, isdocstring=0): if lineno is None: lineno = self.__lineno if not msg in self.__options.toexclude: entry = (self.__curfile, lineno) self.__messages.setdefault(msg, {})[entry] = isdocstring def set_filename(self, filename): self.__curfile = filename self.__freshmodule = 1 def write(self, fp): options = self.__options timestamp = time.ctime(time.time()) # The time stamp in the header doesn't have the same format as that # generated by xgettext... print >> fp, pot_header % {'time': timestamp, 'version': __version__} # Sort the entries. First sort each particular entry's keys, then # sort all the entries by their first item. reverse = {} for k, v in self.__messages.items(): keys = v.keys() keys.sort() reverse.setdefault(tuple(keys), []).append((k, v)) rkeys = reverse.keys() rkeys.sort() for rkey in rkeys: rentries = reverse[rkey] rentries.sort() for k, v in rentries: isdocstring = 0 # If the entry was gleaned out of a docstring, then add a # comment stating so. This is to aid translators who may wish # to skip translating some unimportant docstrings. if reduce(operator.__add__, v.values()): isdocstring = 1 # k is the message string, v is a dictionary-set of (filename, # lineno) tuples. We want to sort the entries in v first by # file name and then by line number. v = v.keys() v.sort() if not options.writelocations: pass # location comments are different b/w Solaris and GNU: elif options.locationstyle == options.SOLARIS: for filename, lineno in v: d = {'filename': filename, 'lineno': lineno} print >>fp, _( '# File: %(filename)s, line: %(lineno)d') % d elif options.locationstyle == options.GNU: # fit as many locations on one line, as long as the # resulting line length doesn't exceeds 'options.width' locline = '#:' for filename, lineno in v: d = {'filename': filename, 'lineno': lineno} s = _(' %(filename)s:%(lineno)d') % d if len(locline) + len(s) <= options.width: locline = locline + s else: print >> fp, locline locline = "#:" + s if len(locline) > 2: print >> fp, locline if isdocstring: print >> fp, '#, docstring' print >> fp, 'msgid', normalize(k) print >> fp, 'msgstr ""\n' def main(): global default_keywords try: opts, args = getopt.getopt( sys.argv[1:], 'ad:DEhk:Kno:p:S:Vvw:x:X:', ['extract-all', 'default-domain=', 'escape', 'help', 'keyword=', 'no-default-keywords', 'add-location', 'no-location', 'output=', 'output-dir=', 'style=', 'verbose', 'version', 'width=', 'exclude-file=', 'docstrings', 'no-docstrings', ]) except getopt.error, msg: usage(1, msg) # for holding option values class Options: # constants GNU = 1 SOLARIS = 2 # defaults extractall = 0 # FIXME: currently this option has no effect at all. escape = 0 keywords = [] outpath = '' outfile = 'messages.pot' writelocations = 1 locationstyle = GNU verbose = 0 width = 78 excludefilename = '' docstrings = 0 nodocstrings = {} options = Options() locations = {'gnu' : options.GNU, 'solaris' : options.SOLARIS, } # parse options for opt, arg in opts: if opt in ('-h', '--help'): usage(0) elif opt in ('-a', '--extract-all'): options.extractall = 1 elif opt in ('-d', '--default-domain'): options.outfile = arg + '.pot' elif opt in ('-E', '--escape'): options.escape = 1 elif opt in ('-D', '--docstrings'): options.docstrings = 1 elif opt in ('-k', '--keyword'): options.keywords.append(arg) elif opt in ('-K', '--no-default-keywords'): default_keywords = [] elif opt in ('-n', '--add-location'): options.writelocations = 1 elif opt in ('--no-location',): options.writelocations = 0 elif opt in ('-S', '--style'): options.locationstyle = locations.get(arg.lower()) if options.locationstyle is None: usage(1, _('Invalid value for --style: %s') % arg) elif opt in ('-o', '--output'): options.outfile = arg elif opt in ('-p', '--output-dir'): options.outpath = arg elif opt in ('-v', '--verbose'): options.verbose = 1 elif opt in ('-V', '--version'): print _('pygettext.py (xgettext for Python) %s') % __version__ sys.exit(0) elif opt in ('-w', '--width'): try: options.width = int(arg) except ValueError: usage(1, _('--width argument must be an integer: %s') % arg) elif opt in ('-x', '--exclude-file'): options.excludefilename = arg elif opt in ('-X', '--no-docstrings'): fp = open(arg) try: while 1: line = fp.readline() if not line: break options.nodocstrings[line[:-1]] = 1 finally: fp.close() # calculate escapes make_escapes(options.escape) # calculate all keywords options.keywords.extend(default_keywords) # initialize list of strings to exclude if options.excludefilename: try: fp = open(options.excludefilename) options.toexclude = fp.readlines() fp.close() except IOError: print >> sys.stderr, _( "Can't read --exclude-file: %s") % options.excludefilename sys.exit(1) else: options.toexclude = [] # slurp through all the files eater = TokenEater(options) for filename in args: if filename == '-': if options.verbose: print _('Reading standard input') fp = sys.stdin closep = 0 else: if options.verbose: print _('Working on %s') % filename fp = open(filename) closep = 1 try: eater.set_filename(filename) try: tokenize.tokenize(fp.readline, eater) except tokenize.TokenError, e: print >> sys.stderr, '%s: %s, line %d, column %d' % ( e[0], filename, e[1][0], e[1][1]) finally: if closep: fp.close() # write the output if options.outfile == '-': fp = sys.stdout closep = 0 else: if options.outpath: options.outfile = os.path.join(options.outpath, options.outfile) fp = open(options.outfile, 'w') closep = 1 try: eater.write(fp) finally: if closep: fp.close() if __name__ == '__main__': main() # some more test strings _(u'a unicode string') Index: AUTHORS =================================================================== RCS file: /cvsroot/specto/specto/AUTHORS,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** AUTHORS 31 Jan 2006 22:01:20 -0000 1.7 --- AUTHORS 25 Oct 2006 05:49:25 -0000 1.8 *************** *** 1,38 **** Specto - unobtrusive notification ================================= ! ! For general comments/concerns, you should be using the mailing list (spe...@li...) or the #specto IRC channel on irc.freenode.net Current Developers: ! ------------------ ! Jeff 'Kiddo' Fortin - Lead Developer ! <nekohayo AT gmail DOT com> ! ICQ: 45 40 22 45 ! Jabber: kiddo AT jabber DOT org ! IRC: nekohayo Pascal Potvin - Developer ! <pascal DOT potvin AT gmail DOT com> ! ! Conor 'majikstreet' Callahan - Developer ! <majikstreet AT gmail DOT com> ! Jabber: majikstreet AT jabber DOT org ! Jabber: majikstreet AT jabber DOT no ! IRC: majikstreet ! ! Adrian 'Hikaru79' Petrescu - Developer Wout Clymans - Developer ! <woutclymans AT pi DOT be> Crazy Patch Writers: ! -------------------- ! None ! Retired Developers: ! -------- ! None --- 1,51 ---- Specto - unobtrusive notification ================================= ! For general comments/concerns, you should be using the mailing list ! (spe...@li...) or the "specto" room on conference.jabber.org ! See http://specto.ecchi.ca/Developers/List for a more current list. If you do not wish ! to be listed here or in the wiki, feel free to edit this file or the wiki, or email 'Kiddo'. Current Developers: ! ------------------------- ! Jean-François 'Kiddo' Fortin Tam - Lead Developer ! <nekohayo AT gmail DOT com> ! Jabber: kiddo AT jabber DOT org Pascal Potvin - Developer ! <pascal DOT potvin AT gmail DOT com> Wout Clymans - Developer ! <woutclymans AT pi DOT be> ! Jabber: woutc AT jabber DOT org + Giulio Lotti - Developer + <dullgiulio AT gmail DOT com> + Jabber: dullboy AT jabber DOT org + + Thomas McColgan - Developer + <thomas DOT mccolgan AT gmx DOT de> + Jabber: phreeza AT jabber DOT org Crazy Patch Writers: ! ------------------------- ! Conor 'majikstreet' Callahan ! <majikstreet AT gmail DOT com> ! Jabber: majikstreet AT jabber DOT org ! IRC: majikstreet ! 'Trygvebw' ! <majikstreet AT gmail DOT com> ! Jabber: majikstreet AT jabber DOT org ! IRC: majikstreet ! Adrian 'Hikaru79' Petrescu ! ! Status Unknown: ! ---------------------- ! ! Daejuan Jacobs ! Jeffrey Schroeder ! Michael Mealling ! Travis B. Hartwell --- NEW FILE: make_regenerate.sh --- #!/bin/bash #this is just a simple script to ease the job of testing for developers. If you run this, it will re-install specto clean and start specto for you, so you just have to type one command. clear sudo rm -R build/ sudo rm -R /usr/lib/python2.4/site-packages/specto/ sudo python setup.py install clear specto Index: setup.py =================================================================== RCS file: /cvsroot/specto/specto/setup.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** setup.py 19 Jun 2006 11:03:08 -0000 1.13 --- setup.py 25 Oct 2006 05:49:26 -0000 1.14 *************** *** 21,24 **** --- 21,51 ---- return files + i18n_languages = "fr"#list all the languages, separated by one whitespace + def give_mo_file(lang): + return "po/" + str(lang) + "/specto.mo" + + def give_mo_path(lang): + return "share/locale/" + str(lang) + "/LC_MESSAGES/" + + def give_mo_tuples(langs): + mo_tuple_list=[] + for lang in langs.split(' '): + mo_tuple_list.append( (give_mo_path(lang),[give_mo_file(lang)]) ) + return mo_tuple_list + + temp_files = [#The path are relatives to sys.prefix + ('share/doc/specto', ['COPYING', 'VERSION', 'ChangeLog', 'README']), + ('share/pixmaps', ['specto.png']), + ('share/applications', ['specto.desktop']), + ('share/specto/icons', give_files('icons/', '.png')), + ('share/specto/icons/notifier', give_files('icons/notifier/', '.png')), + ('share/specto/icons/notifier/faded', give_files('icons/notifier/faded/', '.png')), + ('share/specto/icons/notifier/big', give_files('icons/notifier/big/', '.png', '.svg')), + ('share/specto/glade', give_files('glade/', '.glade')) + ] + + for lang_tuple in give_mo_tuples(i18n_languages): + temp_files.append(lang_tuple) + setup(name = "specto", version = version_string, *************** *** 31,43 **** #package_data = {'specto': ['preferences.glade','notify.glade']}, scripts = ['specto'], ! data_files = [#The path are relatives to sys.prefix ! ('share/doc/specto', ['COPYING', 'VERSION', 'ChangeLog', 'README', 'doc/quicktips.txt']), ! ('share/pixmaps', ['specto.png']), ! ('share/applications', ['specto.desktop']), ! ('share/specto/icons', give_files('icons/', '.png')), ! ('share/specto/icons/notifier', give_files('icons/notifier/', '.png')), ! ('share/specto/icons/notifier/faded', give_files('icons/notifier/faded/', '.png')), ! ('share/specto/icons/notifier/big', give_files('icons/notifier/big/', '.png', '.svg')), ! ('share/specto/glade', give_files('glade/', '.glade')) ! ] ) --- 58,61 ---- #package_data = {'specto': ['preferences.glade','notify.glade']}, scripts = ['specto'], ! data_files = temp_files ) Index: TODO =================================================================== RCS file: /cvsroot/specto/specto/TODO,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** TODO 13 Sep 2006 19:53:21 -0000 1.11 --- TODO 25 Oct 2006 05:49:25 -0000 1.12 *************** *** 1,294 **** ! build/lib/specto/main.py:179: self.watch_db[id] = Web_watch(self, values['name'], values['refresh'], values['uri'], id, values['error_margin']) #TODO: Authentication ! build/lib/specto/main.py:272: def edit_watch(self, values):#TODO: change the values in the watch instance realtime ! build/lib/specto/main.py:363: def set_interval(self, refresh, refresh_unit):#TODO : Send in a util file ! build/lib/specto/main.py:409: #TODO: put the new name in watches_db ! build/lib/specto/watch.py:114: self.specto.logger.log("Not implemented yet", "warning", self.__class__)#TODO: implement other notifications ! build/lib/specto/notifier.py:66: #TODO: add the "sorting" submenu ! build/lib/specto/notifier.py:154: #self.wTree.get_widget("by_watch_active").set_active(True) TODO: menu item in notifier.glade has to be added ! build/lib/specto/notifier.py:467: #TODO: change the menu item label and image. ! build/lib/specto/notifier.py:514: icon = gtk.gdk.pixbuf_new_from_file('%s/share/specto/icons/notifier/refresh.png' % sys.prefix)#TODO: refresh the gui so the new icons will appear! ! build/lib/specto/notifier.py:540: self.model.set_value(self.iter[id], 0, 0)#TODO: make the text label in the "Name" column and the buttons insensitive ! build/lib/specto/traypopup.py:34: #TODO: add a debug window and menu. ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/watch_web_static.py:130: #TODO: call a method to also save in the cache the fact that the watch has been acknowledged or not, otherwise this will repeat endlessly ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/main.py:121: self.watch_db[id] = web_watch(self, values['name'], values['refresh'], values['uri'], id, values['error_margin']) #TODO: Authentication ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/main.py:210: #TODO: write to config, set the states back to normal, and reset the icons in the notifier window ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/main.py:213: def set_interval(self, refresh, refresh_unit):#TODO : Send in a util file ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/watch.py:90: print "not implemented yet"#TODO: implement other notifications ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/watch.py:193: def start_watch(self,name, type, refresh_value, refresh_unit, args):#TODO: take into account the refresh ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/notifier.py:43: #TODO: add the "sorting" submenu ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/notifier.py:318: #TODO: change the menu item label and image. ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/notifier.py:323: #TODO: change the menu item label and image. ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/notifier.py:335: #TODO: we need to be able to catch ALL the exceptions of specto, and output them to ~/.specto/errors.log ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/traypopup.py:34: #TODO: add a debug window and menu. ! CVS/Base/TODO:1:build/lib/specto/main.py:179: self.watch_db[id] = Web_watch(self, values['name'], values['refresh'], values['uri'], id, values['error_margin']) #TODO: Authentication ! CVS/Base/TODO:2:build/lib/specto/main.py:194: pass #TODO ! CVS/Base/TODO:3:build/lib/specto/main.py:268: def edit_watch(self, values):#TODO: change the values in the watch instance realtime ! CVS/Base/TODO:4:build/lib/specto/main.py:359: def set_interval(self, refresh, refresh_unit):#TODO : Send in a util file ! CVS/Base/TODO:5:build/lib/specto/main.py:405: #TODO: put the new name in watches_db ! CVS/Base/TODO:6:build/lib/specto/watch.py:108: self.specto.logger.log("Not implemented yet", "warning", self.__class__)#TODO: implement other notifications ! CVS/Base/TODO:7:build/lib/specto/watch.py:237: def start_watch(self,name, type, refresh_value, refresh_unit, args):#TODO: take into account the refresh ! CVS/Base/TODO:8:build/lib/specto/watch.py:269: self.specto.logger.log("Not implemented yet", "warning", self.__class__)#TODO: implement other notifications ! CVS/Base/TODO:9:build/lib/specto/notifier.py:66: #TODO: add the "sorting" submenu ! CVS/Base/TODO:10:build/lib/specto/notifier.py:154: #self.wTree.get_widget("by_watch_active").set_active(True) TODO: menu item in notifier.glade has to be added ! CVS/Base/TODO:11:build/lib/specto/notifier.py:424: #TODO: change the menu item label and image. ! CVS/Base/TODO:12:build/lib/specto/notifier.py:473: icon = gtk.gdk.pixbuf_new_from_file('%s/share/specto/icons/notifier/refresh.png' % sys.prefix)#TODO: refresh the gui so the new icons will appear! ! CVS/Base/TODO:13:build/lib/specto/notifier.py:501: self.model.set_value(self.iter[id], 0, 0)#TODO: make the text label in the "Name" column and the buttons insensitive ! CVS/Base/TODO:14:build/lib/specto/traypopup.py:34: #TODO: add a debug window and menu. ! CVS/Base/TODO:15:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/watch_web_static.py:130: #TODO: call a method to also save in the cache the fact that the watch has been acknowledged or not, otherwise this will repeat endlessly ! CVS/Base/TODO:16:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/main.py:121: self.watch_db[id] = web_watch(self, values['name'], values['refresh'], values['uri'], id, values['error_margin']) #TODO: Authentication ! CVS/Base/TODO:17:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/main.py:210: #TODO: write to config, set the states back to normal, and reset the icons in the notifier window ! CVS/Base/TODO:18:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/main.py:213: def set_interval(self, refresh, refresh_unit):#TODO : Send in a util file ! CVS/Base/TODO:19:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/watch.py:90: print "not implemented yet"#TODO: implement other notifications ! CVS/Base/TODO:20:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/watch.py:193: def start_watch(self,name, type, refresh_value, refresh_unit, args):#TODO: take into account the refresh ! CVS/Base/TODO:21:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/notifier.py:43: #TODO: add the "sorting" submenu ! CVS/Base/TODO:22:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/notifier.py:318: #TODO: change the menu item label and image. ! CVS/Base/TODO:23:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/notifier.py:323: #TODO: change the menu item label and image. ! CVS/Base/TODO:24:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/notifier.py:335: #TODO: we need to be able to catch ALL the exceptions of specto, and output them to ~/.specto/errors.log ! CVS/Base/TODO:25:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/traypopup.py:34: #TODO: add a debug window and menu. ! CVS/Base/TODO:26:CVS/Base/TODO:1:src/specto/CVS/Base/watch.py:80: # print "not implemented yet"#TODO: implement other notifications ! CVS/Base/TODO:27:CVS/Base/TODO:2:src/specto/CVS/Base/watch.py:168: def start_watch(self,name, type, refresh_value, refresh_unit, args):#TODO: take into account the refresh ! CVS/Base/TODO:28:CVS/Base/TODO:3:src/specto/watch_web_static.py:129: #TODO: call a method to also save in the cache the fact that the watch has been acknowledged or not, otherwise this will repeat endlessly ! CVS/Base/TODO:29:CVS/Base/TODO:4:src/specto/.#main.py.1.2:92: self.watch_db[id] = web_watch(values['refresh'], values['uri'], self, id, values['name']) #TODO: Authentication ! CVS/Base/TODO:30:CVS/Base/TODO:5:src/specto/.#main.py.1.2:129: #TODO: write to config, set the states back to normal, and reset the icons in the notifier window ! CVS/Base/TODO:31:CVS/Base/TODO:6:src/specto/.#main.py.1.2:132: def set_interval(self, refresh, refresh_unit):#TODO : Send in a util file ! CVS/Base/TODO:32:CVS/Base/TODO:7:src/specto/main.py:101: self.watch_db[id] = web_watch(self, values['name'], values['refresh'], values['uri'], id, values['error_margin']) #TODO: Authentication ! CVS/Base/TODO:33:CVS/Base/TODO:8:src/specto/main.py:105: self.watch_db[id] = mail_watch(values['refresh'], values['host'], values['username'], values['password'], self, id, values['name']) #TODO: Authentication ! CVS/Base/TODO:34:CVS/Base/TODO:9:src/specto/main.py:152: #TODO: write to config, set the states back to normal, and reset the icons in the notifier window ! CVS/Base/TODO:35:CVS/Base/TODO:10:src/specto/main.py:155: def set_interval(self, refresh, refresh_unit):#TODO : Send in a util file ! CVS/Base/TODO:36:CVS/Base/TODO:11:src/specto/watch.py:80: # print "not implemented yet"#TODO: implement other notifications ! CVS/Base/TODO:37:CVS/Base/TODO:12:src/specto/watch.py:168: def start_watch(self,name, type, refresh_value, refresh_unit, args):#TODO: take into account the refresh ! CVS/Base/TODO:38:CVS/Base/TODO:13:src/specto/notifier.py:42: #TODO: add the "sorting" submenu ! CVS/Base/TODO:39:CVS/Base/TODO:14:src/specto/notifier.py:174: #TODO: change the menu item label and image. ! CVS/Base/TODO:40:CVS/Base/TODO:15:src/specto/notifier.py:177: #self.specto.read_options()#TODO: a refresh mechanism ! CVS/Base/TODO:41:CVS/Base/TODO:16:src/specto/notifier.py:182: #TODO: change the menu item label and image. ! CVS/Base/TODO:42:CVS/Base/TODO:17:src/specto/notifier.py:189: #TODO: we need to be able to catch ALL the exceptions of specto, and output them to ~/.specto/errors.log ! CVS/Base/TODO:43:CVS/Base/TODO:18:src/specto/traypopup.py:34: #TODO: add a debug window and menu. ! CVS/Base/TODO:44:CVS/Baserev:3:BTODO/1.9/ ! CVS/Base/TODO:45:CVS/Entries:8:/TODO/1.9/Wed Jun 7 14:48:40 2006// ! CVS/Base/TODO:46:HACKING:26: ./TODO : result of : $ grep TODO * -Rn > TODO; grep FIXME * -Rn >> TODO ! CVS/Base/TODO:47:src/specto/CVS/Base/main.py:179: self.watch_db[id] = Web_watch(self, values['name'], values['refresh'], values['uri'], id, values['error_margin']) #TODO: Authentication ! CVS/Base/TODO:48:src/specto/CVS/Base/main.py:270: def edit_watch(self, values):#TODO: change the values in the watch instance realtime ! CVS/Base/TODO:49:src/specto/CVS/Base/main.py:361: def set_interval(self, refresh, refresh_unit):#TODO : Send in a util file ! CVS/Base/TODO:50:src/specto/CVS/Base/main.py:407: #TODO: put the new name in watches_db ! CVS/Base/TODO:51:src/specto/CVS/Base/watch.py:108: self.specto.logger.log("Not implemented yet", "warning", self.__class__)#TODO: implement other notifications ! CVS/Base/TODO:52:src/specto/CVS/Base/watch.py:237: def start_watch(self,name, type, refresh_value, refresh_unit, args):#TODO: take into account the refresh ! CVS/Base/TODO:53:src/specto/CVS/Base/watch.py:269: self.specto.logger.log("Not implemented yet", "warning", self.__class__)#TODO: implement other notifications ! CVS/Base/TODO:54:src/specto/CVS/Base/watch.py:272: self.specto.logger.log("Not implemented yet", "warning", self.__class__)#TODO: implement other notifications ! CVS/Base/TODO:55:src/specto/main.py:179: self.watch_db[id] = Web_watch(self, values['name'], values['refresh'], values['uri'], id, values['error_margin']) #TODO: Authentication ! CVS/Base/TODO:56:src/specto/main.py:194: pass #TODO ! CVS/Base/TODO:57:src/specto/main.py:268: def edit_watch(self, values):#TODO: change the values in the watch instance realtime ! CVS/Base/TODO:58:src/specto/main.py:359: def set_interval(self, refresh, refresh_unit):#TODO : Send in a util file ! CVS/Base/TODO:59:src/specto/main.py:405: #TODO: put the new name in watches_db ! CVS/Base/TODO:60:src/specto/watch.py:108: self.specto.logger.log("Not implemented yet", "warning", self.__class__)#TODO: implement other notifications ! CVS/Base/TODO:61:src/specto/watch.py:237: def start_watch(self,name, type, refresh_value, refresh_unit, args):#TODO: take into account the refresh ! CVS/Base/TODO:62:src/specto/watch.py:269: self.specto.logger.log("Not implemented yet", "warning", self.__class__)#TODO: implement other notifications ! CVS/Base/TODO:63:src/specto/notifier.py:66: #TODO: add the "sorting" submenu ! CVS/Base/TODO:64:src/specto/notifier.py:154: #self.wTree.get_widget("by_watch_active").set_active(True) TODO: menu item in notifier.glade has to be added ! CVS/Base/TODO:65:src/specto/notifier.py:424: #TODO: change the menu item label and image. ! CVS/Base/TODO:66:src/specto/notifier.py:473: icon = gtk.gdk.pixbuf_new_from_file('%s/share/specto/icons/notifier/refresh.png' % sys.prefix)#TODO: refresh the gui so the new icons will appear! ! CVS/Base/TODO:67:src/specto/notifier.py:501: self.model.set_value(self.iter[id], 0, 0)#TODO: make the text label in the "Name" column and the buttons insensitive ! CVS/Base/TODO:68:src/specto/traypopup.py:34: #TODO: add a debug window and menu. ! CVS/Base/TODO:105:CVS/Base/TODO:20:src/specto/CVS/Base/watch.py:63:# self.updated = False #this fixes the double call from notify() #FIXME: yeah, but how can we manage the notifier window to keep them after that? ! CVS/Base/TODO:106:CVS/Base/TODO:21:src/specto/CVS/Base/watch.py:100: self.timer.cancel()#FIXME: I doubt this will still work with the gobject timer. If it does, remove this comment. ! CVS/Base/TODO:107:CVS/Base/TODO:22:src/specto/CVS/Base/watch.py:200: self.specto.notif.add_watch_gui("<b>%s</b>" % name, type)#FIXME: this is a bug, it refers to specto but watch_io does not. ! CVS/Base/TODO:108:CVS/Base/TODO:23:src/specto/watch_web_static.py:70: if not self.updated:#FIXME: need to check the watches.list if the watch has been acknowledged, otherwise we will mess things up ! CVS/Base/TODO:109:CVS/Base/TODO:24:src/specto/watch_web_static.py:95: raise urllib2.HTTPError, e#FIXME: please add a way to catch if the host could not be reached. It should then wait and restart the watch later. ! CVS/Base/TODO:110:CVS/Base/TODO:25:src/specto/watch_web_static.py:112: #FIXME: temporary hack, not sure the etag is ALWAYS 4bytes ! CVS/Base/TODO:111:CVS/Base/TODO:26:src/specto/specto_gconf.py:43: if type_ == "string": #FIXME: find a way to automatically set the type of the key? ! CVS/Base/TODO:112:CVS/Base/TODO:27:src/specto/specto_gconf.py:63: if type_ == "boolean": #FIXME: find a way to automatically set the type of the key? ! CVS/Base/TODO:113:CVS/Base/TODO:28:src/specto/.#main.py.1.2:95: pass #FIXME! NOW! ! CVS/Base/TODO:114:CVS/Base/TODO:29:src/specto/.#main.py.1.2:97: pass #FIXME! ! CVS/Base/TODO:115:CVS/Base/TODO:30:src/specto/.#main.py.1.2:99: pass #FIXME! ! CVS/Base/TODO:116:CVS/Base/TODO:31:src/specto/main.py:107: pass #FIXME! ! CVS/Base/TODO:117:CVS/Base/TODO:32:src/specto/main.py:109: pass #FIXME! ! CVS/Base/TODO:118:CVS/Base/TODO:33:src/specto/watch.py:63:# self.updated = False #this fixes the double call from notify() #FIXME: yeah, but how can we manage the notifier window to keep them after that? ! CVS/Base/TODO:119:CVS/Base/TODO:34:src/specto/watch.py:100: self.timer.cancel()#FIXME: I doubt this will still work with the gobject timer. If it does, remove this comment. ! CVS/Base/TODO:120:CVS/Base/TODO:35:src/specto/watch.py:200: self.specto.notif.add_watch_gui("<b>%s</b>" % name, type)#FIXME: this is a bug, it refers to specto but watch_io does not. ! CVS/Base/TODO:121:CVS/Base/TODO:36:src/specto/edit_watch.py:42: self.edit_watch.destroy()#FIXME: just put "destroy" instead of hide, but not sure it's the correct method ! CVS/Base/TODO:122:CVS/Base/TODO:37:src/specto/edit_watch.py:61: self.edit_watch.destroy()#FIXME: just put "destroy" instead of hide, but not sure it's the correct method ! CVS/Base/TODO:123:CVS/Base/TODO:38:src/specto/notifier.py:170: #FIXME: have an event that toggles the refresh back to its initial state when the process is done. The current algorythm is not correct. ! CVS/Base/TODO:124:CVS/Base/TODO:39:src/specto/util.py:5:def get_path(path, sibling): #FIXME : Find me a use. ! CVS/Base/TODO:125:CVS/Base/TODO:40:src/specto/traypopup.py:39: #FIXME: put stock icons and choices like MenuItem ( Quit!! , gtk.TRUE) ! CVS/Base/TODO:126:CVS/Base/TODO:41:src/specto/add_watch.py:71: #FIXME: we currently use a self.url.get_text(), however this must be dependent on the watch type. Actually we must implement the on-the-fly changing. ! CVS/Base/TODO:127:CVS/Base/TODO:42:src/specto/add_watch.py:158: self.add_watch.hide_all()#FIXME: this is just an illusion to make the user believe that it was done instantaneously, instead of waiting for (sometimes slow) ressources to destroy the window. Note that I used hide_all instead of hide, otherwise the window refuses to hide itself and its contents. ! CVS/Base/TODO:128:CVS/Base/TODO:43:src/specto/add_watch.py:161: values['name'] = self.name.get_text()#FIXME: cfgparse cannot have single quotes (') it seems. We must watch out for the watch name or arguments not to have them. ! CVS/Base/TODO:129:HACKING:26: ./TODO : result of : $ grep TODO * -Rn > TODO; grep FIXME * -Rn >> TODO ! CVS/Base/TODO:150:TODO:46:HACKING:26: ./TODO : result of : $ grep TODO * -Rn > TODO; grep FIXME * -Rn >> TODO ! CVS/Baserev:3:BTODO/1.10/ ! CVS/Entries:18:/TODO/1.10/Fri Sep 8 21:38:33 2006// ! HACKING:26: ./TODO : result of : $ grep TODO * -Rn > TODO; grep FIXME * -Rn >> TODO ! src/specto/CVS/Base/main.py:179: self.watch_db[id] = Web_watch(self, values['name'], values['refresh'], values['uri'], id, values['error_margin']) #TODO: Authentication ! src/specto/CVS/Base/main.py:272: def edit_watch(self, values):#TODO: change the values in the watch instance realtime ! src/specto/CVS/Base/main.py:363: def set_interval(self, refresh, refresh_unit):#TODO : Send in a util file ! src/specto/CVS/Base/main.py:409: #TODO: put the new name in watches_db ! src/specto/CVS/Base/watch.py:114: self.specto.logger.log("Not implemented yet", "warning", self.__class__)#TODO: implement other notifications ! src/specto/main.py:179: self.watch_db[id] = Web_watch(self, values['name'], values['refresh'], values['uri'], id, values['error_margin']) #TODO: Authentication ! src/specto/main.py:272: def edit_watch(self, values):#TODO: change the values in the watch instance realtime ! src/specto/main.py:363: def set_interval(self, refresh, refresh_unit):#TODO : Send in a util file ! src/specto/main.py:409: #TODO: put the new name in watches_db ! src/specto/watch.py:114: self.specto.logger.log("Not implemented yet", "warning", self.__class__)#TODO: implement other notifications ! src/specto/notifier.py:66: #TODO: add the "sorting" submenu ! src/specto/notifier.py:154: #self.wTree.get_widget("by_watch_active").set_active(True) TODO: menu item in notifier.glade has to be added ! src/specto/notifier.py:464: #TODO: change the menu item label and image. ! src/specto/notifier.py:511: icon = gtk.gdk.pixbuf_new_from_file('%s/share/specto/icons/notifier/refresh.png' % sys.prefix)#TODO: refresh the gui so the new icons will appear! ! src/specto/notifier.py:537: self.model.set_value(self.iter[id], 0, 0)#TODO: make the text label in the "Name" column and the buttons insensitive ! src/specto/traypopup.py:34: #TODO: add a debug window and menu. ! build/lib/specto/watch_web_static.py:106: # raise urllib2.HTTPError, e#FIXME: please add a way to catch if the host could not be reached. It should then wait and restart the watch later. ! build/lib/specto/watch_web_static.py:124: #FIXME: temporary hack, not sure the etag is ALWAYS 4bytes ! build/lib/specto/main.py:499: os.system("zenity --info --title='Cannot quit' --text='Specto is currently checking watches for updates, you can not shut it down yet.' &") #FIXME: allow emergency quitting anyway? ! build/lib/specto/edit_watch.py:106: values['name'] = self.wTree.get_widget("name").get_text()#FIXME: cfgparse cannot have single quotes (') it seems. We must watch out for the watch name or arguments not to have them. ! build/lib/specto/edit_watch.py:178: self.edit_watch.destroy()#FIXME: just put "destroy" instead of hide, but not sure it's the correct method ! build/lib/specto/util.py:5:def get_path(path, sibling): #FIXME : Find me a use. ! build/lib/specto/traypopup.py:38: #FIXME: put stock icons and choices like MenuItem ( Quit!! , gtk.TRUE) ! build/lib/specto/add_watch.py:314: values['name'] = self.name.get_text()#FIXME: cfgparse cannot have single quotes (') it seems. We must watch out for the watch name or arguments not to have them. ! build/lib/specto/add_watch.py:329: self.add_watch.hide_all()#FIXME: this is just an illusion to make the user believe that it was done instantaneously, instead of waiting for (sometimes slow) ressources to destroy the window. Note that I used hide_all instead of hide, otherwise the window refuses to hide itself and its contents. ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/watch_web_static.py:71: if not self.updated:#FIXME: need to check the watches.list if the watch has been acknowledged, otherwise we will mess things up ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/watch_web_static.py:96: raise urllib2.HTTPError, e#FIXME: please add a way to catch if the host could not be reached. It should then wait and restart the watch later. ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/watch_web_static.py:113: #FIXME: temporary hack, not sure the etag is ALWAYS 4bytes ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/specto_gconf.py:43: if type_ == "string": #FIXME: find a way to automatically set the type of the key? ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/specto_gconf.py:63: if type_ == "boolean": #FIXME: find a way to automatically set the type of the key? ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/main.py:101: #FIXME: the tray icon color is not set back to orange if watches were left unacknowledged. To be able to do that, we need to have an infrastructure that strores which watches were cleared (acknowledged) or not. ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/main.py:136: pass #FIXME! ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/main.py:138: pass #FIXME! ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/main.py:192: #FIXME: the watch still has to be recreated! ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/main.py:196: #FIXME: the watch still has to be stopped and removed from the notifier ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/watch.py:63:# self.updated = False #this fixes the double call from notify() #FIXME: yeah, but how can we manage the notifier window to keep them after that? ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/watch.py:121: self.timer.cancel()#FIXME: I doubt this will still work with the gobject timer. If it does, remove this comment. ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/watch.py:135: f.write("\n")#FIXME: this is a messy hack. It allows the watches.list file to have 2 blank lines instead of one. This puts a band-aid over bug #49566 (iniparser makes specto crash when the file is empty). However, this fix currently does no real harm, because the file contents are overwritten by iniparser afterwards. ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/watch.py:228: self.specto.notif.add_notifier_entry("<b>%s</b>" % name, type)#FIXME: this is a bug, it refers to specto but watch_io does not. ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/edit_watch.py:48: #FIXME:this is not correct! ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/edit_watch.py:69: self.edit_watch.destroy()#FIXME: just put "destroy" instead of hide, but not sure it's the correct method ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/edit_watch.py:75: values['name'] = self.wTree.get_widget("name").get_text()#FIXME: cfgparse cannot have single quotes (') it seems. We must watch out for the watch name or arguments not to have them. ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/edit_watch.py:128: self.edit_watch.destroy()#FIXME: just put "destroy" instead of hide, but not sure it's the correct method ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/notifier.py:314: #FIXME: have an event that toggles the refresh back to its initial state when the process is done. The current algorythm is not correct. ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/notifier.py:326: self.clear_notifier_entries()#FIXME: this is a very ugly trick. What I do here is actually clear the entire list, and recreate it from scratch. This is overkill and will make specto loose the order of the items, so we must fix this. ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/util.py:5:def get_path(path, sibling): #FIXME : Find me a use. ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/traypopup.py:39: #FIXME: put stock icons and choices like MenuItem ( Quit!! , gtk.TRUE) ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/add_watch.py:165: #FIXME: we currently use a self.url.get_text(), however this must be dependent on the watch type. Actually we must implement the on-the-fly changing. ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/add_watch.py:204: self.add_watch.hide_all()#FIXME: this is just an illusion to make the user believe that it was done instantaneously, instead of waiting for (sometimes slow) ressources to destroy the window. Note that I used hide_all instead of hide, otherwise the window refuses to hide itself and its contents. ! build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/add_watch.py:207: values['name'] = self.name.get_text()#FIXME: cfgparse cannot have single quotes (') it seems. We must watch out for the watch name or arguments not to have them. ! CVS/Base/TODO:46:HACKING:26: ./TODO : result of : $ grep TODO * -Rn > TODO; grep FIXME * -Rn >> TODO ! CVS/Base/TODO:69:build/lib/specto/watch_web_static.py:106: # raise urllib2.HTTPError, e#FIXME: please add a way to catch if the host could not be reached. It should then wait and restart the watch later. ! CVS/Base/TODO:70:build/lib/specto/watch_web_static.py:124: #FIXME: temporary hack, not sure the etag is ALWAYS 4bytes ! CVS/Base/TODO:71:build/lib/specto/main.py:495: os.system("zenity --info --title='Cannot quit' --text='Specto is currently checking watches for updates, you can not shut it down yet.' &") #FIXME: allow emergency quitting anyway? ! CVS/Base/TODO:72:build/lib/specto/watch.py:159: f.write("\n")#FIXME: this is a messy hack. It allows the watches.list file to have 2 blank lines instead of one. This puts a band-aid over bug #49566 (iniparser makes specto crash when the file is empty). However, this fix currently does no real harm, because the file contents are overwritten by iniparser afterwards. ! CVS/Base/TODO:73:build/lib/specto/watch.py:271: self.specto.notif.add_notifier_entry("<b>%s</b>" % name, type)#FIXME: this is a bug, it refers to specto but watch_io does not. ! CVS/Base/TODO:74:build/lib/specto/edit_watch.py:106: values['name'] = self.wTree.get_widget("name").get_text()#FIXME: cfgparse cannot have single quotes (') it seems. We must watch out for the watch name or arguments not to have them. ! CVS/Base/TODO:75:build/lib/specto/edit_watch.py:173: self.edit_watch.destroy()#FIXME: just put "destroy" instead of hide, but not sure it's the correct method ! CVS/Base/TODO:76:build/lib/specto/util.py:5:def get_path(path, sibling): #FIXME : Find me a use. ! CVS/Base/TODO:77:build/lib/specto/traypopup.py:38: #FIXME: put stock icons and choices like MenuItem ( Quit!! , gtk.TRUE) ! CVS/Base/TODO:78:build/lib/specto/add_watch.py:257: values['name'] = self.name.get_text()#FIXME: cfgparse cannot have single quotes (') it seems. We must watch out for the watch name or arguments not to have them. ! CVS/Base/TODO:79:build/lib/specto/add_watch.py:272: self.add_watch.hide_all()#FIXME: this is just an illusion to make the user believe that it was done instantaneously, instead of waiting for (sometimes slow) ressources to destroy the window. Note that I used hide_all instead of hide, otherwise the window refuses to hide itself and its contents. ! CVS/Base/TODO:80:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/watch_web_static.py:71: if not self.updated:#FIXME: need to check the watches.list if the watch has been acknowledged, otherwise we will mess things up ! CVS/Base/TODO:81:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/watch_web_static.py:96: raise urllib2.HTTPError, e#FIXME: please add a way to catch if the host could not be reached. It should then wait and restart the watch later. ! CVS/Base/TODO:82:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/watch_web_static.py:113: #FIXME: temporary hack, not sure the etag is ALWAYS 4bytes ! CVS/Base/TODO:83:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/specto_gconf.py:43: if type_ == "string": #FIXME: find a way to automatically set the type of the key? ! CVS/Base/TODO:84:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/specto_gconf.py:63: if type_ == "boolean": #FIXME: find a way to automatically set the type of the key? ! CVS/Base/TODO:85:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/main.py:101: #FIXME: the tray icon color is not set back to orange if watches were left unacknowledged. To be able to do that, we need to have an infrastructure that strores which watches were cleared (acknowledged) or not. ! CVS/Base/TODO:86:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/main.py:136: pass #FIXME! ! CVS/Base/TODO:87:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/main.py:138: pass #FIXME! ! CVS/Base/TODO:88:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/main.py:192: #FIXME: the watch still has to be recreated! ! CVS/Base/TODO:89:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/main.py:196: #FIXME: the watch still has to be stopped and removed from the notifier ! CVS/Base/TODO:90:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/watch.py:63:# self.updated = False #this fixes the double call from notify() #FIXME: yeah, but how can we manage the notifier window to keep them after that? ! CVS/Base/TODO:91:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/watch.py:121: self.timer.cancel()#FIXME: I doubt this will still work with the gobject timer. If it does, remove this comment. ! CVS/Base/TODO:92:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/watch.py:135: f.write("\n")#FIXME: this is a messy hack. It allows the watches.list file to have 2 blank lines instead of one. This puts a band-aid over bug #49566 (iniparser makes specto crash when the file is empty). However, this fix currently does no real harm, because the file contents are overwritten by iniparser afterwards. ! CVS/Base/TODO:93:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/watch.py:228: self.specto.notif.add_notifier_entry("<b>%s</b>" % name, type)#FIXME: this is a bug, it refers to specto but watch_io does not. ! CVS/Base/TODO:94:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/edit_watch.py:48: #FIXME:this is not correct! ! CVS/Base/TODO:95:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/edit_watch.py:69: self.edit_watch.destroy()#FIXME: just put "destroy" instead of hide, but not sure it's the correct method ! CVS/Base/TODO:96:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/edit_watch.py:75: values['name'] = self.wTree.get_widget("name").get_text()#FIXME: cfgparse cannot have single quotes (') it seems. We must watch out for the watch name or arguments not to have them. ! CVS/Base/TODO:97:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/edit_watch.py:128: self.edit_watch.destroy()#FIXME: just put "destroy" instead of hide, but not sure it's the correct method ! CVS/Base/TODO:98:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/notifier.py:314: #FIXME: have an event that toggles the refresh back to its initial state when the process is done. The current algorythm is not correct. ! CVS/Base/TODO:99:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/notifier.py:326: self.clear_notifier_entries()#FIXME: this is a very ugly trick. What I do here is actually clear the entire list, and recreate it from scratch. This is overkill and will make specto loose the order of the items, so we must fix this. ! CVS/Base/TODO:100:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/util.py:5:def get_path(path, sibling): #FIXME : Find me a use. ! CVS/Base/TODO:101:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/traypopup.py:39: #FIXME: put stock icons and choices like MenuItem ( Quit!! , gtk.TRUE) ! CVS/Base/TODO:102:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/add_watch.py:165: #FIXME: we currently use a self.url.get_text(), however this must be dependent on the watch type. Actually we must implement the on-the-fly changing. ! CVS/Base/TODO:103:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/add_watch.py:204: self.add_watch.hide_all()#FIXME: this is just an illusion to make the user believe that it was done instantaneously, instead of waiting for (sometimes slow) ressources to destroy the window. Note that I used hide_all instead of hide, otherwise the window refuses to hide itself and its contents. ! CVS/Base/TODO:104:build/bdist.linux-i686/rpm/BUILD/specto-0.1/src/specto/add_watch.py:207: values['name'] = self.name.get_text()#FIXME: cfgparse cannot have single quotes (') it se... [truncated message content] |
|
From: Jeff F. <kid...@us...> - 2006-10-25 05:49:34
|
Update of /cvsroot/specto/specto/src/specto In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv920/src/specto Modified Files: about.py add_watch.py edit_watch.py logger.py main.py notifier.py preferences.py trayicon.py watch.py watch_file.py watch_mail_gmail.py watch_mail_imap.py watch_mail_pop3.py watch_web_static.py Added Files: i18n.py i18n_safedict.py Log Message: Gettext is here, grab it while it's hot! Thanks to Giulio and Thomas for making translations possible before the release! I fixed some glitches, changed the Tip of the Day mechanism, added 2 translations. If you would like to translate Specto in your language before the release, hurry up, this is the last day! I put some instructions on the wiki if you need help. Index: preferences.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/preferences.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** preferences.py 19 Oct 2006 14:53:49 -0000 1.12 --- preferences.py 25 Oct 2006 05:49:28 -0000 1.13 *************** *** 6,10 **** # preferences.py # ! # Copyright (c) 2005, Jean-François Fortin Tam ~<nekohayo a gmail.com>~ # This program is free software; you can redistribute it and/or --- 6,10 ---- # preferences.py # ! # Copyright (c) 2005-2007, Jean-François Fortin Tam ~<nekohayo a gmail.com>~ # This program is free software; you can redistribute it and/or *************** *** 24,27 **** --- 24,28 ---- import sys, os + from specto.i18n import _ try: *************** *** 89,93 **** def set_preferences(self): """ Save the preferences in gconf. """ ! self.specto.logger.log("Preferences saved.", "info", self.__class__) #create a gconf object client = self.specto.GConfClient("/apps/specto/preferences") --- 90,94 ---- def set_preferences(self): """ Save the preferences in gconf. """ ! self.specto.logger.log(_("Preferences saved."), "info", self.__class__) #create a gconf object client = self.specto.GConfClient("/apps/specto/preferences") --- NEW FILE: i18n.py --- # Copyright (C) 2000-2003 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. import sys import time import gettext from types import StringType, UnicodeType from specto.i18n_safedict import SafeDict _translation = None MESSAGES_DIR = "%s/share/locale" % sys.prefix def set_language(language=None): global _translation if language is not None: language = [language] try: _translation = gettext.translation('specto', MESSAGES_DIR, language) except IOError: # The selected language was not installed in messages, so fall back to # untranslated English. _translation = gettext.NullTranslations() def get_translation(): return _translation def set_translation(translation): global _translation _translation = translation # Set up the global translation based on environment variables. Mostly used # for command line scripts. if _translation is None: set_language() ##this small part was taken from gajim's i18n.py, because the mailman one was pure CRAP. It was impossible use strings that had % characters in them. def _(s): if s == '': return s return _translation.ugettext(s) # def ctime(date): # # Don't make these module globals since we have to do runtime translation # # of the strings anyway. # daysofweek = [ # _('Mon'), _('Tue'), _('Wed'), _('Thu'), # _('Fri'), _('Sat'), _('Sun') # ] # months = [ # '', # _('Jan'), _('Feb'), _('Mar'), _('Apr'), _('May'), _('Jun'), # _('Jul'), _('Aug'), _('Sep'), _('Oct'), _('Nov'), _('Dec') # ] # tzname = _('Server Local Time') # if isinstance(date, StringType): # try: # year, mon, day, hh, mm, ss, wday, ydat, dst = time.strptime(date) # tzname = time.tzname[dst and 1 or 0] # except ValueError: # try: # wday, mon, day, hms, year = date.split() # hh, mm, ss = hms.split(':') # year = int(year) # day = int(day) # hh = int(hh) # mm = int(mm) # ss = int(ss) # except ValueError: # return date # else: # for i in range(0, 7): # wconst = (1999, 1, 1, 0, 0, 0, i, 1, 0) # if wday.lower() == time.strftime('%a', wconst).lower(): # wday = i # break # for i in range(1, 13): # mconst = (1999, i, 1, 0, 0, 0, 0, 1, 0) # if mon.lower() == time.strftime('%b', mconst).lower(): # mon = i # break # else: # year, mon, day, hh, mm, ss, wday, yday, dst = time.localtime(date) # tzname = time.tzname[dst and 1 or 0] # wday = daysofweek[wday] # mon = months[mon] # return _('%(wday)s %(mon)s %(day)2i %(hh)02i:%(mm)02i:%(ss)02i ' # '%(tzname)s %(year)04i') Index: main.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/main.py,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** main.py 21 Oct 2006 19:42:23 -0000 1.48 --- main.py 25 Oct 2006 05:49:28 -0000 1.49 *************** *** 1,3 **** ! #!/usr/bin/env ython # -*- coding: UTF8 -*- --- 1,3 ---- ! #!/usr/bin/env python # -*- coding: UTF8 -*- *************** *** 6,10 **** # main.py # ! # Copyright (c) 2005, Jean-François Fortin Tam ~<nekohayo a gmail.com>~ # This module code is maintained by : Conor Callahan, Jean-François Fortin, Pascal Potvin and Wout Clymans --- 6,10 ---- # main.py # ! # Copyright (c) 2005-2007, Jean-François Fortin Tam ~<nekohayo a gmail.com>~ # This module code is maintained by : Conor Callahan, Jean-François Fortin, Pascal Potvin and Wout Clymans *************** *** 38,41 **** --- 38,42 ---- from specto.logger import Logger from specto.specto_gconf import GConfClient + from specto.i18n import _ #create a gconf object *************** *** 53,57 **** import gtk.glade except: ! print "Specto: no GTK, activating console mode." GTK = False else: --- 54,58 ---- import gtk.glade except: ! print _("no GTK, activating console mode") GTK = False else: *************** *** 135,139 **** p=os.system("ps --no-heading --pid " + pid) if p == 0: ! self.logger.log("Specto is already running!", "critical", self.__class__) sys.exit(0) --- 136,140 ---- p=os.system("ps --no-heading --pid " + pid) if p == 0: ! self.logger.log(_("Specto is already running!"), "critical", self.__class__) sys.exit(0) *************** *** 205,209 **** self.watch_db[id].last_updated = values['last_updated'] except: ! self.watch_db[id].last_updated = "No updates yet." if GTK: --- 206,210 ---- self.watch_db[id].last_updated = values['last_updated'] except: ! self.watch_db[id].last_updated = _("No updates yet.") if GTK: *************** *** 256,265 **** self.notifier.toggle_updating(True, id) self.watch_db[id].start_watch() ! self.logger.log("watch \"" + self.watch_db[id].name + "\" started" , "info", self.__class__) ! def stop_watch(self, id): """ Stop a watch. """ self.watch_db[id].stop_watch() ! self.logger.log("watch \"" + self.watch_db[id].name + "\" stopped" , "info", self.__class__) def add_watch(self, values): --- 257,266 ---- self.notifier.toggle_updating(True, id) self.watch_db[id].start_watch() ! self.logger.log(_("watch \"%s\" started") % self.watch_db[id].name, "info", self.__class__) ! def stop_watch(self, id): """ Stop a watch. """ self.watch_db[id].stop_watch() ! self.logger.log(_("watch \"%s\" stopped") % self.watch_db[id].name, "info", self.__class__) def add_watch(self, values): *************** *** 356,359 **** --- 357,361 ---- now = datetime.today() + #TODO:XXX:GETTEXT new_values['last_updated'] = now.strftime("%A %d %b %Y %H:%M") self.watch_db[id].last_updated = now.strftime("%A %d %b %Y %H:%M") *************** *** 431,444 **** elif self.notifier_initialized: if self.notifier.get_state()==True and self.notifier_keep_hidden: ! self.logger.log("notifier: reappear" , "debug", self.__class__) self.conf_ui.set_entry("/notifier_state", True, "boolean") self.notifier.restore_size_and_position() self.notifier.notifier.show() elif self.notifier.get_state()==True and not self.notifier_keep_hidden: ! self.logger.log("notifier: hide" , "debug", self.__class__) self.conf_ui.set_entry("/notifier_state", False, "boolean") self.notifier.notifier.hide() else: ! self.logger.log("notifier: reappear" , "debug", self.__class__) self.conf_ui.set_entry("/notifier_state", True, "boolean") self.notifier.restore_size_and_position() --- 433,446 ---- elif self.notifier_initialized: if self.notifier.get_state()==True and self.notifier_keep_hidden: ! self.logger.log(_("notifier: reappear"), "debug", self.__class__) self.conf_ui.set_entry("/notifier_state", True, "boolean") self.notifier.restore_size_and_position() self.notifier.notifier.show() elif self.notifier.get_state()==True and not self.notifier_keep_hidden: ! self.logger.log(_("notifier: hide"), "debug", self.__class__) self.conf_ui.set_entry("/notifier_state", False, "boolean") self.notifier.notifier.hide() else: ! self.logger.log(_("notifier: reappear"), "debug", self.__class__) self.conf_ui.set_entry("/notifier_state", True, "boolean") self.notifier.restore_size_and_position() *************** *** 450,457 **** """ Show the preferences window. """ if not self.preferences_initialized or self.preferences.get_state() == True: ! self.logger.log("preferences: create" , "debug", self.__class__) self.pref=Preferences(self) else: ! self.logger.log("preferences: reappear" , "debug", self.__class__) self.pref.show() --- 452,459 ---- """ Show the preferences window. """ if not self.preferences_initialized or self.preferences.get_state() == True: ! self.logger.log(_("preferences: create"), "debug", self.__class__) self.pref=Preferences(self) else: ! self.logger.log(_("preferences: reappear"), "debug", self.__class__) self.pref.show() *************** *** 460,469 **** if self.error_l == "": self.error_l= Log_dialog(self) ! self.logger.log("error log: create" , "debug", self.__class__) elif self.error_l.log_dialog.flags() & gtk.MAPPED: ! self.logger.log("error log: already visible" , "debug", self.__class__) else: self.error_l= Log_dialog(self) ! self.logger.log("error log: recreate" , "debug", self.__class__) def show_add_watch(self, *args): --- 462,471 ---- if self.error_l == "": self.error_l= Log_dialog(self) ! self.logger.log(_("error log: create"), "debug", self.__class__) elif self.error_l.log_dialog.flags() & gtk.MAPPED: ! self.logger.log(_("error log: already visible"), "debug", self.__class__) else: self.error_l= Log_dialog(self) ! self.logger.log(_("error log: recreate"), "debug", self.__class__) def show_add_watch(self, *args): *************** *** 471,480 **** if self.add_w == "": self.add_w= Add_watch(self) ! self.logger.log("add watch: create" , "debug", self.__class__) elif self.add_w.add_watch.flags() & gtk.MAPPED: ! self.logger.log("add watch: already visible" , "debug", self.__class__) else: self.add_w= Add_watch(self) ! self.logger.log("add watch: recreate" , "debug", self.__class__) def show_edit_watch(self, id, *args): --- 473,482 ---- if self.add_w == "": self.add_w= Add_watch(self) ! self.logger.log(_("add watch: create"), "debug", self.__class__) elif self.add_w.add_watch.flags() & gtk.MAPPED: ! self.logger.log(_("add watch: already visible"), "debug", self.__class__) else: self.add_w= Add_watch(self) ! self.logger.log(_("add watch: recreate"), "debug", self.__class__) def show_edit_watch(self, id, *args): *************** *** 490,499 **** if self.edit_w == "": self.edit_w= Edit_watch(self, selected) ! self.logger.log("edit watch: create" , "debug", self.__class__) elif self.edit_w.edit_watch.flags() & gtk.MAPPED: ! self.logger.log("edit watch: already visible" , "debug", self.__class__) else: self.edit_w= Edit_watch(self, selected) ! self.logger.log("edit watch: recreate" , "debug", self.__class__) def show_about(self, *args): --- 492,501 ---- if self.edit_w == "": self.edit_w= Edit_watch(self, selected) ! self.logger.log(_("edit watch: create"), "debug", self.__class__) elif self.edit_w.edit_watch.flags() & gtk.MAPPED: ! self.logger.log(_("edit watch: already visible"), "debug", self.__class__) else: self.edit_w= Edit_watch(self, selected) ! self.logger.log(_("edit watch: recreate"), "debug", self.__class__) def show_about(self, *args): *************** *** 511,520 **** def quit(self, *args): ! """ Save the save and position from the notifier and quit Specto. """ if self.notifier.get_state()==True and not self.notifier_keep_hidden: ! self.notifier.save_size_and_position()#when quitting specto abruptly, remember the notifier window properties try: gtk.main_quit() except: self.notifier.stop_refresh = True ! os.system("zenity --info --title='Cannot quit' --text='Specto is currently checking a watch for updates. When it has finished checking, try quitting Specto again.' &") #FIXME: allow emergency quitting anyway? Create a "real" gtk dialog that offers the choice between "wait" (do nothing), "retry" (self.quit) and "emergency exit" (killall specto). --- 513,523 ---- def quit(self, *args): ! """ Save the save and position from the notifier and quit Specto. """ if self.notifier.get_state()==True and not self.notifier_keep_hidden: ! self.notifier.save_size_and_position()#when quitting specto abruptly, remember the notifier window properties try: gtk.main_quit() except: self.notifier.stop_refresh = True ! error_string = _('Specto is currently checking a watch for updates. When it has finished checking, try quitting Specto again.') ! os.system("zenity --info --title='Cannot quit' --text='%s' &" % error_string) #FIXME: allow emergency quitting anyway? Create a "real" gtk dialog that offers the choice between "wait" (do nothing), "retry" (self.quit) and "emergency exit" (killall specto). Index: watch_web_static.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/watch_web_static.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** watch_web_static.py 19 Oct 2006 14:53:49 -0000 1.23 --- watch_web_static.py 25 Oct 2006 05:49:29 -0000 1.24 *************** *** 6,10 **** # watch_web_static.py # ! # Copyright (c) 2005, Jean-François Fortin Tam ~<nekohayo a gmail.com>~ # This module code is maintained by : Jean-François Fortin, Pascal Potvin and Wout Clymans --- 6,10 ---- # watch_web_static.py # ! # Copyright (c) 2005-2007, Jean-François Fortin Tam ~<nekohayo a gmail.com>~ # This module code is maintained by : Jean-François Fortin, Pascal Potvin and Wout Clymans *************** *** 31,34 **** --- 31,35 ---- from math import fabs from re import compile #this is the regex compile module to parse some stuff such as <link> tags in feeds + from specto.i18n import _ cacheSubDir__ = os.environ['HOME'] + "/.specto/cache/" *************** *** 58,62 **** self.url_ = url if self.url_ == "": ! self.specto.logger.log("Watch: \"" + self.name + "\" has error: empty url", "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 --- 59,63 ---- 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 *************** *** 71,75 **** self.error = False self.specto.update_watch(True, self.id) ! self.specto.logger.log("Updating watch: \"" + self.name + "\"", "info", self.__class__) # Create a unique name for each url. --- 72,76 ---- self.error = False self.specto.update_watch(True, self.id) ! self.specto.logger.log(_("Updating watch: \"%s\"") % self.name, "info", self.__class__) # Create a unique name for each url. *************** *** 91,95 **** except urllib2.URLError, e: self.error = True ! self.specto.logger.log("Watch: \"" + self.name + "\" has error: " + str(e), "error", self.__class__) else: self.info_ = response.info() --- 92,96 ---- except urllib2.URLError, e: self.error = True ! self.specto.logger.log(_("Watch: \"%s\" has error: ") % self.name + str(e), "error", self.__class__) else: self.info_ = response.info() *************** *** 150,154 **** self.filesize_difference = (fabs(int(self.new_filesize) - int(self.old_filesize)) / int(self.old_filesize))*100 #if self.specto.DEBUG: print "\tCached filesize: ", self.old_filesize, "\tFilesize difference percentage:", str(self.filesize_difference)[:5], "%" ! self.specto.logger.log("Difference percentage:" + str(self.filesize_difference)[:5] + "% (Watch: \"" + self.name + "\")", "info", self.__class__) if (self.filesize_difference >= float(self.error_margin)*100) and (self.filesize_difference != 0.0): #if the filesize differences exceed the error_margin --- 151,155 ---- self.filesize_difference = (fabs(int(self.new_filesize) - int(self.old_filesize)) / int(self.old_filesize))*100 #if self.specto.DEBUG: print "\tCached filesize: ", self.old_filesize, "\tFilesize difference percentage:", str(self.filesize_difference)[:5], "%" ! self.specto.logger.log(_("Difference percentage:%s (Watch: \"%s\")") % (str(self.filesize_difference)[:5], self.name), "info", self.__class__) if (self.filesize_difference >= float(self.error_margin)*100) and (self.filesize_difference != 0.0): #if the filesize differences exceed the error_margin *************** *** 247,249 **** def set_error_margin(self, error_margin): """ Set the error margin for the watch. """ ! self.error_margin = error_margin \ No newline at end of file --- 248,250 ---- def set_error_margin(self, error_margin): """ Set the error margin for the watch. """ ! self.error_margin = error_margin Index: logger.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/logger.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** logger.py 19 Oct 2006 14:53:49 -0000 1.7 --- logger.py 25 Oct 2006 05:49:28 -0000 1.8 *************** *** 6,11 **** # logger.py # ! # Copyright (c) 2005, Jean-François Fortin Tam ~<nekohayo a gmail.com>~ ! # This module code is maintained by : Pascal Potvin, Jean-François Fortin and Wout Clymans # This program is free software; you can redistribute it and/or --- 6,11 ---- # logger.py # ! # Copyright (c) 2005-2007, Jean-François Fortin Tam ~<nekohayo a gmail.com>~ ! # This module code is maintained by : Jean-François Fortin and Wout Clymans # This program is free software; you can redistribute it and/or *************** *** 26,29 **** --- 26,30 ---- import sys, os import re + from specto.i18n import _ try: *************** *** 97,109 **** else: if level == 1: ! pattern = "\w\s*- DEBUG -\s*\w" elif level == 2: ! pattern = "\w\s*- INFO -\s*\w" elif level == 3: ! pattern = "\w\s*- WARNING -\s*\w" elif level == 4: ! pattern = "\w\s*- ERROR -\s*\w" elif level == 5: ! pattern = "\w\s*- CRITICAL -\s*\w" elif level == -1: pattern = self.wTree.get_widget("combo_level").child.get_text() --- 98,110 ---- else: if level == 1: ! pattern = _("\w\s*- DEBUG -\s*\w") elif level == 2: ! pattern = _("\w\s*- INFO -\s*\w") elif level == 3: ! pattern = _("\w\s*- WARNING -\s*\w") elif level == 4: ! pattern = _("\w\s*- ERROR -\s*\w") elif level == 5: ! pattern = _("\w\s*- CRITICAL -\s*\w") elif level == -1: pattern = self.wTree.get_widget("combo_level").child.get_text() *************** *** 199,202 **** --- 200,204 ---- #write to log file + #TODO:XXX: Do we need to gettextize it? Maybe just the date. logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(name)-12s - %(levelname)s - %(message)s', Index: edit_watch.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/edit_watch.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** edit_watch.py 19 Oct 2006 14:53:49 -0000 1.16 --- edit_watch.py 25 Oct 2006 05:49:27 -0000 1.17 *************** *** 6,10 **** # add_watch.py # ! # Copyright (c) 2005, Jean-François Fortin Tam ~<nekohayo a gmail.com>~ # This program is free software; you can redistribute it and/or --- 6,10 ---- # add_watch.py # ! # Copyright (c) 2005-2007, Jean-François Fortin Tam ~<nekohayo a gmail.com>~ # This program is free software; you can redistribute it and/or *************** *** 24,28 **** import sys, os ! try: import pygtk --- 24,28 ---- import sys, os ! from specto.i18n import _ try: import pygtk *************** *** 65,69 **** #set the info from the watch self.edit_watch=self.wTree.get_widget("edit_watch") ! self.edit_watch.set_title("Edit watch: " + self.watch.name) self.wTree.get_widget("name").set_text(self.watch.name) icon = gtk.gdk.pixbuf_new_from_file('%s/share/specto/icons/specto_window_icon.png' % sys.prefix) --- 65,69 ---- #set the info from the watch self.edit_watch=self.wTree.get_widget("edit_watch") ! self.edit_watch.set_title(_("Edit watch: ") + self.watch.name) self.wTree.get_widget("name").set_text(self.watch.name) icon = gtk.gdk.pixbuf_new_from_file('%s/share/specto/icons/specto_window_icon.png' % sys.prefix) *************** *** 160,164 **** if self.watch.active == False: self.specto.stop_watch(self.watch.id) ! self.specto.logger.log("Watch : \"" + values['name'] + "\" edited.", "info", self.__class__) #"del self" would be useful here I think. --- 160,164 ---- if self.watch.active == False: self.specto.stop_watch(self.watch.id) ! self.specto.logger.log(_("Watch : \"%s\" edited.") % values['name'], "info", self.__class__) #"del self" would be useful here I think. *************** *** 172,176 **** """ Clear the log window. """ self.specto.logger.remove_watch_log(self.watch.name) ! self.specto.logger.log("removed logs from watch: \"" + self.watch.name + "\"", "info", self.__class__) self.log = self.specto.logger.watch_log(self.watch.name) self.logwindow.set_text(self.log) --- 172,176 ---- """ Clear the log window. """ self.specto.logger.remove_watch_log(self.watch.name) ! self.specto.logger.log(_("removed logs from watch: \"%s\"") % self.watch.name, "info", self.__class__) self.log = self.specto.logger.watch_log(self.watch.name) self.logwindow.set_text(self.log) *************** *** 197,201 **** #url ! lblUrl = gtk.Label("URL:") lblUrl.set_alignment(xalign=0.0, yalign=0.5) lblUrl.show() --- 197,201 ---- #url ! lblUrl = gtk.Label(_("URL:")) lblUrl.set_alignment(xalign=0.0, yalign=0.5) lblUrl.show() *************** *** 208,212 **** #error margin ! lblSlider = gtk.Label("Error Margin (%) :") lblSlider.set_alignment(xalign=0.0, yalign=0.5) lblSlider.show() --- 208,212 ---- #error margin ! lblSlider = gtk.Label(_("Error Margin (%):")) lblSlider.set_alignment(xalign=0.0, yalign=0.5) lblSlider.show() *************** *** 233,237 **** #protocol ! lblProtocol = gtk.Label("Protocol:") lblProtocol.set_alignment(xalign=0.0, yalign=0.5) lblProtocol.show() --- 233,237 ---- #protocol ! lblProtocol = gtk.Label(_("Protocol:")) lblProtocol.set_alignment(xalign=0.0, yalign=0.5) lblProtocol.show() *************** *** 244,248 **** #username ! lblUsername = gtk.Label("Username:") lblUsername.set_alignment(xalign=0.0, yalign=0.5) lblUsername.show() --- 244,248 ---- #username ! lblUsername = gtk.Label(_("Username:")) lblUsername.set_alignment(xalign=0.0, yalign=0.5) lblUsername.show() *************** *** 255,259 **** #password ! lblPassword = gtk.Label("Password:") lblPassword.set_alignment(xalign=0.0, yalign=0.5) lblPassword.show() --- 255,259 ---- #password ! lblPassword = gtk.Label(_("Password:")) lblPassword.set_alignment(xalign=0.0, yalign=0.5) lblPassword.show() *************** *** 267,271 **** #host ! lblHost = gtk.Label("Host:") lblHost.set_alignment(xalign=0.0, yalign=0.5) tblMail.attach(lblHost, 0, 1, 3, 4) --- 267,271 ---- #host ! lblHost = gtk.Label(_("Host:")) lblHost.set_alignment(xalign=0.0, yalign=0.5) tblMail.attach(lblHost, 0, 1, 3, 4) *************** *** 275,279 **** if self.watch.prot == 0: ! self.lblProtocol_text.set_text("Pop3") lblHost.show() self.txtHost.set_text(self.watch.host) --- 275,279 ---- if self.watch.prot == 0: ! self.lblProtocol_text.set_text(_("Pop3")) lblHost.show() self.txtHost.set_text(self.watch.host) *************** *** 281,290 **** elif self.watch.prot == 1: ! self.lblProtocol_text.set_text("Imap") lblHost.show() self.txtHost.set_text(self.watch.host) self.txtHost.show() else: ! self.lblProtocol_text.set_text("Gmail") vbox_options.pack_start(tblMail, False, False, 0) --- 281,290 ---- elif self.watch.prot == 1: ! self.lblProtocol_text.set_text(_("Imap")) lblHost.show() self.txtHost.set_text(self.watch.host) self.txtHost.show() else: ! self.lblProtocol_text.set_text(_("Gmail")) vbox_options.pack_start(tblMail, False, False, 0) *************** *** 298,302 **** #file/folder ! self.lblFile = gtk.Label("File/folder:") self.lblFile.set_alignment(xalign=0.0, yalign=0.5) self.lblFile.show() --- 298,302 ---- #file/folder ! self.lblFile = gtk.Label(_("File/folder:")) self.lblFile.set_alignment(xalign=0.0, yalign=0.5) self.lblFile.show() *************** *** 308,317 **** tblFile.attach(vbox_file, 1, 2, 0, 1) ! self.chkFile = gtk.RadioButton(None, "File") self.chkFile.connect("toggled", self.change_file_type) vbox_file.pack_start(self.chkFile, True, True, 0) self.chkFile.show() ! self.chkFolder = gtk.RadioButton(self.chkFile, "Folder") self.chkFolder.connect("toggled", self.change_file_type) vbox_file.pack_start(self.chkFolder, True, True, 0) --- 308,317 ---- tblFile.attach(vbox_file, 1, 2, 0, 1) ! self.chkFile = gtk.RadioButton(None, _("File")) self.chkFile.connect("toggled", self.change_file_type) vbox_file.pack_start(self.chkFile, True, True, 0) self.chkFile.show() ! self.chkFolder = gtk.RadioButton(self.chkFile, _("Folder")) self.chkFolder.connect("toggled", self.change_file_type) vbox_file.pack_start(self.chkFolder, True, True, 0) *************** *** 319,323 **** #file selection ! self.btnFile = gtk.FileChooserButton("Choose a file or folder") self.btnFile.set_filename(self.watch.file) self.btnFile.show() --- 319,323 ---- #file selection ! self.btnFile = gtk.FileChooserButton(_("Choose a file or folder")) self.btnFile.set_filename(self.watch.file) self.btnFile.show() Index: watch_mail_pop3.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/watch_mail_pop3.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** watch_mail_pop3.py 19 Oct 2006 14:53:49 -0000 1.11 --- watch_mail_pop3.py 25 Oct 2006 05:49:29 -0000 1.12 *************** *** 6,10 **** # watch_mail_imap.py # ! # Copyright (c) 2005, Jean-François Fortin Tam ~<nekohayo a gmail.com>~ # This module code is maintained by : Wout Clymans --- 6,10 ---- # watch_mail_imap.py # ! # Copyright (c) 2005-2007, Jean-François Fortin Tam ~<nekohayo a gmail.com>~ # This module code is maintained by : Wout Clymans *************** *** 29,33 **** import os from socket import error ! class Mail_watch(Watch): """ --- 29,34 ---- import os from socket import error ! from specto.i18n import _ ! class Mail_watch(Watch): """ *************** *** 40,44 **** prot = 0 ! def __init__(self, refresh, host, username, password, specto, id, name = "Unknown Mail Watch"): Watch.__init__(self, specto) self.name = name --- 41,45 ---- prot = 0 ! def __init__(self, refresh, host, username, password, specto, id, name = _("Unknown Mail Watch")): Watch.__init__(self, specto) self.name = name *************** *** 64,68 **** self.error = False self.specto.update_watch(True, self.id) ! self.specto.logger.log("Updating watch: \"" + self.name + "\"", "info", self.__class__) try: --- 65,69 ---- self.error = False self.specto.update_watch(True, self.id) ! self.specto.logger.log(_("Updating watch: \"%s\"") % self.name, "info", self.__class__) try: *************** *** 70,74 **** except error, e: self.error = True ! self.specto.logger.log("Watch: \"" + self.name + "\" has error: " + str(e), "error", self.__class__) else: try: --- 71,75 ---- except error, e: self.error = True ! self.specto.logger.log(_("Watch: \"%s has error: ") % self.name + str(e), "error", self.__class__) else: try: *************** *** 84,88 **** except poplib.error_proto, e: self.error = True ! self.specto.logger.log("Watch: \"" + self.name + "\" has error: " + str(e), "error", self.__class__) self.specto.update_watch(False, self.id) --- 85,89 ---- except poplib.error_proto, e: self.error = True ! self.specto.logger.log(_("Watch: \"%s\" has error: ") % self.name + str(e), "error", self.__class__) self.specto.update_watch(False, self.id) *************** *** 116,118 **** def set_host(self, host): """ Set the host for the watch. """ ! self.host = host \ No newline at end of file --- 117,119 ---- def set_host(self, host): """ Set the host for the watch. """ ! self.host = host Index: notifier.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/notifier.py,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** notifier.py 19 Oct 2006 14:53:49 -0000 1.64 --- notifier.py 25 Oct 2006 05:49:28 -0000 1.65 *************** *** 6,10 **** # notifier.py # ! # Copyright (c) 2005, Jean-François Fortin Tam ~<nekohayo a gmail.com>~ # This program is free software; you can redistribute it and/or --- 6,10 ---- # notifier.py # ! # Copyright (c) 2005-2007, Jean-François Fortin Tam ~<nekohayo a gmail.com>~ # This program is free software; you can redistribute it and/or *************** *** 26,30 **** import specto.edit_watch import specto.util ! from random import uniform #for the tip of the day try: import pygtk --- 26,31 ---- import specto.edit_watch import specto.util ! from random import randrange ! from specto.i18n import _ try: import pygtk *************** *** 340,344 **** if selected.prot == 2: ! self.lblMailHostText.set_label( ("gmail <i>("+str(selected.newMsg)+" unread)</i>" ) ) else: self.lblMailHostText.set_label(selected.host) --- 341,345 ---- if selected.prot == 2: ! self.lblMailHostText.set_label( _("gmail <i>(%s unread)</i>") % selected.newMsg )#FIXME: gettext does not work here else: self.lblMailHostText.set_label(selected.host) *************** *** 369,373 **** id = int(model.get_value(iter, 3)) selected = self.specto.watch_db[id] ! self.specto.logger.log("watch \"" + self.specto.watch_db[id].name + "\" opened" , "info", self.__class__) self.clear_watch(args[0]) if selected.type == 0: --- 370,374 ---- id = int(model.get_value(iter, 3)) selected = self.specto.watch_db[id] ! self.specto.logger.log(_("watch \"%s\" opened") % self.specto.watch_db[id].name, "info", self.__class__) self.clear_watch(args[0]) if selected.type == 0: *************** *** 400,403 **** --- 401,413 ---- ### GUI FUNCTIONS ### + def get_quick_tip(self):#these are the tips of the day that are shown on startup. The code that displays them is further below. + tips = [_("You can add all kinds of websites as watches. Static pages, RSS or Atom feeds, etc. Specto will automatically handle them."), + _("Website watches can use an error margin that allows you to set a minimum difference percentage. This allows you to adapt to websites that change constantly or have lots of advertising."), + _("Single-click an existing watch to display information, and double-click it to open the content."), + _("Please set a reasonable refresh interval in order to save bandwidth and prevent you from being blocked from content providers.") + ] + chosen_tip = tips[randrange(len(tips))] + return chosen_tip + def resize_info_pane(self): """ Resize the info panel. """ *************** *** 454,466 **** if saved_window_width != 0 and saved_window_height !=0:#check if the size is not 0 self.wTree.get_widget("notifier").resize(saved_window_width, saved_window_height) ! self.specto.logger.log("notifier: size set" , "debug", self.__class__) else: ! self.specto.logger.log("notifier: size not set" , "debug", self.__class__) if saved_window_x !=0 and saved_window_y !=0:#check if the position is not 0 self.wTree.get_widget("notifier").move(saved_window_x, saved_window_y) ! self.specto.logger.log("notifier: position set" , "debug", self.__class__) else: ! self.specto.logger.log("notifier: position not set" , "debug", self.__class__) def save_size_and_position(self): --- 464,476 ---- if saved_window_width != 0 and saved_window_height !=0:#check if the size is not 0 self.wTree.get_widget("notifier").resize(saved_window_width, saved_window_height) ! self.specto.logger.log(_("notifier: size set"), "debug", self.__class__) else: ! self.specto.logger.log(_("notifier: size not set"), "debug", self.__class__) if saved_window_x !=0 and saved_window_y !=0:#check if the position is not 0 self.wTree.get_widget("notifier").move(saved_window_x, saved_window_y) ! self.specto.logger.log(_("notifier: position set"), "debug", self.__class__) else: ! self.specto.logger.log(_("notifier: position not set"), "debug", self.__class__) def save_size_and_position(self): *************** *** 518,522 **** self.renderer.set_property("activatable", True) self.renderer.connect("toggled", self.check_clicked, self.model) ! self.columnCheck = gtk.TreeViewColumn("Active", self.renderer, active=0) self.columnCheck.connect("clicked", self.sort_column_active) self.columnCheck.set_sort_column_id(0) --- 528,532 ---- self.renderer.set_property("activatable", True) self.renderer.connect("toggled", self.check_clicked, self.model) ! self.columnCheck = gtk.TreeViewColumn(_("Active"), self.renderer, active=0) self.columnCheck.connect("clicked", self.sort_column_active) self.columnCheck.set_sort_column_id(0) *************** *** 526,530 **** ### Icon self.renderer = gtk.CellRendererPixbuf() ! self.columnIcon = gtk.TreeViewColumn("Type", self.renderer, pixbuf=1) self.columnIcon.set_clickable(True) self.columnIcon.connect("clicked", self.sort_column_type) --- 536,540 ---- ### Icon self.renderer = gtk.CellRendererPixbuf() ! self.columnIcon = gtk.TreeViewColumn(_("Type"), self.renderer, pixbuf=1) self.columnIcon.set_clickable(True) self.columnIcon.connect("clicked", self.sort_column_type) *************** *** 535,539 **** self.renderer.set_property("editable", True) self.renderer.connect('edited', self.change_entry_name) ! self.columnTitel = gtk.TreeViewColumn("Name", self.renderer, markup=2) self.columnTitel.connect("clicked", self.sort_column_name) self.columnTitel.set_expand(True) --- 545,549 ---- self.renderer.set_property("editable", True) self.renderer.connect('edited', self.change_entry_name) ! self.columnTitel = gtk.TreeViewColumn(_("Name"), self.renderer, markup=2) self.columnTitel.connect("clicked", self.sort_column_name) self.columnTitel.set_expand(True) *************** *** 544,548 **** ### ID self.renderer = gtk.CellRendererText() ! self.column = gtk.TreeViewColumn("ID", self.renderer, markup=3) self.column.set_visible(False) self.column.set_sort_column_id(3) --- 554,558 ---- ### ID self.renderer = gtk.CellRendererText() ! self.column = gtk.TreeViewColumn(_("ID"), self.renderer, markup=3) self.column.set_visible(False) self.column.set_sort_column_id(3) *************** *** 551,555 **** ### type self.renderer = gtk.CellRendererText() ! self.columnType = gtk.TreeViewColumn("TYPE", self.renderer, markup=4) self.columnType.set_visible(False) self.columnType.set_sort_column_id(4) --- 561,565 ---- ### type self.renderer = gtk.CellRendererText() ! self.columnType = gtk.TreeViewColumn(_("TYPE"), self.renderer, markup=4) self.columnType.set_visible(False) self.columnType.set_sort_column_id(4) *************** *** 572,589 **** #show tip of the day ! self.quicktipsfile = open('%s/share/doc/specto/quicktips.txt' % sys.prefix, 'r') ! self.tiplineNum = 0 ! self.quicktip = "" ! while True: ! self.tipLine = self.quicktipsfile.readline() ! self.tiplineNum = self.tiplineNum + 1 ! if self.tipLine != "": ! if uniform(0,self.tiplineNum)<1: ! self.quicktip = self.tipLine ! else: ! break ! self.quicktipsfile.close() ! ! self.lblTip = gtk.Label(self.quicktip) self.lblTip.set_line_wrap(True) self.lblTip.set_use_markup(True) --- 582,587 ---- #show tip of the day ! self.quicktip = self.get_quick_tip() ! self.lblTip = gtk.Label(("<big>" + _("Tip of the Day:") + "</big> "+ self.quicktip)) self.lblTip.set_line_wrap(True) self.lblTip.set_use_markup(True) *************** *** 605,609 **** #name ! lblName = gtk.Label("<b>Name:</b>") lblName.set_alignment(xalign=0.0, yalign=0.5) lblName.set_use_markup(True) --- 603,607 ---- #name ! lblName = gtk.Label(_("<b>Name:</b>")) lblName.set_alignment(xalign=0.0, yalign=0.5) lblName.set_use_markup(True) *************** *** 617,621 **** #last updated ! lblLastUpdate = gtk.Label("<b>Last Updated:</b>") lblLastUpdate.set_alignment(xalign=0.0, yalign=0.5) lblLastUpdate.set_use_markup(True) --- 615,619 ---- #last updated ! lblLastUpdate = gtk.Label(_("<b>Last Updated:</b>")) lblLastUpdate.set_alignment(xalign=0.0, yalign=0.5) lblLastUpdate.set_use_markup(True) *************** *** 629,633 **** #location ! lblLocation = gtk.Label("<b>Location:</b>") lblLocation.set_alignment(xalign=0.0, yalign=0.5) lblLocation.set_use_markup(True) --- 627,631 ---- #location ! lblLocation = gtk.Label(_("<b>Location:</b>")) lblLocation.set_alignment(xalign=0.0, yalign=0.5) lblLocation.set_use_markup(True) *************** *** 641,645 **** #error margin ! lblErrorMargin = gtk.Label("<b>Error Margin:</b>") lblErrorMargin.set_alignment(xalign=0.0, yalign=0.5) lblErrorMargin.set_use_markup(True) --- 639,643 ---- #error margin ! lblErrorMargin = gtk.Label(_("<b>Error Margin:</b>")) lblErrorMargin.set_alignment(xalign=0.0, yalign=0.5) lblErrorMargin.set_use_markup(True) *************** *** 660,664 **** #name ! lblName = gtk.Label("<b>Name:</b>") lblName.set_alignment(xalign=0.0, yalign=0.5) lblName.set_use_markup(True) --- 658,662 ---- #name ! lblName = gtk.Label(_("<b>Name:</b>")) lblName.set_alignment(xalign=0.0, yalign=0.5) lblName.set_use_markup(True) *************** *** 672,676 **** #last updated ! lblLastUpdate = gtk.Label("<b>Last Updated:</b>") lblLastUpdate.set_alignment(xalign=0.0, yalign=0.5) lblLastUpdate.set_use_markup(True) --- 670,674 ---- #last updated ! lblLastUpdate = gtk.Label(_("<b>Last Updated:</b>")) lblLastUpdate.set_alignment(xalign=0.0, yalign=0.5) lblLastUpdate.set_use_markup(True) *************** *** 684,688 **** #host ! lblMailHost = gtk.Label("<b>Host:</b>") lblMailHost.set_alignment(xalign=0.0, yalign=0.5) lblMailHost.set_use_markup(True) --- 682,686 ---- #host ! lblMailHost = gtk.Label(_("<b>Host:</b>")) lblMailHost.set_alignment(xalign=0.0, yalign=0.5) lblMailHost.set_use_markup(True) *************** *** 696,700 **** #username ! lblMailUsername = gtk.Label("<b>Username:</b>") lblMailUsername.set_alignment(xalign=0.0, yalign=0.5) lblMailUsername.set_use_markup(True) --- 694,698 ---- #username ! lblMailUsername = gtk.Label(_("<b>Username:</b>")) lblMailUsername.set_alignment(xalign=0.0, yalign=0.5) lblMailUsername.set_use_markup(True) *************** *** 715,719 **** #name ! lblName = gtk.Label("<b>Name:</b>") lblName.set_alignment(xalign=0.0, yalign=0.5) lblName.set_use_markup(True) --- 713,717 ---- #name ! lblName = gtk.Label(_("<b>Name:</b>")) lblName.set_alignment(xalign=0.0, yalign=0.5) lblName.set_use_markup(True) *************** *** 727,731 **** #last updated ! lblLastUpdate = gtk.Label("<b>Last Updated:</b>") lblLastUpdate.set_alignment(xalign=0.0, yalign=0.5) lblLastUpdate.set_use_markup(True) --- 725,729 ---- #last updated ! lblLastUpdate = gtk.Label(_("<b>Last Updated:</b>")) lblLastUpdate.set_alignment(xalign=0.0, yalign=0.5) lblLastUpdate.set_use_markup(True) *************** *** 739,743 **** #file/folder ! lblFileName = gtk.Label("<b>File/folder:</b>") lblFileName.set_alignment(xalign=0.0, yalign=0.5) lblFileName.set_use_markup(True) --- 737,741 ---- #file/folder ! lblFileName = gtk.Label(_("<b>File/folder:</b>")) lblFileName.set_alignment(xalign=0.0, yalign=0.5) lblFileName.set_use_markup(True) Index: watch_file.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/watch_file.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** watch_file.py 19 Oct 2006 14:53:49 -0000 1.5 --- watch_file.py 25 Oct 2006 05:49:28 -0000 1.6 *************** *** 6,10 **** # watch_file.py # ! # Copyright (c) 2005, Jean-François Fortin Tam ~<nekohayo a gmail.com>~ # This module code is maintained by : Jean-François Fortin, Pascal Potvin and Wout Clymans --- 6,10 ---- # watch_file.py # ! # Copyright (c) 2005-2007, Jean-François Fortin Tam ~<nekohayo a gmail.com>~ # This module code is maintained by : Jean-François Fortin, Pascal Potvin and Wout Clymans *************** *** 28,31 **** --- 28,32 ---- import os, re from stat import * + from specto.i18n import _ cacheSubDir__ = os.environ['HOME'] + "/.specto/cache/" *************** *** 40,44 **** type = 2 ! def __init__(self, refresh, file, mode, specto, id, name = "Unknown File Watch"): Watch.__init__(self, specto) self.name = name --- 41,45 ---- type = 2 ! def __init__(self, refresh, file, mode, specto, id, name = _("Unknown File Watch")): Watch.__init__(self, specto) self.name = name *************** *** 58,62 **** self.error = False self.specto.update_watch(True, self.id) ! self.specto.logger.log("Updating watch: \"" + self.name + "\"", "info", self.__class__) try: --- 59,63 ---- self.error = False self.specto.update_watch(True, self.id) ! self.specto.logger.log(_("Updating watch: \"%s\"") % self.name, "info", self.__class__) try: *************** *** 81,85 **** except: self.error = True ! self.specto.logger.log("Watch: \"" + self.name + "\" has an error", "error", self.__class__) self.specto.update_watch(False, self.id) --- 82,86 ---- except: self.error = True ! self.specto.logger.log(_("Watch: \"%s\" has an error") % self.name, "error", self.__class__) self.specto.update_watch(False, self.id) *************** *** 95,104 **** #replace filesize self.old_values = self.old_values.replace(file_ + ": " + str(old_size), file_ + ": " + str(size)) ! print "update: " + file_ + " was modified" self.updated = True elif (size or size ==0) and not old_size: #add the file to the list self.old_values += file_ + ": " + str(size) + "\n" ! print "update: " + file_ + " was created" self.updated = True --- 96,105 ---- #replace filesize self.old_values = self.old_values.replace(file_ + ": " + str(old_size), file_ + ": " + str(size)) ! print _("update: %s was modified") % file_ self.updated = True elif (size or size ==0) and not old_size: #add the file to the list self.old_values += file_ + ": " + str(size) + "\n" ! print _("update: %s was created") % file_ self.updated = True *************** *** 114,118 **** self.get_file(pathname) else: # Unknown file type, print a message ! print 'Skipping %s' % pathname def get_removed_files(self): --- 115,119 ---- self.get_file(pathname) else: # Unknown file type, print a message ! print _('Skipping %s' % pathname) def get_removed_files(self): *************** *** 123,127 **** for i in self.old_files: if i not in self.new_files:#see if a old file still exists in the new files list ! print "update: " + i + " removed" self.updated = True else: --- 124,128 ---- for i in self.old_files: if i not in self.new_files:#see if a old file still exists in the new files list ! print _("update: %s removed") % i self.updated = True else: *************** *** 160,162 **** def set_file(self, file): """ Set the filename. """ ! self.file = file \ No newline at end of file --- 161,163 ---- def set_file(self, file): """ Set the filename. """ ! self.file = file Index: about.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/about.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** about.py 19 Oct 2006 14:53:49 -0000 1.6 --- about.py 25 Oct 2006 05:49:27 -0000 1.7 *************** *** 6,10 **** # about.py # ! # Copyright (c) 2005, Jean-François Fortin Tam ~<nekohayo a gmail.com>~ # This program is free software; you can redistribute it and/or --- 6,10 ---- # about.py # ! # Copyright (c) 2005-2007, Jean-François Fortin Tam ~<nekohayo a gmail.com>~ # This program is free software; you can redistribute it and/or *************** *** 46,53 **** "Pascal Potvin\n\t<pascal.potvin AT gmail DOT com>\n", "Wout Clymans\n\t<woutclymans AT pi DOT be>\n", ! "Giulio 'Dullboy' Lotti\n\t<dullgiulio AT gmail DOT com>\n", "Conor 'majikstreet' Callahan\n\t<majikstreet AT gmail DOT com>\n"] logo = gtk.gdk.pixbuf_new_from_file('%s/share/specto/icons/specto_about.png' % sys.prefix) #create tree self.about=gtk.AboutDialog() --- 46,65 ---- "Pascal Potvin\n\t<pascal.potvin AT gmail DOT com>\n", "Wout Clymans\n\t<woutclymans AT pi DOT be>\n", ! "Giulio 'Dullboy' lotti\n\t<dullgiulio AT gmail DOT com>\n", ! "Thomas McColgan\n\t<thomas DOT mccolgan AT gmx DOT de>\n", "Conor 'majikstreet' Callahan\n\t<majikstreet AT gmail DOT com>\n"] logo = gtk.gdk.pixbuf_new_from_file('%s/share/specto/icons/specto_about.png' % sys.prefix) + translator_credits = """ + FR - French + Jean-Francois Fortin Tam + + IT - Italian + Giulio lotti + + RO - Romanian + Adrian Petrescu + """ + #create tree self.about=gtk.AboutDialog() *************** *** 62,68 **** self.about.set_website_label("Specto's Website") self.about.set_authors(authors) ! #self.wTree.set_documenters(documenters) ! #self.wTree.set_artists(artists) ! #self.wTree.set_translator_credits(translator_credits) self.about.set_logo(logo) --- 74,80 ---- self.about.set_website_label("Specto's Website") self.about.set_authors(authors) ! #self.about.set_documenters(documenters) ! #self.about.set_artists(artists) ! self.about.set_translator_credits(translator_credits) self.about.set_logo(logo) --- NEW FILE: i18n_safedict.py --- # Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. """A `safe' dictionary for string interpolation.""" from types import StringType from UserDict import UserDict COMMASPACE = ', ' class SafeDict(UserDict): """Dictionary which returns a default value for unknown keys. This is used in maketext so that editing templates is a bit more robust. """ def __getitem__(self, key): try: return self.data[key] except KeyError: if isinstance(key, StringType): return '%('+key+')s' else: return '<Missing key: %s>' % `key` def interpolate(self, template): return template % self class MsgSafeDict(SafeDict): def __init__(self, msg, dict=None): self.__msg = msg SafeDict.__init__(self, dict) def __getitem__(self, key): if key.startswith('msg_'): return self.__msg.get(key[4:], 'n/a') elif key.startswith('allmsg_'): missing = [] all = self.__msg.get_all(key[7:], missing) if all is missing: return 'n/a' return COMMASPACE.join(all) else: return SafeDict.__getitem__(self, key) def copy(self): d = self.data.copy() for k in self.__msg.keys(): vals = self.__msg.get_all(k) if len(vals) == 1: d['msg_'+k.lower()] = vals[0] else: d['allmsg_'+k.lower()] = COMMASPACE.join(vals) return d Index: add_watch.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/add_watch.py,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** add_watch.py 19 Oct 2006 14:53:49 -0000 1.31 --- add_watch.py 25 Oct 2006 05:49:27 -0000 1.32 *************** *** 6,10 **** # add_watch.py # ! # Copyright (c) 2005, Jean-François Fortin Tam ~<nekohayo a gmail.com>~ # This program is free software; you can redistribute it and/or --- 6,10 ---- # add_watch.py # ! # Copyright (c) 2005-2007, Jean-François Fortin Tam ~<nekohayo a gmail.com>~ # This program is free software; you can redistribute it and/or *************** *** 24,27 **** --- 24,28 ---- import sys + from specto.i18n import _ try: *************** *** 157,163 **** values['file'] = self.btnFile.get_filename() if self.chkFile.get_active() == True: ! values['mode'] = "file" else: ! values['mode'] = "folder" self.add_watch.destroy() --- 158,164 ---- values['file'] = self.btnFile.get_filename() if self.chkFile.get_active() == True: ! values['mode'] = _("file") else: ! values['mode'] = _("folder") self.add_watch.destroy() *************** *** 274,278 **** #url ! lblUrl = gtk.Label("URL:") lblUrl.set_alignment(xalign=0.0, yalign=0.5) lblUrl.show() --- 275,279 ---- #url ! lblUrl = gtk.Label(_("URL:")) lblUrl.set_alignment(xalign=0.0, yalign=0.5) lblUrl.show() *************** *** 288,292 **** #error margin ! lblSlider = gtk.Label("Error Margin (%) :") lblSlider.set_alignment(xalign=0.0, yalign=0.5) lblSlider.show() --- 289,293 ---- #error margin ! lblSlider = gtk.Label(_("Error Margin (%):")) lblSlider.set_alignment(xalign=0.0, ... [truncated message content] |
|
From: Jeff F. <kid...@us...> - 2006-10-25 05:49:31
|
Update of /cvsroot/specto/specto/po/fr In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv920/po/fr Added Files: specto.mo specto.po Log Message: Gettext is here, grab it while it's hot! Thanks to Giulio and Thomas for making translations possible before the release! I fixed some glitches, changed the Tip of the Day mechanism, added 2 translations. If you would like to translate Specto in your language before the release, hurry up, this is the last day! I put some instructions on the wiki if you need help. --- NEW FILE: specto.mo --- (This appears to be a binary file; contents omitted.) --- NEW FILE: specto.po --- msgid "" msgstr "" "Project-Id-Version: Specto\n" "POT-Creation-Date: \n" "PO-Revision-Date: 2006-10-24 23:17-0500\n" "Last-Translator: Jean-François Fortin Tam\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Poedit-Language: French\n" #: src/specto/add_watch.py:160 msgid "file" msgstr "fichier" #: src/specto/add_watch.py:162 msgid "folder" msgstr "dossier" #: src/specto/add_watch.py:277 #: src/specto/edit_watch.py:199 msgid "URL:" msgstr "URL :" #: src/specto/add_watch.py:291 #: src/specto/edit_watch.py:210 msgid "Error Margin (%):" msgstr "Marge d'erreur (%):" #: src/specto/add_watch.py:312 #: src/specto/edit_watch.py:235 msgid "Protocol:" msgstr "Protocole :" #: src/specto/add_watch.py:321 msgid "POP3" msgstr "POP3" #: src/specto/add_watch.py:327 msgid "IMAP" msgstr "IMAP" #: src/specto/add_watch.py:332 #: src/specto/edit_watch.py:288 msgid "Gmail" msgstr "Gmail" #: src/specto/add_watch.py:338 msgid "User:" msgstr "Utilisateur :" #: src/specto/add_watch.py:348 #: src/specto/edit_watch.py:257 msgid "Password:" msgstr "Mot de passe:" #: src/specto/add_watch.py:359 #: src/specto/edit_watch.py:269 msgid "Host:" msgstr "Hôte :" #: src/specto/add_watch.py:374 #: src/specto/edit_watch.py:300 msgid "File/folder:" msgstr "Fichier/dossier :" #: src/specto/add_watch.py:384 #: src/specto/edit_watch.py:310 msgid "File" msgstr "Fichier" #: src/specto/add_watch.py:390 #: src/specto/edit_watch.py:315 msgid "Folder" msgstr "Dossier" #: src/specto/add_watch.py:396 #: src/specto/edit_watch.py:321 msgid "Choose a file or folder" msgstr "Choisissez un fichier ou un dossier" #: src/specto/edit_watch.py:67 msgid "Edit watch: " msgstr "Modifier l'observateur :" #: src/specto/edit_watch.py:162 msgid "Watch : \"%s\" edited." msgstr "Observateur : \"%s\" modifié." #: src/specto/edit_watch.py:174 msgid "removed logs from watch: \"%s\"" msgstr "journaux détruits pour l'observateur : \"%s\"" #: src/specto/edit_watch.py:246 msgid "Username:" msgstr "Utilisateur :" #: src/specto/edit_watch.py:277 msgid "Pop3" msgstr "POP3" #: src/specto/edit_watch.py:283 msgid "Imap" msgstr "IMAP" #: src/specto/logger.py:100 msgid "\\w\\s*- DEBUG -\\s*\\w" msgstr "\\w\\s*- DEBUG -\\s*\\w" #: src/specto/logger.py:102 msgid "\\w\\s*- INFO -\\s*\\w" msgstr "\\w\\s*- INFO -\\s*\\w" #: src/specto/logger.py:104 msgid "\\w\\s*- WARNING -\\s*\\w" msgstr "\\w\\s*- AVERTISSEMENT -\\s*\\w" #: src/specto/logger.py:106 msgid "\\w\\s*- ERROR -\\s*\\w" msgstr "\\w\\s*- ERREUR -\\s*\\w" #: src/specto/logger.py:108 msgid "\\w\\s*- CRITICAL -\\s*\\w" msgstr "\\w\\s*- CRITIQUE -\\s*\\w" #: src/specto/main.py:56 msgid "no GTK, activating console mode" msgstr "GTK indisponible, activation du mode console" #: src/specto/main.py:138 msgid "Specto is already running!" msgstr "Specto est déjà en cours d'exécution!" #: src/specto/main.py:208 #: src/specto/watch.py:215 msgid "No updates yet." msgstr "Rien à signaler." #: src/specto/main.py:259 msgid "watch \"%s\" started" msgstr "observateur \"%s\" lancé" #: src/specto/main.py:264 msgid "watch \"%s\" stopped" msgstr "observateur \"%s\" stoppé" #: src/specto/main.py:435 #: src/specto/main.py:444 msgid "notifier: reappear" msgstr "fenêtre principale: afficher" #: src/specto/main.py:440 msgid "notifier: hide" msgstr "fenêtre principale: cacher" #: src/specto/main.py:454 msgid "preferences: create" msgstr "fenêtre préférences: créer" #: src/specto/main.py:457 msgid "preferences: reappear" msgstr "fenêtre préférences: afficher" #: src/specto/main.py:464 msgid "error log: create" msgstr "fenêtre log d'erreurs: créer" #: src/specto/main.py:466 msgid "error log: already visible" msgstr "fenêtre log d'erreurs: déjà affiché" #: src/specto/main.py:469 msgid "error log: recreate" msgstr "fenêtre log d'erreurs: afficher" #: src/specto/main.py:475 msgid "add watch: create" msgstr "fenêtre d'ajout d'observateur: créer" #: src/specto/main.py:477 msgid "add watch: already visible" msgstr "fenêtre d'ajout d'observateur: déjà affiché" #: src/specto/main.py:480 msgid "add watch: recreate" msgstr "fenêtre d'ajout d'observateur: afficher" #: src/specto/main.py:494 msgid "edit watch: create" msgstr "fenêtre d'édition d'observateur: créer" #: src/specto/main.py:496 msgid "edit watch: already visible" msgstr "fenêtre d'édition d'observateur: déjà affiché" #: src/specto/main.py:499 msgid "edit watch: recreate" msgstr "fenêtre d'édition d'observateur: afficher" #: src/specto/main.py:522 msgid "Specto is currently checking a watch for updates. When it has finished checking, try quitting Specto again." msgstr "Specto est présentement en train de mettre à jour un observateur. Lorsque l'observateur a terminé sa vérification, réessayez de quitter Specto." #: src/specto/notifier.py:343 msgid "gmail <i>(%s unread)</i>" msgstr "Gmail <i>(%s non lus)</i>" #: src/specto/notifier.py:372 msgid "watch \"%s\" opened" msgstr "ouverture de l'observateur \"%s\"" #: src/specto/notifier.py:404 msgid "You can add all kinds of websites as watches. Static pages, RSS or Atom feeds, etc. Specto will automatically handle them." msgstr "Vous pouvez ajouter toutes sortes d'observateurs. Pages statiques, fils de syndication RSS ou Atom, Specto les prendra en charge automatiquement." #: src/specto/notifier.py:405 msgid "Website watches can use an error margin that allows you to set a minimum difference percentage. This allows you to adapt to websites that change constantly or have lots of advertising." msgstr "Les observateurs de sites web peuvent utiliser une marge d'erreur en pourcentage. Ceci vous permet d'adapter Specto aux sites Internet qui changent constamment ou qui contiennent beaucoup de publicité." #: src/specto/notifier.py:406 msgid "Single-click an existing watch to display information, and double-click it to open the content." msgstr "Faites un simple-clic sur un observateur pour afficher des informations ou double-cliquez dessus pour accéder au contenu associé." #: src/specto/notifier.py:407 msgid "Please set a reasonable refresh interval in order to save bandwidth and prevent you from being blocked from content providers." msgstr "Choisissez un délai de rafraîchissement raisonnable afin de conserver de la bande passante et éviter d'être bloqué par les distributeurs de contenu." #: src/specto/notifier.py:466 msgid "notifier: size set" msgstr "fenêtre principale: taille définie" #: src/specto/notifier.py:468 msgid "notifier: size not set" msgstr "fenêtre principale: taille non définie" #: src/specto/notifier.py:472 msgid "notifier: position set" msgstr "fenêtre principale: position définie" #: src/specto/notifier.py:474 msgid "notifier: position not set" msgstr "fenêtre principale: position non définie" #: src/specto/notifier.py:530 msgid "Active" msgstr "Actif" #: src/specto/notifier.py:538 msgid "Type" msgstr "Type" #: src/specto/notifier.py:547 msgid "Name" msgstr "Nom" #: src/specto/notifier.py:556 msgid "ID" msgstr "ID" #: src/specto/notifier.py:563 msgid "TYPE" msgstr "TYPE" #: src/specto/notifier.py:585 msgid "Tip of the Day:" msgstr "Astuce du jour :" #: src/specto/notifier.py:605 #: src/specto/notifier.py:660 #: src/specto/notifier.py:715 msgid "<b>Name:</b>" msgstr "<b>Nom :</b>" #: src/specto/notifier.py:617 #: src/specto/notifier.py:672 #: src/specto/notifier.py:727 msgid "<b>Last Updated:</b>" msgstr "<b>Dernière mise à jour :</b>" #: src/specto/notifier.py:629 msgid "<b>Location:</b>" msgstr "<b>Emplacement :</b>" #: src/specto/notifier.py:641 msgid "<b>Error Margin:</b>" msgstr "<b>Marge d'erreur :</b>" #: src/specto/notifier.py:684 msgid "<b>Host:</b>" msgstr "<b>Hôte :</b>" #: src/specto/notifier.py:696 msgid "<b>Username:</b>" msgstr "<b>Utilisateur :</b>" #: src/specto/notifier.py:739 msgid "<b>File/folder:</b>" msgstr "<b>Fichier/dossier :</b>" #: src/specto/preferences.py:92 msgid "Preferences saved." msgstr "Préférences enregistrées." #: src/specto/trayicon.py:84 msgid "Hide window" msgstr "Cacher la fenêtre" #: src/specto/trayicon.py:86 msgid "Show window" msgstr "Afficher la fenêtre" #: src/specto/trayicon.py:99 msgid "No updated watches." msgstr "Rien à signaler." #: src/specto/trayicon.py:101 msgid "Updated watches:\n" msgstr "Observateurs mis à jour :\n" #: src/specto/trayicon.py:105 msgid " website" msgstr "site web" #: src/specto/trayicon.py:105 msgid " websites" msgstr "sites web" #: src/specto/trayicon.py:114 msgid " mail" msgstr "courriel" #: src/specto/trayicon.py:114 msgid " mails" msgstr "courriels" #: src/specto/trayicon.py:125 msgid " file/folders" msgstr "fichier/dossiers" #: src/specto/trayicon.py:125 msgid " files/folders" msgstr "fichiers/dossiers" #: src/specto/watch.py:73 msgid "Watch \"%s\" updated!" msgstr "Observateur \"%s\" mis à jour !" #: src/specto/watch.py:89 msgid "The website, <b>%s</b>, has been updated." msgstr "Le site Internet, <b>%s</b>, a été mis à jour." #: src/specto/watch.py:93 msgid "Your email account, <b>%s</b>, has new mail." msgstr "Votre compte de courriel, <b>%s</b>, a nouveau message." #: src/specto/watch.py:99 msgid "Your email account, <b>%s</b>, has <b>%d</b> new mail." msgstr "Votre compte de courriel, <b>%s</b>, a <b>%d</b> nouveau message." #: src/specto/watch.py:101 msgid "Your email account, <b>%s</b>, has <b>%d</b> new unread mails, totalling %s" msgstr "Votre compte de courriel, <b>%s</b>, a <b>%d</b> nouveaux messages non lus, pour un total de %s" #: src/specto/watch.py:116 msgid "The file/folder, <b>%s</b>, has been updated." msgstr "Le fichier/dossier, <b>%s</b>, a été mis à jour." #: src/specto/watch.py:118 msgid "Not implemented yet" msgstr "Pas encore implémenté" #: src/specto/watch_file.py:43 msgid "Unknown File Watch" msgstr "Observateur de fichiers inconnu" #: src/specto/watch_file.py:61 #: src/specto/watch_mail_gmail.py:63 #: src/specto/watch_mail_imap.py:58 #: src/specto/watch_mail_pop3.py:67 #: src/specto/watch_web_static.py:74 msgid "Updating watch: \"%s\"" msgstr "Mise à jour de l'observateur: \"%s\"" #: src/specto/watch_file.py:84 msgid "Watch: \"%s\" has an error" msgstr "Observateur: \"%s\" a causé une erreur" #: src/specto/watch_file.py:98 msgid "update: %s was modified" msgstr "mise à jour: %s a été modifié" #: src/specto/watch_file.py:103 msgid "update: %s was created" msgstr "mise à jour: %s a été créé" #: src/specto/watch_file.py:117 msgid "Skipping %s" msgstr "Sauter %s" #: src/specto/watch_file.py:126 msgid "update: %s removed" msgstr "mise à jour: %s a été enlevé" #: src/specto/watch_mail_gmail.py:42 #: src/specto/watch_mail_imap.py:40 #: src/specto/watch_mail_pop3.py:43 msgid "Unknown Mail Watch" msgstr "Observateur de courriels inconnu" #: src/specto/watch_mail_gmail.py:83 msgid "Watch: \"%s\" has error: wrong username/password" msgstr "Observateur : \"%s\" a causé une erreur : mauvais utilisateur/mot de passe" #: src/specto/watch_mail_imap.py:64 #: src/specto/watch_mail_imap.py:87 msgid "Watch: \"%s\" has error: %s" msgstr "Observateur : \"%s\" a causé une erreur : %s" #: src/specto/watch_mail_imap.py:77 msgid "Mailbox does not exist" msgstr "Le compte de courriel n'existe pas" #: src/specto/watch_mail_pop3.py:73 msgid "Watch: \"%s has error: " msgstr "Observateur : \"%s a causé une erreur : " #: src/specto/watch_mail_pop3.py:87 #: src/specto/watch_web_static.py:94 msgid "Watch: \"%s\" has error: " msgstr "Observateur : \"%s\" a causé une erreur : " #: src/specto/watch_web_static.py:61 msgid "Watch: \"%s\" has error: empty url" msgstr "Observateur : \"%s\" a causé une erreur : URL vide" #: src/specto/watch_web_static.py:153 msgid "Difference percentage:%s (Watch: \"%s\")" msgstr "Pourcentage de différence : %s (Watch: \"%s\")" |
|
From: Jeff F. <kid...@us...> - 2006-10-25 05:49:31
|
Update of /cvsroot/specto/specto/po/ro In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv920/po/ro Added Files: specto.mo specto.po Log Message: Gettext is here, grab it while it's hot! Thanks to Giulio and Thomas for making translations possible before the release! I fixed some glitches, changed the Tip of the Day mechanism, added 2 translations. If you would like to translate Specto in your language before the release, hurry up, this is the last day! I put some instructions on the wiki if you need help. --- NEW FILE: specto.mo --- (This appears to be a binary file; contents omitted.) --- NEW FILE: specto.po --- msgid "" msgstr "" "Project-Id-Version: specto\n" "POT-Creation-Date: \n" "PO-Revision-Date: 2006-10-25 01:34-0500\n" "Last-Translator: Adrian Petrescu\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Poedit-Language: Romanian\n" #: src/specto/add_watch.py:160 msgid "file" msgstr "fiÈier" #: src/specto/add_watch.py:162 msgid "folder" msgstr "dosar" #: src/specto/add_watch.py:277 #: src/specto/edit_watch.py:199 msgid "URL:" msgstr "URL:" #: src/specto/add_watch.py:291 #: src/specto/edit_watch.py:210 msgid "Error Margin (%):" msgstr "Marja de eroare (%)" #: src/specto/add_watch.py:312 #: src/specto/edit_watch.py:235 msgid "Protocol:" msgstr "Protocol:" #: src/specto/add_watch.py:321 msgid "POP3" msgstr "POP3" #: src/specto/add_watch.py:327 msgid "IMAP" msgstr "IMAP" #: src/specto/add_watch.py:332 #: src/specto/edit_watch.py:288 msgid "Gmail" msgstr "Gmail" #: src/specto/add_watch.py:338 msgid "User:" msgstr "Utilizator:" #: src/specto/add_watch.py:348 #: src/specto/edit_watch.py:257 msgid "Password:" msgstr "Parola:" #: src/specto/add_watch.py:359 #: src/specto/edit_watch.py:269 msgid "Host:" msgstr "Host:" #: src/specto/add_watch.py:374 #: src/specto/edit_watch.py:300 msgid "File/folder:" msgstr "FiÈier/dosar:" #: src/specto/add_watch.py:384 #: src/specto/edit_watch.py:310 msgid "File" msgstr "FiÈier" #: src/specto/add_watch.py:390 #: src/specto/edit_watch.py:315 msgid "Folder" msgstr "Dosar" #: src/specto/add_watch.py:396 #: src/specto/edit_watch.py:321 msgid "Choose a file or folder" msgstr "AlegeÈi un fiÈier sau dosar" #: src/specto/edit_watch.py:67 msgid "Edit watch: " msgstr "EditeazÄ o urmÄrealÄ:" #: src/specto/edit_watch.py:162 msgid "Watch : \"%s\" edited." msgstr "UrmÄreala \"%s\" a fost editatÄ." #: src/specto/edit_watch.py:174 msgid "removed logs from watch: \"%s\"" msgstr "recordurile \"%s\" Èterse" #: src/specto/edit_watch.py:246 msgid "Username:" msgstr "Nume de utilizator:" #: src/specto/edit_watch.py:277 msgid "Pop3" msgstr "Pop3" #: src/specto/edit_watch.py:283 msgid "Imap" msgstr "Imap" #: src/specto/logger.py:100 msgid "\\w\\s*- DEBUG -\\s*\\w" msgstr "\\w\\s*- DEBUG -\\s*\\w" #: src/specto/logger.py:102 msgid "\\w\\s*- INFO -\\s*\\w" msgstr "\\w\\s*- INFORMATIE -\\s*\\w" #: src/specto/logger.py:104 msgid "\\w\\s*- WARNING -\\s*\\w" msgstr "\\w\\s*- AVERTIZARE -\\s*\\w" #: src/specto/logger.py:106 msgid "\\w\\s*- ERROR -\\s*\\w" msgstr "\\w\\s*- EROARE -\\s*\\w" #: src/specto/logger.py:108 msgid "\\w\\s*- CRITICAL -\\s*\\w" msgstr "\\w\\s*- CRITIC -\\s*\\w" #: src/specto/main.py:56 msgid "no GTK, activating console mode" msgstr "fÄrÄ GTK, activez in mod consol" #: src/specto/main.py:138 msgid "Specto is already running!" msgstr "Specto e deja lansat!" #: src/specto/main.py:208 #: src/specto/watch.py:215 msgid "No updates yet." msgstr "Nici un update." #: src/specto/main.py:259 msgid "watch \"%s\" started" msgstr "UrmÄreala \"%s\" pornit" #: src/specto/main.py:264 msgid "watch \"%s\" stopped" msgstr "UrmÄreala \"%s\" opritÄ" #: src/specto/main.py:435 #: src/specto/main.py:444 msgid "notifier: reappear" msgstr "notificator: redeschide" #: src/specto/main.py:440 msgid "notifier: hide" msgstr "notificator: ascunde" #: src/specto/main.py:454 msgid "preferences: create" msgstr "preferinÈe: creazÄ" #: src/specto/main.py:457 msgid "preferences: reappear" msgstr "preferinÈe: redeschide" #: src/specto/main.py:464 msgid "error log: create" msgstr "record de eroare: creazÄ" #: src/specto/main.py:466 msgid "error log: already visible" msgstr "record de eroare: deja visibil" #: src/specto/main.py:469 msgid "error log: recreate" msgstr "record de eroare: recreazÄ" #: src/specto/main.py:475 msgid "add watch: create" msgstr "adaugÄ o urmÄrealÄ: creazÄ" #: src/specto/main.py:477 msgid "add watch: already visible" msgstr "adaugÄ o urmÄrealÄ: visibil deja" #: src/specto/main.py:480 msgid "add watch: recreate" msgstr "adaugÄ o urmÄrealÄ: recreazÄ" #: src/specto/main.py:494 msgid "edit watch: create" msgstr "editeazÄ o urmÄrealÄ: creazÄ" #: src/specto/main.py:496 msgid "edit watch: already visible" msgstr "editeazÄ o urmÄrealÄ: deja visibil" #: src/specto/main.py:499 msgid "edit watch: recreate" msgstr "editeazÄ o urmÄrealÄ: recreazÄ" #: src/specto/main.py:522 msgid "Specto is currently checking a watch for updates. When it has finished checking, try quitting Specto again." msgstr "Specto este in proces de a verefica o urmÄrealÄ pentru noutaÈi. CÄnd e terminat, incercaÈi incÄ o datÄ sa inchideÈi Specto." #: src/specto/notifier.py:343 msgid "gmail <i>(%s unread)</i>" msgstr "gmail <i>(%s necitit)</i>" #: src/specto/notifier.py:372 msgid "watch \"%s\" opened" msgstr "urmÄreala \"%s\" deschisÄ" #: src/specto/notifier.py:404 msgid "You can add all kinds of websites as watches. Static pages, RSS or Atom feeds, etc. Specto will automatically handle them." msgstr "PuteÈi adauga multe feluri de website-uri ca urmÄreli. Pagini statici, Èiruri RSS sau Atom, etc., vor fi manajate de Specto automat." #: src/specto/notifier.py:405 msgid "Website watches can use an error margin that allows you to set a minimum difference percentage. This allows you to adapt to websites that change constantly or have lots of advertising." msgstr "UrmÄreli de website pot avea marje de eroare care vÄ lasÄ sÄ setaÈi un procentaj de diferenÈa minimÄ. Asta vÄ lasÄ sÄ adaptaÈi la website-uri care se schimb constant, sau care au multe reclame." #: src/specto/notifier.py:406 msgid "Single-click an existing watch to display information, and double-click it to open the content." msgstr "ClicaÈi odatÄ pe o urmÄrealÄ pentru a verifica informaÈia, sau de doua ori pentru a deschide conÈinutul." #: src/specto/notifier.py:407 msgid "Please set a reasonable refresh interval in order to save bandwidth and prevent you from being blocked from content providers." msgstr "VÄ rog sÄ setaÈi o intervalÄ de refresh resonabila, ca sÄ salvÄm bandwidth si ca sÄ nu fiim blocaÈi de la content." #: src/specto/notifier.py:466 msgid "notifier: size set" msgstr "notificator: mÄrime setat" #: src/specto/notifier.py:468 msgid "notifier: size not set" msgstr "notificator: mÄrime nu e setatÄ" #: src/specto/notifier.py:472 msgid "notifier: position set" msgstr "notificator: posiÈie setat" #: src/specto/notifier.py:474 msgid "notifier: position not set" msgstr "notificator: posiÈia nu e setatÄ" #: src/specto/notifier.py:530 msgid "Active" msgstr "Activ" #: src/specto/notifier.py:538 msgid "Type" msgstr "Tip" #: src/specto/notifier.py:547 msgid "Name" msgstr "Nume" #: src/specto/notifier.py:556 msgid "ID" msgstr "ID" #: src/specto/notifier.py:563 msgid "TYPE" msgstr "TIP" #: src/specto/notifier.py:585 msgid "Tip of the Day:" msgstr "Tipul zilei" #: src/specto/notifier.py:605 #: src/specto/notifier.py:660 #: src/specto/notifier.py:715 msgid "<b>Name:</b>" msgstr "<b>Nume:</b>" #: src/specto/notifier.py:617 #: src/specto/notifier.py:672 #: src/specto/notifier.py:727 msgid "<b>Last Updated:</b>" msgstr "</b>Ultima schimbare:</b>" #: src/specto/notifier.py:629 msgid "<b>Location:</b>" msgstr "<b>LocaÈie:</b>" #: src/specto/notifier.py:641 msgid "<b>Error Margin:</b>" msgstr "<b>Marja de Eroare:</b>" #: src/specto/notifier.py:684 msgid "<b>Host:</b>" msgstr "<b>Host:</b>" #: src/specto/notifier.py:696 msgid "<b>Username:</b>" msgstr "<b>Nume de Utilizator:</b>" #: src/specto/notifier.py:739 msgid "<b>File/folder:</b>" msgstr "<b>FiÈier/dosar:</b>" #: src/specto/preferences.py:92 msgid "Preferences saved." msgstr "PreferinÈe salvate." #: src/specto/trayicon.py:84 msgid "Hide window" msgstr "Ascunde jeamul" #: src/specto/trayicon.py:86 msgid "Show window" msgstr "AratÄ jeamul" #: src/specto/trayicon.py:99 msgid "No updated watches." msgstr "Nici o noutate." #: src/specto/trayicon.py:101 msgid "Updated watches:\n" msgstr "NoutÄÈi:\n" #: src/specto/trayicon.py:105 msgid " website" msgstr " website" #: src/specto/trayicon.py:105 msgid " websites" msgstr " website-uri" #: src/specto/trayicon.py:114 msgid " mail" msgstr " poÈtÄ" #: src/specto/trayicon.py:114 msgid " mails" msgstr " poÈte" #: src/specto/trayicon.py:125 msgid " file/folders" msgstr " FiÈier/Dosare:" #: src/specto/trayicon.py:125 msgid " files/folders" msgstr " FiÈiere/Dosare:" #: src/specto/watch.py:73 msgid "Watch \"%s\" updated!" msgstr "UrmÄreala \"%s\" updatatÄ!" #: src/specto/watch.py:89 msgid "The website, <b>%s</b>, has been updated." msgstr "Website-ul <b>%s</b> a fost updatat." #: src/specto/watch.py:93 msgid "Your email account, <b>%s</b>, has new mail." msgstr "AveÈi mesaje noi pe contul <b>%s</b>." #: src/specto/watch.py:99 msgid "Your email account, <b>%s</b>, has <b>%d</b> new mail." msgstr "Contul <b>%s</b> are <b>%d</b> mesaje noi." #: src/specto/watch.py:101 msgid "Your email account, <b>%s</b>, has <b>%d</b> new unread mails, totalling %s" msgstr "Contul <b>%s</b> are <b>%d</b> mesaje noi, cu un total de %s" #: src/specto/watch.py:116 msgid "The file/folder, <b>%s</b>, has been updated." msgstr "FiÈierul/Dosar <b>%s</b> a fost updatat." #: src/specto/watch.py:118 msgid "Not implemented yet" msgstr "Ne-implementat" #: src/specto/watch_file.py:43 msgid "Unknown File Watch" msgstr "UrmÄrealÄ de fiÈier necunoscut." #: src/specto/watch_file.py:61 #: src/specto/watch_mail_gmail.py:63 #: src/specto/watch_mail_imap.py:58 #: src/specto/watch_mail_pop3.py:67 #: src/specto/watch_web_static.py:74 msgid "Updating watch: \"%s\"" msgstr "Updatez UrmÄreala: \"%s\"" #: src/specto/watch_file.py:84 msgid "Watch: \"%s\" has an error" msgstr "UrmÄreala \"%s\" are o eroare" #: src/specto/watch_file.py:98 msgid "update: %s was modified" msgstr "UrmÄreala %s a fost modificatÄ" #: src/specto/watch_file.py:103 msgid "update: %s was created" msgstr "update: %s a fost creat" #: src/specto/watch_file.py:117 msgid "Skipping %s" msgstr "Sar %s" #: src/specto/watch_file.py:126 msgid "update: %s removed" msgstr "update: %s Èters" #: src/specto/watch_mail_gmail.py:42 #: src/specto/watch_mail_imap.py:40 #: src/specto/watch_mail_pop3.py:43 msgid "Unknown Mail Watch" msgstr "UrmÄrealÄ de poÈtÄ necunoscutÄ" #: src/specto/watch_mail_gmail.py:83 msgid "Watch: \"%s\" has error: wrong username/password" msgstr "UrmÄreala: \"%s\" are o eroare: utilizator/parola incorectÄ" #: src/specto/watch_mail_imap.py:64 #: src/specto/watch_mail_imap.py:87 msgid "Watch: \"%s\" has error: %s" msgstr "UrmÄreala: \"%s\" are o eroare: %s" #: src/specto/watch_mail_imap.py:77 msgid "Mailbox does not exist" msgstr "Cutia de poÈtÄ nu existÄ" #: src/specto/watch_mail_pop3.py:73 msgid "Watch: \"%s has error: " msgstr "UrmÄreala: \"%s\" are o eroare: " #: src/specto/watch_mail_pop3.py:87 #: src/specto/watch_web_static.py:94 msgid "Watch: \"%s\" has error: " msgstr "UrmÄreala: \"%s\" are o eroare: " #: src/specto/watch_web_static.py:61 msgid "Watch: \"%s\" has error: empty url" msgstr "UrmÄreala: \"%s\" are o eroare: url gol" #: src/specto/watch_web_static.py:153 msgid "Difference percentage:%s (Watch: \"%s\")" msgstr "Procentaj de diferenÈÄ:%s (UrmÄreala: \"%s\")" |
|
From: Jeff F. <kid...@us...> - 2006-10-25 05:49:31
|
Update of /cvsroot/specto/specto/po In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv920/po Added Files: specto.pot Log Message: Gettext is here, grab it while it's hot! Thanks to Giulio and Thomas for making translations possible before the release! I fixed some glitches, changed the Tip of the Day mechanism, added 2 translations. If you would like to translate Specto in your language before the release, hurry up, this is the last day! I put some instructions on the wiki if you need help. --- NEW FILE: specto.pot --- # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR ORGANIZATION # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: Tue Oct 24 23:17:18 2006\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL...@li...>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: ENCODING\n" "Generated-By: pygettext.py 1.4\n" #: src/specto/add_watch.py:160 msgid "file" msgstr "" #: src/specto/add_watch.py:162 msgid "folder" msgstr "" #: src/specto/add_watch.py:277 src/specto/edit_watch.py:199 msgid "URL:" msgstr "" #: src/specto/add_watch.py:291 src/specto/edit_watch.py:210 msgid "Error Margin (%):" msgstr "" #: src/specto/add_watch.py:312 src/specto/edit_watch.py:235 msgid "Protocol:" msgstr "" #: src/specto/add_watch.py:321 msgid "POP3" msgstr "" #: src/specto/add_watch.py:327 msgid "IMAP" msgstr "" #: src/specto/add_watch.py:332 src/specto/edit_watch.py:288 msgid "Gmail" msgstr "" #: src/specto/add_watch.py:338 msgid "User:" msgstr "" #: src/specto/add_watch.py:348 src/specto/edit_watch.py:257 msgid "Password:" msgstr "" #: src/specto/add_watch.py:359 src/specto/edit_watch.py:269 msgid "Host:" msgstr "" #: src/specto/add_watch.py:374 src/specto/edit_watch.py:300 msgid "File/folder:" msgstr "" #: src/specto/add_watch.py:384 src/specto/edit_watch.py:310 msgid "File" msgstr "" #: src/specto/add_watch.py:390 src/specto/edit_watch.py:315 msgid "Folder" msgstr "" #: src/specto/add_watch.py:396 src/specto/edit_watch.py:321 msgid "Choose a file or folder" msgstr "" #: src/specto/edit_watch.py:67 msgid "Edit watch: " msgstr "" #: src/specto/edit_watch.py:162 msgid "Watch : \"%s\" edited." msgstr "" #: src/specto/edit_watch.py:174 msgid "removed logs from watch: \"%s\"" msgstr "" #: src/specto/edit_watch.py:246 msgid "Username:" msgstr "" #: src/specto/edit_watch.py:277 msgid "Pop3" msgstr "" #: src/specto/edit_watch.py:283 msgid "Imap" msgstr "" #: src/specto/logger.py:100 msgid "\\w\\s*- DEBUG -\\s*\\w" msgstr "" #: src/specto/logger.py:102 msgid "\\w\\s*- INFO -\\s*\\w" msgstr "" #: src/specto/logger.py:104 msgid "\\w\\s*- WARNING -\\s*\\w" msgstr "" #: src/specto/logger.py:106 msgid "\\w\\s*- ERROR -\\s*\\w" msgstr "" #: src/specto/logger.py:108 msgid "\\w\\s*- CRITICAL -\\s*\\w" msgstr "" #: src/specto/main.py:56 msgid "no GTK, activating console mode" msgstr "" #: src/specto/main.py:138 msgid "Specto is already running!" msgstr "" #: src/specto/main.py:208 src/specto/watch.py:215 msgid "No updates yet." msgstr "" #: src/specto/main.py:259 msgid "watch \"%s\" started" msgstr "" #: src/specto/main.py:264 msgid "watch \"%s\" stopped" msgstr "" #: src/specto/main.py:435 src/specto/main.py:444 msgid "notifier: reappear" msgstr "" #: src/specto/main.py:440 msgid "notifier: hide" msgstr "" #: src/specto/main.py:454 msgid "preferences: create" msgstr "" #: src/specto/main.py:457 msgid "preferences: reappear" msgstr "" #: src/specto/main.py:464 msgid "error log: create" msgstr "" #: src/specto/main.py:466 msgid "error log: already visible" msgstr "" #: src/specto/main.py:469 msgid "error log: recreate" msgstr "" #: src/specto/main.py:475 msgid "add watch: create" msgstr "" #: src/specto/main.py:477 msgid "add watch: already visible" msgstr "" #: src/specto/main.py:480 msgid "add watch: recreate" msgstr "" #: src/specto/main.py:494 msgid "edit watch: create" msgstr "" #: src/specto/main.py:496 msgid "edit watch: already visible" msgstr "" #: src/specto/main.py:499 msgid "edit watch: recreate" msgstr "" #: src/specto/main.py:522 msgid "Specto is currently checking a watch for updates. When it has finished checking, try quitting Specto again." msgstr "" #: src/specto/notifier.py:343 msgid "gmail <i>(%s unread)</i>" msgstr "" #: src/specto/notifier.py:372 msgid "watch \"%s\" opened" msgstr "" #: src/specto/notifier.py:404 msgid "You can add all kinds of websites as watches. Static pages, RSS or Atom feeds, etc. Specto will automatically handle them." msgstr "" #: src/specto/notifier.py:405 msgid "Website watches can use an error margin that allows you to set a minimum difference percentage. This allows you to adapt to websites that change constantly or have lots of advertising." msgstr "" #: src/specto/notifier.py:406 msgid "Single-click an existing watch to display information, and double-click it to open the content." msgstr "" #: src/specto/notifier.py:407 msgid "Please set a reasonable refresh interval in order to save bandwidth and prevent you from being blocked from content providers." msgstr "" #: src/specto/notifier.py:466 msgid "notifier: size set" msgstr "" #: src/specto/notifier.py:468 msgid "notifier: size not set" msgstr "" #: src/specto/notifier.py:472 msgid "notifier: position set" msgstr "" #: src/specto/notifier.py:474 msgid "notifier: position not set" msgstr "" #: src/specto/notifier.py:530 msgid "Active" msgstr "" #: src/specto/notifier.py:538 msgid "Type" msgstr "" #: src/specto/notifier.py:547 msgid "Name" msgstr "" #: src/specto/notifier.py:556 msgid "ID" msgstr "" #: src/specto/notifier.py:563 msgid "TYPE" msgstr "" #: src/specto/notifier.py:585 msgid "Tip of the Day:" msgstr "" #: src/specto/notifier.py:605 src/specto/notifier.py:660 #: src/specto/notifier.py:715 msgid "<b>Name:</b>" msgstr "" #: src/specto/notifier.py:617 src/specto/notifier.py:672 #: src/specto/notifier.py:727 msgid "<b>Last Updated:</b>" msgstr "" #: src/specto/notifier.py:629 msgid "<b>Location:</b>" msgstr "" #: src/specto/notifier.py:641 msgid "<b>Error Margin:</b>" msgstr "" #: src/specto/notifier.py:684 msgid "<b>Host:</b>" msgstr "" #: src/specto/notifier.py:696 msgid "<b>Username:</b>" msgstr "" #: src/specto/notifier.py:739 msgid "<b>File/folder:</b>" msgstr "" #: src/specto/preferences.py:92 msgid "Preferences saved." msgstr "" #: src/specto/trayicon.py:84 msgid "Hide window" msgstr "" #: src/specto/trayicon.py:86 msgid "Show window" msgstr "" #: src/specto/trayicon.py:99 msgid "No updated watches." msgstr "" #: src/specto/trayicon.py:101 msgid "" "Updated watches:\n" msgstr "" #: src/specto/trayicon.py:105 msgid " website" msgstr "" #: src/specto/trayicon.py:105 msgid " websites" msgstr "" #: src/specto/trayicon.py:114 msgid " mail" msgstr "" #: src/specto/trayicon.py:114 msgid " mails" msgstr "" #: src/specto/trayicon.py:125 msgid " file/folders" msgstr "" #: src/specto/trayicon.py:125 msgid " files/folders" msgstr "" #: src/specto/watch.py:73 msgid "Watch \"%s\" updated!" msgstr "" #: src/specto/watch.py:89 msgid "The website, <b>%s</b>, has been updated." msgstr "" #: src/specto/watch.py:93 msgid "Your email account, <b>%s</b>, has new mail." msgstr "" #: src/specto/watch.py:99 msgid "Your email account, <b>%s</b>, has <b>%d</b> new mail." msgstr "" #: src/specto/watch.py:101 msgid "Your email account, <b>%s</b>, has <b>%d</b> new unread mails, totalling %s" msgstr "" #: src/specto/watch.py:116 msgid "The file/folder, <b>%s</b>, has been updated." msgstr "" #: src/specto/watch.py:118 msgid "Not implemented yet" msgstr "" #: src/specto/watch_file.py:43 msgid "Unknown File Watch" msgstr "" #: src/specto/watch_file.py:61 src/specto/watch_mail_gmail.py:63 #: src/specto/watch_mail_imap.py:58 src/specto/watch_mail_pop3.py:67 #: src/specto/watch_web_static.py:74 msgid "Updating watch: \"%s\"" msgstr "" #: src/specto/watch_file.py:84 msgid "Watch: \"%s\" has an error" msgstr "" #: src/specto/watch_file.py:98 msgid "update: %s was modified" msgstr "" #: src/specto/watch_file.py:103 msgid "update: %s was created" msgstr "" #: src/specto/watch_file.py:117 msgid "Skipping %s" msgstr "" #: src/specto/watch_file.py:126 msgid "update: %s removed" msgstr "" #: src/specto/watch_mail_gmail.py:42 src/specto/watch_mail_imap.py:40 #: src/specto/watch_mail_pop3.py:43 msgid "Unknown Mail Watch" msgstr "" #: src/specto/watch_mail_gmail.py:83 msgid "Watch: \"%s\" has error: wrong username/password" msgstr "" #: src/specto/watch_mail_imap.py:64 src/specto/watch_mail_imap.py:87 msgid "Watch: \"%s\" has error: %s" msgstr "" #: src/specto/watch_mail_imap.py:77 msgid "Mailbox does not exist" msgstr "" #: src/specto/watch_mail_pop3.py:73 msgid "Watch: \"%s has error: " msgstr "" #: src/specto/watch_mail_pop3.py:87 src/specto/watch_web_static.py:94 msgid "Watch: \"%s\" has error: " msgstr "" #: src/specto/watch_web_static.py:61 msgid "Watch: \"%s\" has error: empty url" msgstr "" #: src/specto/watch_web_static.py:153 msgid "Difference percentage:%s (Watch: \"%s\")" msgstr "" |
|
From: Jeff F. <kid...@us...> - 2006-10-25 04:06:02
|
Update of /cvsroot/specto/specto/po/ro In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14537/ro Log Message: Directory /cvsroot/specto/specto/po/ro added to the repository |
|
From: Jeff F. <kid...@us...> - 2006-10-24 23:32:11
|
Update of /cvsroot/specto/specto/po/fr In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv4366/fr Log Message: Directory /cvsroot/specto/specto/po/fr added to the repository |
|
From: Jeff F. <kid...@us...> - 2006-10-24 17:17:38
|
Update of /cvsroot/specto/specto/glade In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv20536 Modified Files: notifier.glade Log Message: Make the import/export watches menu entries insensitive Index: notifier.glade =================================================================== RCS file: /cvsroot/specto/specto/glade/notifier.glade,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** notifier.glade 13 Oct 2006 13:02:56 -0000 1.18 --- notifier.glade 24 Oct 2006 17:17:31 -0000 1.19 *************** *** 1,572 **** ! <?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> ! <!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> ! <glade-interface> ! ! <widget class="GtkWindow" id="notifier"> ! <property name="title" translatable="yes">Notifications</property> ! <property name="type">GTK_WINDOW_TOPLEVEL</property> ! <property name="window_position">GTK_WIN_POS_NONE</property> ! <property name="modal">False</property> [...993 lines suppressed...] ! <packing> ! <property name="expand">False</property> ! <property name="position">2</property> ! </packing> ! </child> ! </widget> ! <packing> ! <property name="resize">False</property> ! <property name="shrink">False</property> ! </packing> ! </child> ! </widget> ! <packing> ! <property name="position">2</property> ! </packing> ! </child> ! </widget> ! </child> ! </widget> </glade-interface> |
|
From: Jeff F. <kid...@us...> - 2006-10-22 13:44:27
|
Update of /cvsroot/specto/specto/po In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv1819/po Log Message: Directory /cvsroot/specto/specto/po added to the repository |
|
From: Jeff F. <kid...@us...> - 2006-10-21 19:42:27
|
Update of /cvsroot/specto/specto/src/specto In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv25570/src/specto Modified Files: main.py Log Message: Small fix for the previous commit that I forgot to add. Index: main.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/main.py,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** main.py 21 Oct 2006 19:17:42 -0000 1.47 --- main.py 21 Oct 2006 19:42:23 -0000 1.48 *************** *** 323,328 **** except: pass ! self.watch_io.remove_watch(name)#do not clear the watch after removing it or it will mess up the watches.list self.count_updated_watches() self.notifier.model.remove(self.notifier.iter[id]) --- 323,329 ---- except: pass ! self.watch_db[id].updated = False self.count_updated_watches() + self.watch_io.remove_watch(name)#do not clear the watch after removing it or it will mess up the watches.list self.notifier.model.remove(self.notifier.iter[id]) |
|
From: Jeff F. <kid...@us...> - 2006-10-21 19:17:48
|
Update of /cvsroot/specto/specto In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv17084 Modified Files: ChangeLog Log Message: Fixed a minor bug in watch.py, and fixed a huge corruption bug when removing watches (Bug #65931: removing a watch does not remove the "updated = False" option). Recommended update! Index: ChangeLog =================================================================== RCS file: /cvsroot/specto/specto/ChangeLog,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ChangeLog 19 Oct 2006 14:56:21 -0000 1.17 --- ChangeLog 21 Oct 2006 19:17:42 -0000 1.18 *************** *** 1,2 **** --- 1,5 ---- + 2006-10-21 Jean-François Fortin + * (bug #65931) removing a watch did not remove "updated = False", which caused crashes and corruption + 2006-10-19 Wout Clymans * code cleanup and documentation for the functions added |
|
From: Jeff F. <kid...@us...> - 2006-10-21 19:17:48
|
Update of /cvsroot/specto/specto/src/specto In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv17084/src/specto Modified Files: main.py watch.py Log Message: Fixed a minor bug in watch.py, and fixed a huge corruption bug when removing watches (Bug #65931: removing a watch does not remove the "updated = False" option). Recommended update! Index: watch.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/watch.py,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** watch.py 19 Oct 2006 14:53:49 -0000 1.47 --- watch.py 21 Oct 2006 19:17:42 -0000 1.48 *************** *** 25,29 **** # The Watcher : this file should give a class intended for subclassing. It should give all the basic methods. ! import os import gobject import gnome --- 25,29 ---- # The Watcher : this file should give a class intended for subclassing. It should give all the basic methods. ! import os, sys import gobject import gnome Index: main.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/main.py,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** main.py 19 Oct 2006 14:53:49 -0000 1.46 --- main.py 21 Oct 2006 19:17:42 -0000 1.47 *************** *** 319,331 **** def remove_watch(self, name, id): """ Remove a watch. """ - self.watch_io.remove_watch(name) try: self.stop_watch(id) except: pass ! ! self.watch_db[id].updated = False self.count_updated_watches() - self.notifier.model.remove(self.notifier.iter[id]) --- 319,328 ---- def remove_watch(self, name, id): """ Remove a watch. """ try: self.stop_watch(id) except: pass ! self.watch_io.remove_watch(name)#do not clear the watch after removing it or it will mess up the watches.list self.count_updated_watches() self.notifier.model.remove(self.notifier.iter[id]) |
|
From: wout <wo...@us...> - 2006-10-19 14:56:28
|
Update of /cvsroot/specto/specto In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv1453 Modified Files: ChangeLog Log Message: Updated changelog Index: ChangeLog =================================================================== RCS file: /cvsroot/specto/specto/ChangeLog,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ChangeLog 15 Oct 2006 19:04:37 -0000 1.16 --- ChangeLog 19 Oct 2006 14:56:21 -0000 1.17 *************** *** 1,5 **** 2006-10-15 Giulio Lotti ! * proper libnotify support. The dependency on libnotify-bin is now deprecated for a dependency on ! python-notify 2006-09-27 Wout Clymans --- 1,7 ---- + 2006-10-19 Wout Clymans + * code cleanup and documentation for the functions added + 2006-10-15 Giulio Lotti ! * proper libnotify support. The dependency on libnotify-bin is now deprecated for a dependency on python-notify 2006-09-27 Wout Clymans *************** *** 8,13 **** 2006-09-26 Jean-François Fortin ! * (bug #49811) when the website you are watching is a syndication feed, specto will point to the correct 'real' URL ! when you open the page. * (bug #55324) display the toolbar by default --- 10,14 ---- 2006-09-26 Jean-François Fortin ! * (bug #49811) when the website you are watching is a syndication feed, specto will point to the correct 'real' URL when you open the page. * (bug #55324) display the toolbar by default |
Update of /cvsroot/specto/specto/src/specto In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv32720 Modified Files: about.py add_watch.py edit_watch.py logger.py main.py notifier.py preferences.py specto_gconf.py traypopup.py util.py watch.py watch_file.py watch_mail_gmail.py watch_mail_imap.py watch_mail_pop3.py watch_web_static.py Log Message: * Big code cleanup! Index: preferences.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/preferences.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** preferences.py 27 Sep 2006 16:09:05 -0000 1.11 --- preferences.py 19 Oct 2006 14:53:49 -0000 1.12 *************** *** 38,47 **** class Preferences: def __init__(self, specto): - """ - In this init we are going to display the main - preferences window. The 'origin' parameter is just a variable to hold - the name of the GUI module that called the preferences window. - """ self.specto = specto gladefile= '%s/share/specto/glade/preferences.glade' % sys.prefix --- 38,46 ---- class Preferences: + """ + Display the preferences window. + """ + def __init__(self, specto): self.specto = specto gladefile= '%s/share/specto/glade/preferences.glade' % sys.prefix *************** *** 50,54 **** #catch some events ! dic= { "on_cancel_clicked": self.cancel_clicked, "on_preferences_delete_event": self.delete_event, "on_save_clicked": self.save_clicked, --- 49,53 ---- #catch some events ! dic= { "on_cancel_clicked": self.delete_event, "on_preferences_delete_event": self.delete_event, "on_save_clicked": self.save_clicked, *************** *** 56,60 **** "on_chkSoundUpdate_toggled": self.chkSoundUpdate_toggled, "on_chkSoundProblem_toggled": self.chkSoundProblem_toggled, ! "on_button_log_clear_clicked": self.specto.logger.remove_log, "on_button_log_open_clicked": self.specto.show_error_log } --- 55,59 ---- "on_chkSoundUpdate_toggled": self.chkSoundUpdate_toggled, "on_chkSoundProblem_toggled": self.chkSoundProblem_toggled, ! "on_button_log_clear_clicked": self.specto.logger.clear_log, "on_button_log_open_clicked": self.specto.show_error_log } *************** *** 68,99 **** self.get_preferences() - def get_state(self): - """ - return True if visible - """ - if self.preferences.flags() & gtk.VISIBLE: - return True - else: - return False - - def cancel_clicked(self,widget): - self.preferences.hide() - - def delete_event(self, widget, event, data=None): - # return False to destroy the main window - # return True to stop destroying the main window - self.preferences.hide() - return True - def save_clicked(self, widget): ! #save the preferences ! self.set_preferences() ! #hide preferences window self.preferences.hide() ! ! def help_clicked(self, widget): ! self.specto.show_help() def chkSoundUpdate_toggled(self, widget): client = self.specto.GConfClient("/apps/specto/preferences") if widget.get_active(): --- 67,77 ---- self.get_preferences() def save_clicked(self, widget): ! """ Save the preferences. """ self.preferences.hide() ! self.set_preferences() def chkSoundUpdate_toggled(self, widget): + """ Make the filechooser sensitive or insensitive. """ client = self.specto.GConfClient("/apps/specto/preferences") if widget.get_active(): *************** *** 103,106 **** --- 81,85 ---- def chkSoundProblem_toggled(self, widget): + """ Make the filechooser sensitive or insensitive. """ if widget.get_active(): self.wTree.get_widget("soundProblem").set_property('sensitive', 1) *************** *** 109,112 **** --- 88,92 ---- def set_preferences(self): + """ Save the preferences in gconf. """ self.specto.logger.log("Preferences saved.", "info", self.__class__) #create a gconf object *************** *** 146,149 **** --- 126,130 ---- def get_preferences(self): + """ Get the preferences from gconf. """ #create a gconf object client = self.specto.GConfClient("/apps/specto/preferences") *************** *** 180,183 **** --- 161,173 ---- else: self.wTree.get_widget("chk_debug").set_active(False) + + def help_clicked(self, widget): + """ Show the help webpage. """ + self.specto.show_help() + + def delete_event(self, widget, *args): + """ Hide the window. """ + self.preferences.hide() + return True if __name__ == "__main__": Index: main.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/main.py,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** main.py 14 Oct 2006 21:12:46 -0000 1.45 --- main.py 19 Oct 2006 14:53:49 -0000 1.46 *************** *** 24,45 **** # Boston, MA 02111-1307, USA. - # The file starts here. - # Definition of the watch_db # watch_db[0] = instance of the first watch global GTK import gobject import os, sys from datetime import datetime ! from specto.specto_gconf import GConfClient from specto.logger import Logger #create a gconf object debug_gconf_client = GConfClient("/apps/specto/preferences") ! global DEBUG #the DEBUG constant which controls how much info is output if debug_gconf_client.get_entry("/debug_mode", "boolean")==True: DEBUG = True elif debug_gconf_client.get_entry("/debug_mode", "boolean")==False: DEBUG = False ! import specto.util as util try: import pygtk --- 24,50 ---- # Boston, MA 02111-1307, USA. # Definition of the watch_db # watch_db[0] = instance of the first watch + global GTK + global DEBUG #the DEBUG constant which controls how much info is output + import gobject import os, sys from datetime import datetime ! ! import specto.util as util ! from specto.watch import Watch_io from specto.logger import Logger + from specto.specto_gconf import GConfClient + #create a gconf object debug_gconf_client = GConfClient("/apps/specto/preferences") ! if debug_gconf_client.get_entry("/debug_mode", "boolean")==True: DEBUG = True elif debug_gconf_client.get_entry("/debug_mode", "boolean")==False: DEBUG = False ! try: import pygtk *************** *** 48,52 **** import gtk.glade except: ! self.logger.log("no GTK, activating console mode" , "debug", self.__class__) GTK = False else: --- 53,57 ---- import gtk.glade except: ! print "Specto: no GTK, activating console mode." GTK = False else: *************** *** 59,84 **** from specto.edit_watch import Edit_watch from specto.logger import Log_dialog ! ! from specto.watch import Watch_io ! class Specto: add_w = "" edit_w = "" error_l = "" def __init__(self): self.DEBUG = DEBUG self.logger = Logger(self) ! self.check_instance() self.GTK = GTK self.util = util - self.GConfClient = GConfClient self.watch_db = {} self.watch_io = Watch_io() ! watch_value_db = self.watch_io.read_options() ! if GTK: ! self.tray = Tray(self) self.preferences_initialized = False self.notifier_initialized = False self.conf_ui = self.GConfClient("/apps/specto/ui") self.conf_pref = self.GConfClient("/apps/specto/preferences") --- 64,89 ---- from specto.edit_watch import Edit_watch from specto.logger import Log_dialog ! class Specto: + """ The main Specto class. """ add_w = "" edit_w = "" error_l = "" + about = "" def __init__(self): self.DEBUG = DEBUG self.logger = Logger(self) ! self.check_instance() #see if specto is already running self.GTK = GTK + if GTK: + self.tray = Tray(self) self.util = util self.watch_db = {} self.watch_io = Watch_io() ! watch_value_db = self.watch_io.read_options() self.preferences_initialized = False self.notifier_initialized = False + self.GConfClient = GConfClient self.conf_ui = self.GConfClient("/apps/specto/ui") self.conf_pref = self.GConfClient("/apps/specto/preferences") *************** *** 98,102 **** --- 103,109 ---- self.notifier_keep_hidden = False self.toggle_notifier() + self.create_all_watches(watch_value_db) + if GTK: gtk.main() *************** *** 106,109 **** --- 113,117 ---- def key_changed(self, *args): + """ Listen for gconf keys. """ label = args[3] conf_pref = self.GConfClient("/apps/specto/preferences") *************** *** 113,116 **** --- 121,125 ---- def check_instance(self): + """ Check if specto is already running. """ pidfile = os.environ['HOME'] + "/.specto/" + "specto.pid" if not os.path.exists(pidfile): *************** *** 136,140 **** def recreate_tray(self, *args): """ ! Recreate a tray icon if the notification area unexpectedly quits """ self.tray = "" --- 145,149 ---- def recreate_tray(self, *args): """ ! Recreate a tray icon if the notification area unexpectedly quits. """ self.tray = "" *************** *** 144,154 **** def create_all_watches(self, value_db): """ ! To create the watches at loading """ for i in value_db: ! j = self.create_watch(value_db[i]) if GTK: while gtk.events_pending(): gtk.main_iteration_do(False) if self.conf_ui.get_entry("/display_all", "boolean") == False: self.notifier.wTree.get_widget("display_all_watches").set_active(False) --- 153,164 ---- def create_all_watches(self, value_db): """ ! Create the watches at startup. """ for i in value_db: ! self.create_watch(value_db[i]) if GTK: while gtk.events_pending(): gtk.main_iteration_do(False) + if self.conf_ui.get_entry("/display_all", "boolean") == False: self.notifier.wTree.get_widget("display_all_watches").set_active(False) *************** *** 160,166 **** def create_watch(self, values): ! """ ! Add the watch to the watches repository ! """ id = len(self.watch_db) if values['type'] == 0: #add a website --- 170,174 ---- def create_watch(self, values): ! """ Add a watch to the watches repository. """ id = len(self.watch_db) if values['type'] == 0: #add a website *************** *** 203,207 **** self.notifier = Notifier(self) self.notifier.restore_size_and_position()#fixme: is this necessary? this makes specto output stuff for nothing. ! self.notifier.add_notifier_entry(values['name'], values['type'], id) #HERE!! add the new GUI try: if values['updated']: --- 211,215 ---- self.notifier = Notifier(self) self.notifier.restore_size_and_position()#fixme: is this necessary? this makes specto output stuff for nothing. ! self.notifier.add_notifier_entry(values['name'], values['type'], id) try: if values['updated']: *************** *** 217,222 **** --- 225,257 ---- return id + + def clear_watch(self, id): + """ Mark a watch as not updated. """ + new_values = {} + self.watch_db[id].updated = False + new_values['name'] = self.watch_db[id].name + new_values['updated'] = False + self.watch_io.write_options(new_values) + + self.count_updated_watches() + + def update_watch(self, progress, id): + """ Display a refresh icon when updating watches. """ + self.notifier.toggle_updating(progress, id) + + def set_status(self, id, status): + """ Set the status from a watch (active/not active). """ + new_values = {} + new_values['name'] = self.watch_db[id].name + new_values['active'] = status + self.watch_db[id].active = status + self.watch_io.write_options(new_values) + + def replace_name(self, orig, new): + """ Replace the name from a watch in watches.list. """ + self.watch_io.replace_name(orig, new) def start_watch(self, id): + """ Start a watch. """ self.notifier.toggle_updating(True, id) self.watch_db[id].start_watch() *************** *** 224,231 **** --- 259,268 ---- def stop_watch(self, id): + """ Stop a watch. """ self.watch_db[id].stop_watch() self.logger.log("watch \"" + self.watch_db[id].name + "\" stopped" , "info", self.__class__) def add_watch(self, values): + """ Add a new watch. """ new_values = {} new_values['name'] = values['name'] *************** *** 233,241 **** new_values['refresh'] = self.set_interval(values['refresh_value'], values['refresh_unit']) ! if int(values['type']) == 0: new_values['uri'] = values['url'] new_values['error_margin'] = values['error_margin'] ! elif int(values['type']) == 1: if int(values['prot']) == 0 or int(values['prot']) == 1: new_values['host'] = values['host'] --- 270,278 ---- new_values['refresh'] = self.set_interval(values['refresh_value'], values['refresh_unit']) ! if int(values['type']) == 0: #web new_values['uri'] = values['url'] new_values['error_margin'] = values['error_margin'] ! elif int(values['type']) == 1: #mail if int(values['prot']) == 0 or int(values['prot']) == 1: new_values['host'] = values['host'] *************** *** 245,249 **** new_values['prot'] = values['prot'] ! elif int(values['type']) == 2: new_values['file'] = values['file'] new_values['mode'] = values['mode'] --- 282,286 ---- new_values['prot'] = values['prot'] ! elif int(values['type']) == 2: #file new_values['file'] = values['file'] new_values['mode'] = values['mode'] *************** *** 254,264 **** self.watch_io.write_options(new_values) ! def check_unique_watch(self, name): ! if self.watch_io.search_watch(name) and GTK: ! return False ! else: ! return True ! ! def edit_watch(self, values):#TODO: change the values in the watch instance realtime new_values = {} new_values['name'] = values['name'] --- 291,296 ---- self.watch_io.write_options(new_values) ! def edit_watch(self, values): ! """ Edit a watch. """ new_values = {} new_values['name'] = values['name'] *************** *** 266,274 **** new_values['refresh'] = self.set_interval(values['refresh_value'], values['refresh_unit']) ! if int(values['type']) == 0: new_values['uri'] = values['url'] new_values['error_margin'] = values['error_margin'] ! elif int(values['type']) == 1: if int(values['prot']) == 0 or int(values['prot']) == 1: new_values['host'] = values['host'] --- 298,306 ---- new_values['refresh'] = self.set_interval(values['refresh_value'], values['refresh_unit']) ! if int(values['type']) == 0: #web new_values['uri'] = values['url'] new_values['error_margin'] = values['error_margin'] ! elif int(values['type']) == 1: #mail if int(values['prot']) == 0 or int(values['prot']) == 1: new_values['host'] = values['host'] *************** *** 279,283 **** new_values['prot'] = values['prot'] ! elif int(values['type']) == 2: new_values['file'] = values['file'] --- 311,315 ---- new_values['prot'] = values['prot'] ! elif int(values['type']) == 2: #file new_values['file'] = values['file'] *************** *** 286,289 **** --- 318,322 ---- def remove_watch(self, name, id): + """ Remove a watch. """ self.watch_io.remove_watch(name) try: *************** *** 297,328 **** self.notifier.model.remove(self.notifier.iter[id]) def count_updated_watches(self): ! self.tooltip_updated_watches = { 0:0,1:0,2:0 } for i in self.watch_db: if self.watch_db[i].updated == True: self.tray.set_icon_state_excited()#change the tray icon color to orange ! self.tooltip_updated_watches[self.watch_db[i].type] = self.tooltip_updated_watches[self.watch_db[i].type] + 1 ! if self.tooltip_updated_watches.values() == [0,0,0]:#there are no more watches to clear, reset the tray icon self.tray.set_icon_state_normal() self.notifier.wTree.get_widget("button_clear_all").set_sensitive(False) ! self.tray.show_tooltip(self.tooltip_updated_watches) ! ! def clear_watch(self, id): ! new_values = {} ! self.watch_db[id].updated = False ! new_values['name'] = self.watch_db[id].name ! new_values['updated'] = False ! self.watch_io.write_options(new_values) ! ! self.count_updated_watches() ! ! def update_watch(self, progress, id): ! self.notifier.toggle_updating(progress, id) def toggle_updated(self, id): """ ! Everytime a watch says it has been updated, we need to tell the notifier window to display it, ! change the tray icon state, and do all kind of snazzy stuff. """ new_values = {} --- 330,357 ---- self.notifier.model.remove(self.notifier.iter[id]) + def check_unique_watch(self, name): + """ Check if the watch name is unique. """ + if self.watch_io.search_watch(name) and GTK: + return False + else: + return True + def count_updated_watches(self): ! """ Count the number of updated watches for the tooltip. """ ! tooltip_updated_watches = { 0:0,1:0,2:0 } for i in self.watch_db: if self.watch_db[i].updated == True: self.tray.set_icon_state_excited()#change the tray icon color to orange ! tooltip_updated_watches[self.watch_db[i].type] = tooltip_updated_watches[self.watch_db[i].type] + 1 ! if tooltip_updated_watches.values() == [0,0,0]:#there are no more watches to clear, reset the tray icon self.tray.set_icon_state_normal() self.notifier.wTree.get_widget("button_clear_all").set_sensitive(False) ! self.tray.show_tooltip(tooltip_updated_watches) def toggle_updated(self, id): """ ! When a watch is updated: change name in notifier window, ! change the tray icon state, play a sound, ... """ new_values = {} *************** *** 337,348 **** new_values['name'] = self.watch_db[id].name new_values['updated'] = True ! self.watch_io.write_options(new_values) ! self.count_updated_watches() def toggle_all_cleared(self): ! """ ! The user requested to 'acknowledge' all the watches and reset their state back to 'not updated'. ! """ for i in self.watch_db: new_values = {} --- 366,375 ---- new_values['name'] = self.watch_db[id].name new_values['updated'] = True ! self.watch_io.write_options(new_values) #write the watches state in watches.list ! self.count_updated_watches() #show the tooltip def toggle_all_cleared(self): ! """ Set the state from all the watches back to 'not updated'. """ for i in self.watch_db: new_values = {} *************** *** 354,388 **** self.count_updated_watches() ! def set_interval(self, refresh, refresh_unit):#TODO : Send in a util file """ ! set the interval between the update checks refresh = number refresh_unit = days, hours, minutes,... in values of 0, 1, 2, 3. """ if refresh_unit == 0:#seconds ! return refresh * 1000 elif refresh_unit == 1:#minutes ! return refresh * 60 * 1000 elif refresh_unit == 2:#hours ! return (refresh * 60) * 60 * 1000 elif refresh_unit == 3:#days ! return ((refresh * 60) * 60) * 24 *1000 def get_interval(self, value): ! """ ! get the interval between the update checks ! """ if ((value / 60) / 60) / 24 / 1000 > 0: refresh_value = ((value / 60) / 60) / 24 / 1000 type = 3 - elif (value / 60) / 60 / 1000 > 0: refresh_value = (value / 60) / 60 / 1000 type = 2 - elif value / 60 / 1000 > 0: refresh_value = value / 60 / 1000 type = 1 - else: refresh_value = value / 1000 --- 381,413 ---- self.count_updated_watches() ! def set_interval(self, refresh, refresh_unit): """ ! Set the interval between the update checks. refresh = number refresh_unit = days, hours, minutes,... in values of 0, 1, 2, 3. """ + new_refresh = 0 if refresh_unit == 0:#seconds ! new_refresh = refresh * 1000 elif refresh_unit == 1:#minutes ! new_refresh = refresh * 60 * 1000 elif refresh_unit == 2:#hours ! new_refresh = (refresh * 60) * 60 * 1000 elif refresh_unit == 3:#days ! new_refresh = ((refresh * 60) * 60) * 24 *1000 ! ! return new_refresh def get_interval(self, value): ! """ Get the interval between 2 updates. """ if ((value / 60) / 60) / 24 / 1000 > 0: refresh_value = ((value / 60) / 60) / 24 / 1000 type = 3 elif (value / 60) / 60 / 1000 > 0: refresh_value = (value / 60) / 60 / 1000 type = 2 elif value / 60 / 1000 > 0: refresh_value = value / 60 / 1000 type = 1 else: refresh_value = value / 1000 *************** *** 390,405 **** return refresh_value, type - - def set_status(self, id, status): - new_values = {} - new_values['name'] = self.watch_db[id].name - new_values['active'] = status - self.watch_db[id].active = status - self.watch_io.write_options(new_values) - - def replace_name(self, orig, new): - self.watch_io.replace_name(orig, new) - #TODO: put the new name in watches_db - def toggle_notifier(self, *args): --- 415,418 ---- *************** *** 437,440 **** --- 450,454 ---- def show_preferences(self, *args): + """ Show the preferences window. """ if not self.preferences_initialized or self.preferences.get_state() == True: self.logger.log("preferences: create" , "debug", self.__class__) *************** *** 445,448 **** --- 459,463 ---- def show_error_log(self, *args): + """ Show the error log. """ if self.error_l == "": self.error_l= Log_dialog(self) *************** *** 455,458 **** --- 470,474 ---- def show_add_watch(self, *args): + """ Show the add watch window. """ if self.add_w == "": self.add_w= Add_watch(self) *************** *** 465,468 **** --- 481,486 ---- def show_edit_watch(self, id, *args): + """ Show the edit watch window. """ + selected = "" if not id == -1: selected = self.watch_db[id] *************** *** 482,488 **** def show_about(self, *args): ! about = About() ! def quit(self, *args): if self.notifier.get_state()==True and not self.notifier_keep_hidden: self.notifier.save_size_and_position()#when quitting specto abruptly, remember the notifier window properties --- 500,517 ---- def show_about(self, *args): ! """ Show the about window. """ ! if self.about == "": ! self.about = About() ! elif self.about.about.flags() & gtk.MAPPED: ! pass ! else: ! self.about = About() ! ! def show_help(self, *args): ! """ Show the help web page. """ ! self.util.show_webpage("http://specto.ecchi.ca") ! def quit(self, *args): ! """ Save the save and position from the notifier and quit Specto. """ if self.notifier.get_state()==True and not self.notifier_keep_hidden: self.notifier.save_size_and_position()#when quitting specto abruptly, remember the notifier window properties *************** *** 492,496 **** self.notifier.stop_refresh = True os.system("zenity --info --title='Cannot quit' --text='Specto is currently checking a watch for updates. When it has finished checking, try quitting Specto again.' &") #FIXME: allow emergency quitting anyway? Create a "real" gtk dialog that offers the choice between "wait" (do nothing), "retry" (self.quit) and "emergency exit" (killall specto). - - def show_help(self, *args): - self.util.show_webpage("http://specto.ecchi.ca") --- 521,522 ---- Index: watch_web_static.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/watch_web_static.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** watch_web_static.py 19 Oct 2006 12:41:31 -0000 1.22 --- watch_web_static.py 19 Oct 2006 14:53:49 -0000 1.23 *************** *** 25,33 **** from specto.watch import Watch ! import os, md5, urllib2#, StringIO, gzip from httplib import HTTPMessage from math import fabs from re import compile #this is the regex compile module to parse some stuff such as <link> tags in feeds - import StringIO, gzip cacheSubDir__ = os.environ['HOME'] + "/.specto/cache/" --- 25,34 ---- from specto.watch import Watch ! ! import StringIO, gzip ! import os, md5, urllib2 from httplib import HTTPMessage from math import fabs from re import compile #this is the regex compile module to parse some stuff such as <link> tags in feeds cacheSubDir__ = os.environ['HOME'] + "/.specto/cache/" *************** *** 35,42 **** os.mkdir(cacheSubDir__) ! class Web_watch(Watch): #import superclass ! """ ! Watch for http pages, check for filesize differences, md5sum the new pages. ! Will call the function 'notify' when the page has changed. """ url_ = "" --- 36,42 ---- os.mkdir(cacheSubDir__) ! class Web_watch(Watch): ! """ ! Watch class that will check if http or rss pages are changed. """ url_ = "" *************** *** 64,85 **** def start_watch(self): self.update() - - def set_url(self, url): - self.url_ = url - - def set_error_margin(self, error_margin): - self.error_margin = error_margin def update(self): ! """ ! Ask the watch to check for updates. If there seems to be an update, ! check if it exceeds the filesize maximum change margin. If it fails, ! check the MD5sum. This is important because two files could have the same ! filesize, but different contents. ! """ self.error = False self.specto.update_watch(True, self.id) self.specto.logger.log("Updating watch: \"" + self.name + "\"", "info", self.__class__) # Create a unique name for each url. digest = md5.new(self.url_).digest() --- 64,76 ---- def start_watch(self): + """ Start the watch. """ self.update() def update(self): ! """ See if a http or rss page changed. """ self.error = False self.specto.update_watch(True, self.id) self.specto.logger.log("Updating watch: \"" + self.name + "\"", "info", self.__class__) + # Create a unique name for each url. digest = md5.new(self.url_).digest() *************** *** 92,96 **** f = file(self.cacheFullPath_, "r")# Load up the cached version self.infoB_ = HTTPMessage(f) - #if self.specto.DEBUG: print self.infoB_ if self.infoB_.has_key('last-modified'): request.add_header("If-Modified-Since", self.infoB_['last-modified']) --- 83,86 ---- *************** *** 102,110 **** self.error = True self.specto.logger.log("Watch: \"" + self.name + "\" has error: " + str(e), "error", self.__class__) - #if (e.code == 304): - # self.specto.logger.log("Page didn't change, will not update cache (Watch: \"" + self.name + "\)", "warning", self.__class__) - # self.url2_ = self.url_ - #else: - # raise urllib2.HTTPError, e#FIXME: please add a way to catch if the host could not be reached. It should then wait and restart the watch later. else: self.info_ = response.info() --- 92,95 ---- *************** *** 131,137 **** if not ( compile("<rdf:RDF xmlns:rdf=.*>").findall(self.page_source)==[] ) or not( compile("<rss version=.*>").findall(self.page_source)==[] ) or not ( compile("<feed xmlns=.*>").findall(self.page_source)==[] ): #it seems like it is a syndication feed. Let's see if we can extract the home URL from it. ! self.regexed_contents=compile("<link>.*</link>").findall(self.page_source) ## Grabs anything inside <link> and </link>; .* means "any characters self.rss_links="" ! for m in self.regexed_contents: ## Iterates through and takes off the tags if self.rss_links=="": m=m.strip("<link>").strip("</link>") --- 116,122 ---- if not ( compile("<rdf:RDF xmlns:rdf=.*>").findall(self.page_source)==[] ) or not( compile("<rss version=.*>").findall(self.page_source)==[] ) or not ( compile("<feed xmlns=.*>").findall(self.page_source)==[] ): #it seems like it is a syndication feed. Let's see if we can extract the home URL from it. ! self.regexed_contents=compile("<link>.*</link>").findall(self.page_source) # Grabs anything inside <link> and </link>; .* means "any characters self.rss_links="" ! for m in self.regexed_contents: # Iterates through and takes off the tags if self.rss_links=="": m=m.strip("<link>").strip("</link>") *************** *** 161,165 **** self.old_filesize = self.specto.watch_io.read_option(self.name, "filesize") if self.old_filesize!=0:#if 0, that would mean that read_option could not find the filesize in watches.list ! ##if there is a previous filesize #calculate the % changed filesize self.filesize_difference = (fabs(int(self.new_filesize) - int(self.old_filesize)) / int(self.old_filesize))*100 --- 146,150 ---- self.old_filesize = self.specto.watch_io.read_option(self.name, "filesize") if self.old_filesize!=0:#if 0, that would mean that read_option could not find the filesize in watches.list ! #if there is a previous filesize #calculate the % changed filesize self.filesize_difference = (fabs(int(self.new_filesize) - int(self.old_filesize)) / int(self.old_filesize))*100 *************** *** 167,171 **** self.specto.logger.log("Difference percentage:" + str(self.filesize_difference)[:5] + "% (Watch: \"" + self.name + "\")", "info", self.__class__) if (self.filesize_difference >= float(self.error_margin)*100) and (self.filesize_difference != 0.0): ! ##if the filesize differences exceed the error_margin #if self.specto.DEBUG: print "\tMD5SUM and filesize exceeded the margin: the watch has been updated." self.to_be_stored_filesize = self.new_filesize --- 152,156 ---- self.specto.logger.log("Difference percentage:" + str(self.filesize_difference)[:5] + "% (Watch: \"" + self.name + "\")", "info", self.__class__) if (self.filesize_difference >= float(self.error_margin)*100) and (self.filesize_difference != 0.0): ! #if the filesize differences exceed the error_margin #if self.specto.DEBUG: print "\tMD5SUM and filesize exceeded the margin: the watch has been updated." self.to_be_stored_filesize = self.new_filesize *************** *** 174,178 **** #this means that no matter what, the webpage is updated else: ! ##if there is no important changes in filesize. Call the MD5Sum. #MD5summing analysis if self.cached and (self.infoB_['md5sum'] == self.info_['md5sum']): --- 159,163 ---- #this means that no matter what, the webpage is updated else: ! #if there is no important changes in filesize. Call the MD5Sum. #MD5summing analysis if self.cached and (self.infoB_['md5sum'] == self.info_['md5sum']): *************** *** 188,192 **** #if self.specto.DEBUG: print "\tSaved filesize: ", self.to_be_stored_filesize else: ! ##if there is NO previously stored filesize self.to_be_stored_filesize = self.new_filesize #if self.specto.DEBUG: print "\tSaved filesize: ", self.to_be_stored_filesize --- 173,177 ---- #if self.specto.DEBUG: print "\tSaved filesize: ", self.to_be_stored_filesize else: ! #if there is NO previously stored filesize self.to_be_stored_filesize = self.new_filesize #if self.specto.DEBUG: print "\tSaved filesize: ", self.to_be_stored_filesize *************** *** 196,199 **** --- 181,185 ---- self.write_uri()#it's uri, not url. self.write_filesize() + self.specto.update_watch(False, self.id) Watch.update(self) *************** *** 204,208 **** def info(self): ! """Returns an HTTPMessage for manipulating headers. Note that you can use this to read headers but not --- 190,194 ---- def info(self): ! """ Returns an HTTPMessage for manipulating headers. Note that you can use this to read headers but not *************** *** 226,232 **** def _writeHeaders(self): ! ''' ! Writes the full header in the cache. ! ''' f = file(self.cacheFullPath_, "w") f.write(str(self.info_)) --- 212,216 ---- def _writeHeaders(self): ! """ Write the full header in the cache. """ f = file(self.cacheFullPath_, "w") f.write(str(self.info_)) *************** *** 234,237 **** --- 218,222 ---- def write_filesize(self): + """ Write the filesize in the cache. """ self.new_values = {} self.new_values['name'] = self.name *************** *** 240,243 **** --- 225,229 ---- def write_uri(self): + """ Write the uri in the cache. """ self.new_values = {} self.new_values['name'] = self.name *************** *** 246,250 **** self.url_ = self.url2_ ! def clearCache(): [os.unlink(os.path.join(cacheSubDir__, name)) for name in os.listdir(cacheSubDir__)] --- 232,237 ---- self.url_ = self.url2_ ! def clearCache(self): ! """ Clear the cache file. """ [os.unlink(os.path.join(cacheSubDir__, name)) for name in os.listdir(cacheSubDir__)] *************** *** 253,254 **** --- 240,249 ---- content = response.read() return content + + def set_url(self, url): + """ Set the url for the watch. """ + self.url_ = url + + def set_error_margin(self, error_margin): + """ Set the error margin for the watch. """ + self.error_margin = error_margin \ No newline at end of file Index: specto_gconf.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/specto_gconf.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** specto_gconf.py 16 Aug 2006 12:58:14 -0000 1.4 --- specto_gconf.py 19 Oct 2006 14:53:49 -0000 1.5 *************** *** 27,30 **** --- 27,34 ---- class GConfClient: + """ + Specto gconf class. + """ + def __init__(self, directory): # Get the GConf object *************** *** 34,43 **** def get_entry(self, key, type_): ! """ ! returns the value of an entry ! key = /dir/key ! type_ = string, boolean, integer or float ! """ k = self.directory + key if type_ == "string": --- 38,44 ---- def get_entry(self, key, type_): ! """ Returns the value of a key. """ k = self.directory + key + s = "" if type_ == "string": *************** *** 53,62 **** def set_entry(self, key, entry, type_): ! """ ! set a value in a key ! key = /dir/key ! entry = value of the key ! type_ = string, boolean, integer or float ! """ k = self.directory + key --- 54,58 ---- def set_entry(self, key, entry, type_): ! """ Set the value from a key. """ k = self.directory + key *************** *** 71,83 **** def unset_entry(self,key): ! """ ! unset (remove) a key ! key = /dir/key ! """ self.client.unset(self.directory + key) def notify_entry(self, key, callback, label): ! """ ! tell gconf to wach if the key has changed ! """ self.client.notify_add (self.directory + key, callback, label) --- 67,74 ---- def unset_entry(self,key): ! """ Unset (remove) the key. """ self.client.unset(self.directory + key) def notify_entry(self, key, callback, label): ! """ Listen for changes in a key. """ self.client.notify_add (self.directory + key, callback, label) Index: util.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/util.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** util.py 27 Sep 2006 15:03:20 -0000 1.11 --- util.py 19 Oct 2006 14:53:49 -0000 1.12 *************** *** 1,21 **** #!/usr/bin/env python import os from specto.specto_gconf import GConfClient import gnomevfs - def get_path(path, sibling): #FIXME : Find me a use. - """ - Return the path to a sibling of a file in the filesystem. - This is useful in conjunction with the special __file__ attribute - that Python provides for modules, so modules can load associated - resource files. - """ - return os.path.join(os.path.dirname(os.path.abspath(path)), sibling) - def show_webpage(webpage): ! """ ! read the default browser from gconf ! and open the webpage in the browser ! """ conf = GConfClient("/desktop/gnome/url-handlers/http") default_browser = conf.get_entry("/command", "string") --- 1,33 ---- #!/usr/bin/env python + # -*- coding: UTF8 -*- + + # Specto , Unobtrusive event notifier + # + # util.py + # + # Copyright (c) 2005, Jean-François Fortin Tam ~<nekohayo a gmail.com>~ + # This module code is maintained by : Jean-François Fortin, Pascal Potvin and Wout Clymans + + # This program is free software; you can redistribute it and/or + # modify it under the terms of the GNU General Public + # License as published by the Free Software Foundation; either + # version 2.1 of the License, or (at your option) any later version. + # + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + # General Public License for more details. + # + # You should have received a copy of the GNU General Public + # License along with this program; if not, write to the + # Free Software Foundation, Inc., 59 Temple Place - Suite 330, + # Boston, MA 02111-1307, USA. + import os from specto.specto_gconf import GConfClient import gnomevfs def show_webpage(webpage): ! """ Open the webpage in the default browser. """ conf = GConfClient("/desktop/gnome/url-handlers/http") default_browser = conf.get_entry("/command", "string") *************** *** 23,36 **** def open_gconf_application(key): ! """ ! get name and open an application ! """ ! #open application from gconf key conf = GConfClient(key) application = conf.get_entry("/command", "string") - os.system(application + " &") ! def open_file_watch(f, m): mime_type = gnomevfs.get_mime_type(f) application = gnomevfs.mime_get_default_application(mime_type) --- 35,45 ---- def open_gconf_application(key): ! """ Get the name from gconf and open the application. """ conf = GConfClient(key) application = conf.get_entry("/command", "string") os.system(application + " &") ! def open_file_watch(f): ! """ Open a file with the correct application (mime). """ mime_type = gnomevfs.get_mime_type(f) application = gnomevfs.mime_get_default_application(mime_type) Index: watch_mail_pop3.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/watch_mail_pop3.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** watch_mail_pop3.py 30 Aug 2006 17:52:13 -0000 1.10 --- watch_mail_pop3.py 19 Oct 2006 14:53:49 -0000 1.11 *************** *** 24,35 **** # Boston, MA 02111-1307, USA. ! from specto.watch import watch import poplib import os from socket import error ! class Mail_watch(watch): ! """ ! this watch will check if you have a new mail on your pop3 server """ updated = False --- 24,36 ---- # Boston, MA 02111-1307, USA. ! from specto.watch import Watch ! import poplib import os from socket import error ! class Mail_watch(Watch): ! """ ! Watch class that will check if you recevied a new mail on your pop3 account. """ updated = False *************** *** 40,44 **** def __init__(self, refresh, host, username, password, specto, id, name = "Unknown Mail Watch"): ! watch.__init__(self, specto) #init superclass self.name = name self.refresh = refresh --- 41,45 ---- def __init__(self, refresh, host, username, password, specto, id, name = "Unknown Mail Watch"): ! Watch.__init__(self, specto) self.name = name self.refresh = refresh *************** *** 56,66 **** def start_watch(self): self.update() - def update(self): ! """ ! check for new mails ! """ self.error = False self.specto.update_watch(True, self.id) --- 57,65 ---- def start_watch(self): + """ Start the watch. """ self.update() def update(self): ! """ Check for new mails on your pop3 account. """ self.error = False self.specto.update_watch(True, self.id) *************** *** 88,97 **** self.specto.update_watch(False, self.id) ! watch.update(self) def check_old(self): ! """ ! check how many messages there were last time ! """ if (os.path.exists(self.cacheFullPath_)): f = file(self.cacheFullPath_, "r") --- 87,94 ---- self.specto.update_watch(False, self.id) ! Watch.update(self) def check_old(self): ! """ Check how many messages there were last time. """ if (os.path.exists(self.cacheFullPath_)): f = file(self.cacheFullPath_, "r") *************** *** 104,110 **** def write_new(self): ! """ ! write the number of messages in cachefile ! """ f = file(self.cacheFullPath_, "w") f.write(str(self.newMsg)) --- 101,105 ---- def write_new(self): ! """ Write the new number of messages in the cache file. """ f = file(self.cacheFullPath_, "w") f.write(str(self.newMsg)) *************** *** 112,120 **** --- 107,118 ---- def set_username(self, username): + """ Set the username for the watch. """ self.user = username def set_password(self, password): + """ Set the password for the watch. """ self.password = password def set_host(self, host): + """ Set the host for the watch. """ self.host = host \ No newline at end of file Index: notifier.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/notifier.py,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** notifier.py 17 Oct 2006 17:06:50 -0000 1.63 --- notifier.py 19 Oct 2006 14:53:49 -0000 1.64 *************** *** 383,387 **** specto.util.open_gconf_application("/desktop/gnome/url-handlers/mailto") elif selected.type == 2: ! specto.util.open_file_watch(selected.file, selected.mode) def change_entry_name(self, *args): --- 383,387 ---- specto.util.open_gconf_application("/desktop/gnome/url-handlers/mailto") elif selected.type == 2: ! specto.util.open_file_watch(selected.file) def change_entry_name(self, *args): Index: watch_file.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/watch_file.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** watch_file.py 19 Oct 2006 12:41:31 -0000 1.4 --- watch_file.py 19 Oct 2006 14:53:49 -0000 1.5 *************** *** 23,27 **** --- 23,29 ---- # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. + from specto.watch import Watch + import os, re from stat import * *************** *** 32,37 **** class File_watch(Watch): ! """ ! this watch will check if a file was modified, deleted, created,... """ updated = False --- 34,39 ---- class File_watch(Watch): ! """ ! Watch class that will check if a file was modified, removed or created. """ updated = False *************** *** 39,43 **** def __init__(self, refresh, file, mode, specto, id, name = "Unknown File Watch"): ! Watch.__init__(self, specto) #init superclass self.name = name self.refresh = refresh --- 41,45 ---- def __init__(self, refresh, file, mode, specto, id, name = "Unknown File Watch"): ! Watch.__init__(self, specto) self.name = name self.refresh = refresh *************** *** 49,80 **** def start_watch(self): self.update() def update(self): ! """ ! see if a file/folder was modified ! """ self.error = False self.specto.update_watch(True, self.id) self.specto.logger.log("Updating watch: \"" + self.name + "\"", "info", self.__class__) ! self.get_cache_dir() ! self.old_values = self.read_options() ! mode = os.stat(self.file)[ST_MODE] ! self.new_files = [] ! if S_ISDIR(mode): ! self.get_dir(self.file) ! self.write_options()#write the new values to the cache file ! self.old_values = self.read_options() #read the new valeus ! self.get_removed_files() #remove the files that were removed ! self.write_options()#write the values (with the removed lines) to the cache file ! else: ! self.get_file(self.file) ! self.write_options() ! ! #first time don't mark as updated ! if self.first_time == True: ! self.updated = False ! self.first_time = False self.specto.update_watch(False, self.id) --- 51,85 ---- def start_watch(self): + """ Start the watch. """ self.update() def update(self): ! """ See if a file was modified or created. """ self.error = False self.specto.update_watch(True, self.id) self.specto.logger.log("Updating watch: \"" + self.name + "\"", "info", self.__class__) ! try: ! self.get_cache_file() ! self.old_values = self.read_options() ! mode = os.stat(self.file)[ST_MODE] ! self.new_files = [] ! if S_ISDIR(mode): ! self.get_dir(self.file) ! self.write_options()#write the new values to the cache file ! self.old_values = self.read_options() #read the new valeus ! self.get_removed_files() #remove the files that were removed ! self.write_options()#write the values (with the removed lines) to the cache file ! else: ! self.get_file(self.file) ! self.write_options() ! ! #first time don't mark as updated ! if self.first_time == True: ! self.updated = False ! self.first_time = False ! except: ! self.error = True ! self.specto.logger.log("Watch: \"" + self.name + "\" has an error", "error", self.__class__) self.specto.update_watch(False, self.id) *************** *** 82,85 **** --- 87,91 ---- def get_file(self, file_): + """ Get the info from a file and compair it with the previous info. """ size = int(os.stat(file_)[6]) #mode, ino, dev, nlink, uid, gid, size, atime, mtime, ctime = info old_size = re.search('%s:\s(.+)' % file_, self.old_values) *************** *** 98,104 **** def get_dir(self, dir_): ! """ ! recursively walk the directory ! """ for f in os.listdir(dir_): pathname = os.path.join(dir_, f) --- 104,108 ---- def get_dir(self, dir_): ! """ Recursively walk a directory. """ for f in os.listdir(dir_): pathname = os.path.join(dir_, f) *************** *** 113,116 **** --- 117,121 ---- def get_removed_files(self): + """ Get the removed files. """ old_values_ = self.old_values.split("\n") self.old_values = "" *************** *** 125,131 **** def write_options(self): ! ''' ! Writes the properties in the cache. ! ''' f = file(self.file_name, "w") f.write(str(self.old_values)) --- 130,134 ---- def write_options(self): ! """ Write the new values in the cache file. """ f = file(self.file_name, "w") f.write(str(self.old_values)) *************** *** 133,136 **** --- 136,140 ---- def read_options(self): + """ Read the options from the cache file. """ try: f = file(self.file_name, "r")# Load up the cached version *************** *** 145,149 **** pass ! def get_cache_dir(self): self.file_name = cacheSubDir__ + self.file.replace("/","_") + ".cache" if not os.path.exists(self.file_name): --- 149,154 ---- pass ! def get_cache_file(self): ! """ Create and open the cache file. """ self.file_name = cacheSubDir__ + self.file.replace("/","_") + ".cache" if not os.path.exists(self.file_name): *************** *** 154,156 **** --- 159,162 ---- def set_file(self, file): + """ Set the filename. """ self.file = file \ No newline at end of file Index: traypopup.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/traypopup.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** traypopup.py 26 Aug 2006 08:56:00 -0000 1.2 --- traypopup.py 19 Oct 2006 14:53:49 -0000 1.3 *************** *** 24,40 **** # Boston, MA 02111-1307, USA. - import pygtk import gtk class TrayPopupMenu: def __init__(self, specto, text): # Create menu items self.item_show = gtk.MenuItem( text, True) self.item_pref = gtk.ImageMenuItem(gtk.STOCK_PREFERENCES) - #TODO: add a debug window and menu. self.item_help = gtk.ImageMenuItem(gtk.STOCK_HELP) self.item_about = gtk.ImageMenuItem(gtk.STOCK_ABOUT) self.item_quit = gtk.ImageMenuItem(gtk.STOCK_QUIT) ! #FIXME: put stock icons and choices like MenuItem ( Quit!! , gtk.TRUE) # Connect the events self.item_show.connect( 'activate', specto.show_notifier) --- 24,42 ---- # Boston, MA 02111-1307, USA. import gtk class TrayPopupMenu: + """ + Create a menu for the Trayicon. + """ + def __init__(self, specto, text): # Create menu items self.item_show = gtk.MenuItem( text, True) self.item_pref = gtk.ImageMenuItem(gtk.STOCK_PREFERENCES) self.item_help = gtk.ImageMenuItem(gtk.STOCK_HELP) self.item_about = gtk.ImageMenuItem(gtk.STOCK_ABOUT) self.item_quit = gtk.ImageMenuItem(gtk.STOCK_QUIT) ! # Connect the events self.item_show.connect( 'activate', specto.show_notifier) *************** *** 43,48 **** --- 45,52 ---- self.item_about.connect( 'activate', specto.show_about) self.item_quit.connect( 'activate', specto.quit) + # Create the menu self.menu = gtk.Menu() + # Append menu items to the menu self.menu.append( self.item_show) *************** *** 56,60 **** def show_menu(self, event): ! # Display the menu ! self.menu.popup( None, None, None, event.button, event.time) ! \ No newline at end of file --- 60,63 ---- def show_menu(self, event): ! """ Show the trayicon menu. """ ! self.menu.popup( None, None, None, event.button, event.time) \ No newline at end of file Index: about.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/about.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** about.py 17 Oct 2006 17:06:50 -0000 1.5 --- about.py 19 Oct 2006 14:53:49 -0000 1.6 *************** *** 34,38 **** def __init__(self): - #self.specto = specto version_file_path = ('%s/share/doc/specto/VERSION' % sys.prefix) version_file=open(version_file_path, 'r') --- 34,37 ---- *************** *** 52,76 **** #create tree ! self.wTree=gtk.AboutDialog() ! self.wTree.set_name("Specto") ! self.wTree.set_version(version) ! self.wTree.set_copyright("Jean-Francois Fortin Tam") ! # self.wTree.set_comments(comments) ! self.wTree.set_license(license) ! # self.wTree.set_wrap_license(license) ! self.wTree.set_website("http://specto.sourceforge.net") ! self.wTree.set_website_label("Specto's Website") ! self.wTree.set_authors(authors) ! # self.wTree.set_documenters(documenters) ! # self.wTree.set_artists(artists) ! # self.wTree.set_translator_credits(translator_credits) ! self.wTree.set_logo(logo) icon = gtk.gdk.pixbuf_new_from_file('%s/share/specto/icons/specto_window_icon.png' % sys.prefix) ! self.wTree.set_icon(icon) ! # self.wTree.set_logo_icon_name(icon_name) ! self.wTree.show_all() if __name__ == "__main__": --- 51,75 ---- #create tree ! self.about=gtk.AboutDialog() ! self.about.set_name("Specto") ! self.about.set_version(version) ! self.about.set_copyright("Jean-Francois Fortin Tam") ! #self.wTree.set_comments(comments) ! self.about.set_license(license) ! #self.wTree.set_wrap_license(license) ! self.about.set_website("http://specto.sourceforge.net") ! self.about.set_website_label("Specto's Website") ! self.about.set_authors(authors) ! #self.wTree.set_documenters(documenters) ! #self.wTree.set_artists(artists) ! #self.wTree.set_translator_credits(translator_credits) ! self.about.set_logo(logo) icon = gtk.gdk.pixbuf_new_from_file('%s/share/specto/icons/specto_window_icon.png' % sys.prefix) ! self.about.set_icon(icon) ! #self.wTree.set_logo_icon_name(icon_name) ! self.about.show_all() if __name__ == "__main__": Index: edit_watch.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/edit_watch.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** edit_watch.py 14 Sep 2006 13:43:59 -0000 1.15 --- edit_watch.py 19 Oct 2006 14:53:49 -0000 1.16 *************** *** 23,27 **** # Boston, MA 02111-1307, USA. ! import sys, os, util try: import pygtk --- 23,28 ---- # Boston, MA 02111-1307, USA. ! import sys, os ! try: import pygtk *************** *** 38,49 **** class Edit_watch: def __init__(self, specto, watch): - """ - In this init we are going to watch editing dialog. This will be accessible from the notifier dialog, and is the only dialog to provide the remove button for a watch. - """ self.watch = watch self.specto = specto #create tree - #gladefile= util.get_path ( __file__ , "edit_watch.glade") gladefile= '%s/share/specto/glade/edit_watch.glade' % sys.prefix windowname= "edit_watch" --- 39,50 ---- class Edit_watch: + """ + Class to create... [truncated message content] |
|
From: wout <wo...@us...> - 2006-10-19 12:41:48
|
Update of /cvsroot/specto/specto/src/specto In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv15482/src/specto Modified Files: watch_file.py watch_mail_gmail.py watch_mail_imap.py watch_web_static.py Log Message: quick cvs fix Index: watch_file.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/watch_file.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** watch_file.py 4 Oct 2006 13:22:22 -0000 1.3 --- watch_file.py 19 Oct 2006 12:41:31 -0000 1.4 *************** *** 23,27 **** # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. ! from specto.watch import watch import os, re from stat import * --- 23,27 ---- # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. ! from specto.watch import Watch import os, re from stat import * *************** *** 31,35 **** os.mkdir(cacheSubDir__) ! class File_watch(watch): """ this watch will check if a file was modified, deleted, created,... --- 31,35 ---- os.mkdir(cacheSubDir__) ! class File_watch(Watch): """ this watch will check if a file was modified, deleted, created,... *************** *** 39,43 **** def __init__(self, refresh, file, mode, specto, id, name = "Unknown File Watch"): ! watch.__init__(self, specto) #init superclass self.name = name self.refresh = refresh --- 39,43 ---- def __init__(self, refresh, file, mode, specto, id, name = "Unknown File Watch"): ! Watch.__init__(self, specto) #init superclass self.name = name self.refresh = refresh *************** *** 79,83 **** self.specto.update_watch(False, self.id) ! watch.update(self) def get_file(self, file_): --- 79,83 ---- self.specto.update_watch(False, self.id) ! Watch.update(self) def get_file(self, file_): Index: watch_web_static.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/watch_web_static.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** watch_web_static.py 27 Sep 2006 01:08:40 -0000 1.21 --- watch_web_static.py 19 Oct 2006 12:41:31 -0000 1.22 *************** *** 24,28 **** # Boston, MA 02111-1307, USA. ! from specto.watch import watch import os, md5, urllib2#, StringIO, gzip from httplib import HTTPMessage --- 24,28 ---- # Boston, MA 02111-1307, USA. ! from specto.watch import Watch import os, md5, urllib2#, StringIO, gzip from httplib import HTTPMessage *************** *** 35,39 **** os.mkdir(cacheSubDir__) ! class Web_watch(watch): #import superclass """ Watch for http pages, check for filesize differences, md5sum the new pages. --- 35,39 ---- os.mkdir(cacheSubDir__) ! class Web_watch(Watch): #import superclass """ Watch for http pages, check for filesize differences, md5sum the new pages. *************** *** 53,57 **** def __init__(self, specto, name, refresh, url, id, error_margin): ! watch.__init__(self, specto) #init superclass self.refresh = refresh self.id = id --- 53,57 ---- def __init__(self, specto, name, refresh, url, id, error_margin): ! Watch.__init__(self, specto) #init superclass self.refresh = refresh self.id = id *************** *** 197,201 **** self.write_filesize() self.specto.update_watch(False, self.id) ! watch.update(self) def content(self): --- 197,201 ---- self.write_filesize() self.specto.update_watch(False, self.id) ! Watch.update(self) def content(self): Index: watch_mail_imap.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/watch_mail_imap.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** watch_mail_imap.py 30 Aug 2006 17:52:13 -0000 1.8 --- watch_mail_imap.py 19 Oct 2006 12:41:31 -0000 1.9 *************** *** 24,32 **** # Boston, MA 02111-1307, USA. ! from specto.watch import watch import imaplib from socket import error ! class Mail_watch(watch): """ this watch will check if you have a new mail on your imap server --- 24,32 ---- # Boston, MA 02111-1307, USA. ! from specto.watch import Watch import imaplib from socket import error ! class Mail_watch(Watch): """ this watch will check if you have a new mail on your imap server *************** *** 37,41 **** def __init__(self, refresh, host, username, password, specto, id, name = "Unknown Mail Watch"): ! watch.__init__(self, specto) #init superclass self.name = name self.refresh = refresh --- 37,41 ---- def __init__(self, refresh, host, username, password, specto, id, name = "Unknown Mail Watch"): ! Watch.__init__(self, specto) #init superclass self.name = name self.refresh = refresh *************** *** 88,92 **** self.specto.update_watch(False, self.id) ! watch.update(self) def set_username(self, username): --- 88,92 ---- self.specto.update_watch(False, self.id) ! Watch.update(self) def set_username(self, username): Index: watch_mail_gmail.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/watch_mail_gmail.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** watch_mail_gmail.py 13 Oct 2006 13:09:15 -0000 1.11 --- watch_mail_gmail.py 19 Oct 2006 12:41:31 -0000 1.12 *************** *** 24,33 **** # Boston, MA 02111-1307, USA. ! from specto.watch import watch from specto.gmailatom import GmailAtom import os ! class Mail_watch(watch): """ this watch will check if you have a new mail on your gmail account --- 24,33 ---- # Boston, MA 02111-1307, USA. ! from specto.watch import Watch from specto.gmailatom import GmailAtom import os ! class Mail_watch(Watch): """ this watch will check if you have a new mail on your gmail account *************** *** 40,44 **** def __init__(self, refresh, username, password, specto, id, name = "Unknown Mail Watch"): ! watch.__init__(self, specto) #init superclass self.name = name self.refresh = refresh --- 40,44 ---- def __init__(self, refresh, username, password, specto, id, name = "Unknown Mail Watch"): ! Watch.__init__(self, specto) #init superclass self.name = name self.refresh = refresh *************** *** 91,95 **** self.specto.update_watch(False, self.id) ! watch.update(self) def set_username(self, username): --- 91,95 ---- self.specto.update_watch(False, self.id) ! Watch.update(self) def set_username(self, username): |
|
From: wout <wo...@us...> - 2006-10-17 17:07:03
|
Update of /cvsroot/specto/specto/src/specto In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv29169/src/specto Modified Files: about.py add_watch.py notifier.py trayicon.py watch.py Log Message: Specto cleanup part I WARNING: this cleanup currently breaks specto!!! fix will be committed as soon as possible (or change the classname in watch.py back to watch instead of Watch) Index: add_watch.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/add_watch.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** add_watch.py 14 Sep 2006 13:43:59 -0000 1.29 --- add_watch.py 17 Oct 2006 17:06:50 -0000 1.30 *************** *** 23,27 **** # Boston, MA 02111-1307, USA. ! import sys, os try: --- 23,27 ---- # Boston, MA 02111-1307, USA. ! import sys try: *************** *** 38,48 **** class Add_watch: def __init__(self, specto): - """ - In this init we are going to display watch creator dialog - """ self.specto = specto #create tree - #gladefile= util.get_path ( __file__ , "add_watch.glade") gladefile= '%s/share/specto/glade/add_watch.glade' % sys.prefix windowname= "add_watch" --- 38,48 ---- class Add_watch: + """ + Class to create the add watch dialog + """ + def __init__(self, specto): self.specto = specto #create tree gladefile= '%s/share/specto/glade/add_watch.glade' % sys.prefix windowname= "add_watch" *************** *** 73,77 **** --- 73,266 ---- self.refresh = self.wTree.get_widget("refresh") self.refresh_unit = self.wTree.get_widget("refresh_unit") + + #create the gui + self.create_add_gui() + def name_changed(self, widget): + """ Show the watch name in the window. """ + new_name = "<b>" + self.name.get_text() + "</b>" + self.wTree.get_widget("label7").set_label(new_name) + + def check_host(self, *args): + """ + check if we have to show the host fields or not + """ + if self.chkGmail.get_active() == True: + self.lblHost.hide() + self.txtHost.hide() + else: + self.lblHost.show() + self.txtHost.show() + + def change_file_type(self, *args): + """ Check if a file watch or a folder watch has to be used. """ + if self.chkFolder.get_active() == True: + self.btnFile.set_action(gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER) + else: + self.btnFile.set_action(gtk.FILE_CHOOSER_ACTION_OPEN) + + def create_watch(self): + """ + Add the watch to the watches repository. + """ + values = {} + #get the standard options from a watch + values['name'] = self.name.get_text()#FIXME: cfgparse cannot have single quotes (') it seems. We must watch out for the watch name or arguments not to have them. + + #check if the watch is unique + if not self.specto.check_unique_watch(values['name']): + unique_dialog = Unique_Dialog() + result = unique_dialog.run() + + if result ==1: + self.name.grab_focus() + else: #edit the existing watch + self.add_watch.hide_all() + name = values['name'] + self.specto.show_edit_watch(-1, name) + + else: + self.add_watch.hide_all()#FIXME: this is just an illusion to make the user believe that it was done instantaneously, instead of waiting for (sometimes slow) ressources to destroy the window. Note that I used hide_all instead of hide, otherwise the window refuses to hide itself and its contents. + values['type'] = self.type.get_active() + values['refresh_value'] = self.refresh.get_value_as_int() + values['refresh_unit'] = self.refresh_unit.get_active() + + #get the watch dependant options + watch_options = {} + + if values['type'] == 0: #add a website + values['url'] = self.txtUrl.get_text() + if values['url'][0:7] != "http://": + values['url'] = "http://" + values['url'] + + values['error_margin'] = (self.adjustment.get_value() / 100) + + elif values['type'] == 1: #add an email + #check if the watch uses pop3, imap or gmail + if self.chkPop3.get_active() == True: + prot = 0 + values.update({'host': self.txtHost.get_text()}) + elif self.chkImap.get_active() == True: + prot = 1 + values.update({'host': self.txtHost.get_text()}) + else: + prot = 2 + + values.update( + { + 'username': self.txtUsername.get_text(), + 'password': self.txtPassword.get_text(), + 'prot': prot + } + ) + elif values['type'] == 2: #add a file + values['file'] = self.btnFile.get_filename() + if self.chkFile.get_active() == True: + values['mode'] = "file" + else: + values['mode'] = "folder" + + self.add_watch.destroy() + self.specto.add_watch(values) #write the options in the configuration file + #"del self" would be useful here I think. + + def change_options(self, widget): + """ Show the table with the right watch options. """ + selected_type = self.type.get_active() + + #hide the previous table + if self.option_visible != -1: + if self.option_visible == 0: + self.tblWeb.hide() + elif self.option_visible == 1: + self.tblMail.hide() + elif self.option_visible == 2: + self.tblFile.hide() + elif self.option_visible == 3: + pass + + if selected_type == 0: #website + self.tblWeb.show() + + if selected_type == 1: #email + self.tblMail.show() + + if selected_type == 2: #add a file + self.tblFile.show() + + self.option_visible = selected_type + + def set_refresh_values(self, widget): + """ Set the max and min values for the refresh unit. """ + digits = 0 + climb_rate = 1.0 + refresh_unit = self.refresh_unit.get_active() + + if refresh_unit == 0 or refresh_unit == 1: + adjustment = gtk.Adjustment(value=1, lower=1, upper=60, step_incr=1, page_incr=10, page_size=0) + if refresh_unit == 2: + adjustment = gtk.Adjustment(value=1, lower=1, upper=24, step_incr=1, page_incr=10, page_size=0) + if refresh_unit == 3: + adjustment = gtk.Adjustment(value=1, lower=1, upper=365, step_incr=1, page_incr=30, page_size=0) + + self.refresh.configure(adjustment, climb_rate, digits) + + def add_clicked(self,widget): + """ + Check that everything is properly filled in before calling create_watch. + """ + error = False + selected_type = self.type.get_active() + if selected_type == 0: + if self.txtUrl.get_text() == "": + self.txtUrl.grab_focus() + self.txtUrl.modify_base( gtk.STATE_NORMAL, gtk.gdk.Color(65535, 0, 0)) + error = True + else: + self.txtUrl.modify_base( gtk.STATE_NORMAL, gtk.gdk.Color(0xFFFF, 0xFFFF, 0xFFFF)) + if selected_type == 1: + if not self.chkGmail.get_active(): + if self.txtHost.get_text() == "": + self.txtHost.grab_focus() + self.txtHost.modify_base( gtk.STATE_NORMAL, gtk.gdk.Color(65535, 0, 0)) + error = True + else: + self.txtHost.modify_base( gtk.STATE_NORMAL, gtk.gdk.Color(0xFFFF, 0xFFFF, 0xFFFF)) + if self.txtPassword.get_text() == "": + self.txtPassword.grab_focus() + self.txtPassword.modify_base( gtk.STATE_NORMAL, gtk.gdk.Color(65535, 0, 0)) + error = True + else: + self.txtPassword.modify_base( gtk.STATE_NORMAL, gtk.gdk.Color(0xFFFF, 0xFFFF, 0xFFFF)) + if self.txtUsername.get_text() == "": + self.txtUsername.grab_focus() + self.txtUsername.modify_base( gtk.STATE_NORMAL, gtk.gdk.Color(65535, 0, 0)) + error = True + else: + self.txtUsername.modify_base( gtk.STATE_NORMAL, gtk.gdk.Color(0xFFFF, 0xFFFF, 0xFFFF)) + if self.name.get_text() == "": + self.name.grab_focus() + self.name.modify_base( gtk.STATE_NORMAL, gtk.gdk.Color(65535, 0, 0)) + error = True + else: + self.name.modify_base( gtk.STATE_NORMAL, gtk.gdk.Color(0xFFFF, 0xFFFF, 0xFFFF)) + if error == False: + self.create_watch() + + def help_clicked(self,widget): + """ Call the show help function. """ + self.specto.util.show_webpage("http://specto.ecchi.ca/Manual/AddingWatches") + + def cancel_clicked(self,widget): + """ Destroy the add watch window. """ + self.add_watch.destroy() + + def delete_event(self, widget, event, data=None): + """ Destroy the window. """ + self.add_watch.destroy() + return True + + def create_add_gui(self): + """ Create the gui for the different kinds of watches. """ ###create the web options gui self.tblWeb = gtk.Table(rows=2, columns=2, homogeneous=False) *************** *** 212,406 **** vbox.pack_start(self.tblMail, False, False, 0) vbox.pack_start(self.tblFile, False, False, 0) - - def name_changed(self, widget): - new_name = "<b>" + self.name.get_text() + "</b>" - self.wTree.get_widget("label7").set_label(new_name) - - def cancel_clicked(self,widget): - #destroy add_watch window - self.add_watch.destroy() - - def check_host(self, *args): - """ - check if we have to show the host fields or not - """ - if self.chkGmail.get_active() == True: - self.lblHost.hide() - self.txtHost.hide() - else: - self.lblHost.show() - self.txtHost.show() - - def change_file_type(self, *args): - if self.chkFolder.get_active() == True: - self.btnFile.set_action(gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER) - else: - self.btnFile.set_action(gtk.FILE_CHOOSER_ACTION_OPEN) - - def add_clicked(self,widget): - """ - Check that everything is properly filled before calling create_watch. - """ - error = False - selected_type = self.type.get_active() - if selected_type == 0: - if self.txtUrl.get_text() == "": - self.txtUrl.grab_focus() - self.txtUrl.modify_base( gtk.STATE_NORMAL, gtk.gdk.Color(65535, 0, 0)) - error = True - else: - self.txtUrl.modify_base( gtk.STATE_NORMAL, gtk.gdk.Color(0xFFFF, 0xFFFF, 0xFFFF)) - if selected_type == 1: - if not self.chkGmail.get_active(): - if self.txtHost.get_text() == "": - self.txtHost.grab_focus() - self.txtHost.modify_base( gtk.STATE_NORMAL, gtk.gdk.Color(65535, 0, 0)) - error = True - else: - self.txtHost.modify_base( gtk.STATE_NORMAL, gtk.gdk.Color(0xFFFF, 0xFFFF, 0xFFFF)) - if self.txtPassword.get_text() == "": - self.txtPassword.grab_focus() - self.txtPassword.modify_base( gtk.STATE_NORMAL, gtk.gdk.Color(65535, 0, 0)) - error = True - else: - self.txtPassword.modify_base( gtk.STATE_NORMAL, gtk.gdk.Color(0xFFFF, 0xFFFF, 0xFFFF)) - if self.txtUsername.get_text() == "": - self.txtUsername.grab_focus() - self.txtUsername.modify_base( gtk.STATE_NORMAL, gtk.gdk.Color(65535, 0, 0)) - error = True - else: - self.txtUsername.modify_base( gtk.STATE_NORMAL, gtk.gdk.Color(0xFFFF, 0xFFFF, 0xFFFF)) - if self.name.get_text() == "": - self.name.grab_focus() - self.name.modify_base( gtk.STATE_NORMAL, gtk.gdk.Color(65535, 0, 0)) - error = True - else: - self.name.modify_base( gtk.STATE_NORMAL, gtk.gdk.Color(0xFFFF, 0xFFFF, 0xFFFF)) - if error == False: - self.create_watch() - - def change_options(self, widget): - selected_type = self.type.get_active() - - #hide the previous table - if self.option_visible != -1: - if self.option_visible == 0: - self.tblWeb.hide() - elif self.option_visible == 1: - self.tblMail.hide() - elif self.option_visible == 2: - self.tblFile.hide() - elif self.option_visible == 3: - pass - - if selected_type == 0: #website - self.tblWeb.show() - - if selected_type == 1: #email - self.tblMail.show() - - if selected_type == 2: #add a file - self.tblFile.show() - - self.option_visible = selected_type - - - def create_watch(self): - """ - Add the watch to the watches repository - """ - values = {} - #get the standard options from a watch - values['name'] = self.name.get_text()#FIXME: cfgparse cannot have single quotes (') it seems. We must watch out for the watch name or arguments not to have them. - - #check if the watch is unique - if not self.specto.check_unique_watch(values['name']): - unique_dialog = Unique_Dialog() - result = unique_dialog.run() - - if result ==1: - self.name.grab_focus() - else: #edit the existing watch - self.add_watch.hide_all() - name = values['name'] - self.specto.show_edit_watch(-1, name) - - else: - self.add_watch.hide_all()#FIXME: this is just an illusion to make the user believe that it was done instantaneously, instead of waiting for (sometimes slow) ressources to destroy the window. Note that I used hide_all instead of hide, otherwise the window refuses to hide itself and its contents. - values['type'] = self.type.get_active() - values['refresh_value'] = self.refresh.get_value_as_int() - values['refresh_unit'] = self.refresh_unit.get_active() - - #get the watch dependant options - watch_options = {} - - if values['type'] == 0: #add a website - values['url'] = self.txtUrl.get_text() - if values['url'][0:7] != "http://": - values['url'] = "http://" + values['url'] - - values['error_margin'] = (self.adjustment.get_value() / 100) - - elif values['type'] == 1: #add an email - #check if the watch uses pop3, imap or gmail - if self.chkPop3.get_active() == True: - prot = 0 - values.update({'host': self.txtHost.get_text()}) - elif self.chkImap.get_active() == True: - prot = 1 - values.update({'host': self.txtHost.get_text()}) - else: - prot = 2 - - values.update( - { - 'username': self.txtUsername.get_text(), - 'password': self.txtPassword.get_text(), - 'prot': prot - } - ) - elif values['type'] == 2: #add a file - values['file'] = self.btnFile.get_filename() - if self.chkFile.get_active() == True: - values['mode'] = "file" - else: - values['mode'] = "folder" - - self.add_watch.destroy() - self.specto.add_watch(values) #write the options in the configuration file - #"del self" would be useful here I think. - - def set_refresh_values(self, widget): - digits = 0 - climb_rate = 1.0 - refresh_unit = self.refresh_unit.get_active() - if refresh_unit == 0 or refresh_unit == 1: - adjustment = gtk.Adjustment(value=1, lower=1, upper=60, step_incr=1, page_incr=10, page_size=0) - if refresh_unit == 2: - adjustment = gtk.Adjustment(value=1, lower=1, upper=24, step_incr=1, page_incr=10, page_size=0) - if refresh_unit == 3: - adjustment = gtk.Adjustment(value=1, lower=1, upper=365, step_incr=1, page_incr=30, page_size=0) - - self.refresh.configure(adjustment, climb_rate, digits) - - def help_clicked(self,widget):#this is special, it points directly to a specific help page - self.specto.util.show_webpage("http://specto.ecchi.ca/Manual/AddingWatches") - - def delete_event(self, widget, event, data=None): - # return False to destroy the main window - # return True to stop destroying the main window - self.add_watch.destroy() - return True class Unique_Dialog: """ ! This class is used to show a dialog """ def __init__(self): self.gladefile= '%s/share/specto/glade/add_watch.glade' % sys.prefix self.dialogname = "dialog" ! def run(self): self.wTree=gtk.glade.XML(self.gladefile, self.dialogname) self.unique_dialog=self.wTree.get_widget("dialog") --- 401,417 ---- vbox.pack_start(self.tblMail, False, False, 0) vbox.pack_start(self.tblFile, False, False, 0) class Unique_Dialog: """ ! Class to create a save as dialog. """ + def __init__(self): self.gladefile= '%s/share/specto/glade/add_watch.glade' % sys.prefix self.dialogname = "dialog" ! def run(self): ! """ Show the save as dialog. """ self.wTree=gtk.glade.XML(self.gladefile, self.dialogname) self.unique_dialog=self.wTree.get_widget("dialog") Index: about.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/about.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** about.py 15 Oct 2006 13:22:56 -0000 1.4 --- about.py 17 Oct 2006 17:06:50 -0000 1.5 *************** *** 23,27 **** # Boston, MA 02111-1307, USA. ! import sys, os#, util import pygtk pygtk.require("2.0") --- 23,27 ---- # Boston, MA 02111-1307, USA. ! import sys import pygtk pygtk.require("2.0") *************** *** 29,36 **** class About: def __init__(self): - """ - Display credits and licensing information about Specto - """ #self.specto = specto version_file_path = ('%s/share/doc/specto/VERSION' % sys.prefix) --- 29,37 ---- class About: + """ + Class to create a window with the credits and licensing information about Specto. + """ + def __init__(self): #self.specto = specto version_file_path = ('%s/share/doc/specto/VERSION' % sys.prefix) Index: watch.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/watch.py,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** watch.py 15 Oct 2006 19:04:37 -0000 1.45 --- watch.py 17 Oct 2006 17:06:50 -0000 1.46 *************** *** 28,66 **** import gobject import gnome from specto.specto_gconf import GConfClient from specto.iniparser import ini_namespace from ConfigParser import ConfigParser ! class watch: """ ! The watch_ base. All the base functions are written here. """ def __init__(self, specto): - """ - init - """ self.refresh = int(5000) self.name = "default" - self.specto = specto ! gnome.sound_init('localhost') ! ! def __repr__(self): ! return "Watcher of class %s," % self.__class__ ! def update(self): """ ! It is here that we check for any change prior to calling an event. """ ! self.conf = GConfClient("/apps/specto/preferences") ! if self.error == True and self.conf.get_entry("/use_problem_sound", "boolean"): ! problem_sound = self.conf.get_entry("/problem_sound", "string") gnome.sound_play(problem_sound) ! ! #update() is located in the subclass if self.updated == True: ! self.notify()#This function is right below. I don't think we need to move it upwards to main.py, but I'm not sure, so if you think it needs to be managed by the main module, change this. It might be tough passing data to do accurate notifications though. -Jeff ! self.specto.toggle_updated(self.id) self.timer_id = gobject.timeout_add(self.refresh, self.update) --- 28,62 ---- import gobject import gnome + + #specto imports from specto.specto_gconf import GConfClient from specto.iniparser import ini_namespace from ConfigParser import ConfigParser ! class Watch: """ ! The watch superclass. All the base functions are written here. """ def __init__(self, specto): self.refresh = int(5000) self.name = "default" self.specto = specto ! self.timer_id = -1 gnome.sound_init('localhost') ! def update(self): """ ! Check if an error sound has to be played or if a watch has to be flagged updated. """ ! #play error sound ! conf = GConfClient("/apps/specto/preferences") ! if self.error == True and conf.get_entry("/use_problem_sound", "boolean"): ! problem_sound = conf.get_entry("/problem_sound", "string") gnome.sound_play(problem_sound) ! ! #call update function if watch was updated if self.updated == True: ! self.notify() ! self.specto.toggle_updated(self.id) #call the main function to update the notifier entrie self.timer_id = gobject.timeout_add(self.refresh, self.update) *************** *** 73,91 **** #determine if libnotify and/or sound support is to be used ! self.conf = GConfClient("/apps/specto/preferences") ! self.pop_toast = self.conf.get_entry("/pop_toast", "boolean") #play a sound ! update_sound = self.conf.get_entry("/update_sound", "string") ! if self.conf.get_entry("/use_update_sound", "boolean"): gnome.sound_play(update_sound) - #this is the libnotify support. Currently, the user must have libnotify-bin installed. Install that package if you don't have it. if (self.pop_toast == True) and (self.specto.GTK): from specto.balloons import NotificationToast ! if self.type==0:#web ! NotificationToast(self.specto, "The website, <b>"+str(self.name)+"</b>, has been updated.", "/usr/share/specto/icons/notifier/big/web.png") elif self.type==1:#email notification_toast = "Your email account, <b>"+str(self.name) --- 69,86 ---- #determine if libnotify and/or sound support is to be used ! conf = GConfClient("/apps/specto/preferences") ! pop_toast = conf.get_entry("/pop_toast", "boolean") #play a sound ! update_sound = conf.get_entry("/update_sound", "string") ! if conf.get_entry("/use_update_sound", "boolean"): gnome.sound_play(update_sound) #this is the libnotify support. Currently, the user must have libnotify-bin installed. Install that package if you don't have it. if (self.pop_toast == True) and (self.specto.GTK): from specto.balloons import NotificationToast ! if self.type==0:#web ! NotificationToast(self.specto, "The website, <b>"+str(self.name)+"</b>, has been updated.", "%s/share/specto/icons/notifier/big/web.png" % sys.prefix) elif self.type==1:#email notification_toast = "Your email account, <b>"+str(self.name) *************** *** 110,167 **** if notification_toast: ! NotificationToast(self.specto, notification_toast, "/usr/share/specto/icons/notifier/big/mail.png") elif self.type==2:#folder ! NotificationToast(self.specto, "The file/folder, <b>"+str(self.name)+"</b>, has been updated.", "/usr/share/specto/icons/notifier/big/folder.png") else: self.specto.logger.log("Not implemented yet", "warning", self.__class__)#TODO: implement other notifications #end of the libnotify madness ! def on_pressed(self): ! pass def set_name(self, name): ! """ ! set the name for the watch ! """ self.name = name def get_name(self): ! """ ! return the name ! """ return self.name - def set_type(self, type): - """ - set the type from the watch - """ - self.type = type - def get_type(self): ! """ ! return the type ! """ return self.type def set_refresh(self, refresh): ! """ ! set the refresh value ! """ self.refresh = refresh ! ! def stop_watch(self): ! gobject.source_remove(self.timer_id) class Watch_io: """ A class for managing watches. - You can read the configuration file, write to the configuration file - and start a watch. """ def __init__(self): #read the watch from ~/.specto/watches.list using the iniparser module self.file_name = os.environ['HOME'] + "/.specto/" + "watches.list" - if not os.path.exists(self.file_name): f = open(self.file_name, "w") --- 105,145 ---- if notification_toast: ! NotificationToast(self.specto, notification_toast, "%s/share/specto/icons/notifier/big/mail.png" % sys.prefix) elif self.type==2:#folder ! NotificationToast(self.specto, "The file/folder, <b>"+str(self.name)+"</b>, has been updated.", "%s/share/specto/icons/notifier/big/folder.png" % sys.prefix) else: self.specto.logger.log("Not implemented yet", "warning", self.__class__)#TODO: implement other notifications #end of the libnotify madness ! def stop_watch(self): ! """ Stop the watch. """ ! gobject.source_remove(self.timer_id) def set_name(self, name): ! """ Set the name. """ self.name = name def get_name(self): ! """ Return the name. """ return self.name def get_type(self): ! """ Return the type. """ return self.type def set_refresh(self, refresh): ! """ Set the refresh value. """ self.refresh = refresh ! class Watch_io: """ A class for managing watches. """ + def __init__(self): #read the watch from ~/.specto/watches.list using the iniparser module self.file_name = os.environ['HOME'] + "/.specto/" + "watches.list" if not os.path.exists(self.file_name): f = open(self.file_name, "w") *************** *** 172,176 **** def read_options(self): """ ! read the watch options from the config file ( ~/.specto/watches.list ), and return a dictionary containing the info needed to start the watches. """ --- 150,154 ---- def read_options(self): """ ! Read the watch options from the config file ( ~/.specto/watches.list ), and return a dictionary containing the info needed to start the watches. """ *************** *** 238,247 **** def read_option(self, name, option): ! """ ! read an option from a watch ! """ try: ! self.read_option_value = self.cfg[name][option] ! return self.read_option_value except: return 0 --- 216,222 ---- def read_option(self, name, option): ! """ Read one option from a watch. """ try: ! return self.cfg[name][option] except: return 0 *************** *** 249,255 **** def write_options(self, values): """ ! write or change the watch options in a configuration file ! values has to be a dictionary with the name from the options and the value. example: { 'name':'value', 'name':'value' } ! if the name is not found, a new watch will be added, else the excisting watch will be changed """ self.cfg = ini_namespace(file(self.file_name)) --- 224,230 ---- def write_options(self, values): """ ! Write or change the watch options in a configuration file. ! Values has to be a dictionary with the name from the options and the value. example: { 'name':'value', 'name':'value' } ! If the name is not found, a new watch will be added, else the excisting watch will be changed. """ self.cfg = ini_namespace(file(self.file_name)) *************** *** 268,274 **** def remove_watch(self, name): ! """ ! remove a watch from the configuration file ! """ cfgpr = ConfigParser() cfgpr.read(self.file_name) --- 243,247 ---- def remove_watch(self, name): ! """ Remove a watch from the configuration file. """ cfgpr = ConfigParser() cfgpr.read(self.file_name) *************** *** 280,284 **** def search_watch(self, name): """ ! returns True if the watch is in watches.list """ self.cfg = ini_namespace(file(self.file_name)) --- 253,257 ---- def search_watch(self, name): """ ! Returns True if the watch is found in ~/.specto/watches.list. """ self.cfg = ini_namespace(file(self.file_name)) *************** *** 289,292 **** --- 262,266 ---- def replace_name(self, orig, new): + """ Replace a watch name (rename) """ #read the file f = open(self.file_name, "r") Index: trayicon.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/trayicon.py,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** trayicon.py 13 Oct 2006 13:09:15 -0000 1.37 --- trayicon.py 17 Oct 2006 17:06:50 -0000 1.38 *************** *** 24,42 **** import egg.trayicon - import traypopup - #import pygtk - #pygtk.require("2.0") import gtk - import sys - import os - import specto.util ! ICON_PATH = "/usr/share/specto/icons/specto_tray_1.png" ! ICON2_PATH = "/usr/share/specto/icons/specto_tray_2.png" class Tray: """ ! Just displays a tray icon in the notification area and allows interaction with it. """ def __init__(self, specto): # Create the tray icon object --- 24,39 ---- import egg.trayicon import gtk ! import specto.traypopup ! ! ICON_PATH = "/usr/share/specto/icons/specto_tray_1.png" ! ICON2_PATH = "/usr/share/specto/icons/specto_tray_2.png" class Tray: """ ! Display a tray icon in the notification area. """ + def __init__(self, specto): # Create the tray icon object *************** *** 47,51 **** self.eventbox.connect("button_press_event", self.tray_icon_clicked) self.eventbox.connect("destroy", self.specto.recreate_tray) ! # Create the tooltip for the tray icon self.tooltip = gtk.Tooltips() --- 44,48 ---- self.eventbox.connect("button_press_event", self.tray_icon_clicked) self.eventbox.connect("destroy", self.specto.recreate_tray) ! # Create the tooltip for the tray icon self.tooltip = gtk.Tooltips() *************** *** 60,77 **** self.tray.show_all() self.show_tooltip({0:0,1:0,2:0}) ! self.init=1 ! while gtk.events_pending(): gtk.main_iteration(True) def set_icon_state_excited(self): pixbuf = gtk.gdk.pixbuf_new_from_file( ICON2_PATH ) self.imageicon.set_from_pixbuf(pixbuf) def set_icon_state_normal(self): pixbuf = gtk.gdk.pixbuf_new_from_file( ICON_PATH ) self.imageicon.set_from_pixbuf(pixbuf) def tray_icon_clicked(self,signal,event): if event.button == 3: if self.specto.notifier.get_state() == True: --- 57,78 ---- self.tray.show_all() self.show_tooltip({0:0,1:0,2:0}) ! while gtk.events_pending(): gtk.main_iteration(True) def set_icon_state_excited(self): + """ Change the tray icon to updated. """ pixbuf = gtk.gdk.pixbuf_new_from_file( ICON2_PATH ) self.imageicon.set_from_pixbuf(pixbuf) def set_icon_state_normal(self): + """ Change the tray icon to not updated. """ pixbuf = gtk.gdk.pixbuf_new_from_file( ICON_PATH ) self.imageicon.set_from_pixbuf(pixbuf) def tray_icon_clicked(self,signal,event): + """ + Create the popupmenu or call show_notifier to hide/show the notifier. + """ if event.button == 3: if self.specto.notifier.get_state() == True: *************** *** 79,88 **** else: text = "Show window" ! self.popup = traypopup.TrayPopupMenu(self, text) ! self.popup.show_menu(event) elif event.button == 1: self.show_notifier(event) def show_tooltip(self, updated_messages): show_return = False --- 80,91 ---- else: text = "Show window" ! popup = specto.traypopup.TrayPopupMenu(self, text) ! popup.show_menu(event) ! elif event.button == 1: self.show_notifier(event) def show_tooltip(self, updated_messages): + """ Create the tooltip message and show the tooltip. """ show_return = False *************** *** 91,94 **** --- 94,98 ---- else: message = 'Updated watches:\n' + #website tooltip if updated_messages[0] > 0: if updated_messages[0] == 1: *************** *** 98,102 **** message = message + "\t" + str(updated_messages[0]) + type show_return = True ! if updated_messages[1] > 0: if updated_messages[1] == 1: --- 102,106 ---- message = message + "\t" + str(updated_messages[0]) + type show_return = True ! #mail tooltip if updated_messages[1] > 0: if updated_messages[1] == 1: *************** *** 104,114 **** else: type = " mails" - if show_return: message = message + "\n" - message = message + "\t" + str(updated_messages[1]) + type show_return = True ! if updated_messages[2] > 0: if updated_messages[2] == 1: --- 108,116 ---- else: type = " mails" if show_return: message = message + "\n" message = message + "\t" + str(updated_messages[1]) + type show_return = True ! #file tooltip if updated_messages[2] > 0: if updated_messages[2] == 1: *************** *** 116,138 **** else: type = " files/folders" - if show_return: message = message + "\n" - message = message + "\t" + str(updated_messages[2]) + type self.tooltip.set_tip(self.tray,message) ! def show_preferences(self, *args): self.specto.show_preferences() ! def show_help(self, *args): self.specto.show_help() ! def show_about(self, *args): self.specto.show_about() ! def show_notifier(self, *args): self.specto.toggle_notifier() ! def quit(self, *args): self.specto.quit() --- 118,143 ---- else: type = " files/folders" if show_return: message = message + "\n" message = message + "\t" + str(updated_messages[2]) + type self.tooltip.set_tip(self.tray,message) ! def show_preferences(self, widget): ! """ Call the main function to show the preferences window. """ self.specto.show_preferences() ! def show_help(self, widget): ! """ Call the main function to show help. """ self.specto.show_help() ! def show_about(self, widget): ! """ Call the main function to show the about window. """ self.specto.show_about() ! def show_notifier(self, widget): ! """ Call the main function to show the notifier window. """ self.specto.toggle_notifier() ! def quit(self, widget): ! """ Call the main function to quit specto. """ self.specto.quit() Index: notifier.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/notifier.py,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** notifier.py 13 Oct 2006 13:09:15 -0000 1.62 --- notifier.py 17 Oct 2006 17:06:50 -0000 1.63 *************** *** 36,46 **** import gtk import gtk.glade ! import gobject, pango except: pass class Notifier: def __init__(self, specto): """ ! In this init we are going to display the main notifier window """ [...989 lines suppressed...] gtk.main() --- 823,840 ---- def sort_column_active(self, widget): + """ Call the sort_active function and set the sort_active menu item to active. """ self.wTree.get_widget("by_watch_active").set_active(True) self.sort_active() def sort_active(self, *args): + """ Sort by active watches. """ self.model.set_sort_column_id(0, not self.get_gconf_sort_order()) self.specto.conf_ui.set_entry("/sort_function", "active", "string") self.specto.conf_ui.set_entry("/sort_order", self.set_gconf_sort_order(self.columnCheck.get_sort_order()) ,"string") if __name__ == "__main__": #run the gui ! app=Notifier() gtk.main() |
|
From: Jeff F. <kid...@us...> - 2006-10-15 19:04:42
|
Update of /cvsroot/specto/specto/src/specto In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv19840/src/specto Modified Files: watch.py Added Files: balloons.py Log Message: Thanks to Giulio, we now have proper libnotify support. Note that this will break compatibility with ubuntu dapper users in a sense that you need the python-notify package installed for libnotify to work. This is available in ubuntu edgy eft. --- NEW FILE: balloons.py --- #!/usr/bin/env python # -*- coding: UTF8 -*- # Specto , Unobtrusive event notifier # # balloons.py # # Copyright (c) 2005, Jean-François Fortin Tam ~<nekohayo a gmail.com>~ # This module code is maintained by : Giulio Lotti # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public # License along with this program; if not, write to the # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. import pygtk pygtk.require('2.0') import pynotify import sys from specto import logger notifyInitialized = False class NotificationToast: _notifyRealm = 'Specto' _Urgencies = { 'low': pynotify.URGENCY_LOW, 'critical': pynotify.URGENCY_CRITICAL, 'normal': pynotify.URGENCY_NORMAL } # I'd love to have a default icon. def __init__(self, specto, body, icon=None, timeout=2000, urgency="low", summary=_notifyRealm): global notifyInitialized if not notifyInitialized: pynotify.init(self._notifyRealm) notifyInitialized = True self.toast = pynotify.Notification(summary, body) self.toast.set_timeout(timeout) self.toast.set_urgency(self._Urgencies[urgency]) if icon: self.toast.set_property('icon-name', icon) if not self.toast.show(): specto.logger.log("Can't send Notification message. Check your DBUS!", "error", self.__class__) Index: watch.py =================================================================== RCS file: /cvsroot/specto/specto/src/specto/watch.py,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** watch.py 27 Sep 2006 16:09:06 -0000 1.44 --- watch.py 15 Oct 2006 19:04:37 -0000 1.45 *************** *** 84,105 **** #this is the libnotify support. Currently, the user must have libnotify-bin installed. Install that package if you don't have it. if (self.pop_toast == True) and (self.specto.GTK): ! notification_toast = "notify-send -u low -i " if self.type==0:#web ! notification_toast_icon = "/usr/share/specto/icons/notifier/big/web.png" ! notification_toast += notification_toast_icon ! notification_toast += " 'Specto' 'The website, <b>" ! notification_toast += str(self.name) ! notification_toast += "</b>, has been updated.' " ! os.system(notification_toast) elif self.type==1:#email ! notification_toast_icon = "/usr/share/specto/icons/notifier/big/mail.png" ! notification_toast += notification_toast_icon ! notification_toast += " 'Specto' 'Your email account, <b>" ! notification_toast += str(self.name) if self.prot!=2:#other account than gmail ! notification_toast += "</b>, has new mail.' " ! os.system(notification_toast) ! elif self.prot==2:#gmail if (self.newMsg - self.oldMsg >1): --- 84,96 ---- #this is the libnotify support. Currently, the user must have libnotify-bin installed. Install that package if you don't have it. if (self.pop_toast == True) and (self.specto.GTK): ! from specto.balloons import NotificationToast ! if self.type==0:#web ! NotificationToast(self.specto, "The website, <b>"+str(self.name)+"</b>, has been updated.", "/usr/share/specto/icons/notifier/big/web.png") elif self.type==1:#email ! notification_toast = "Your email account, <b>"+str(self.name) if self.prot!=2:#other account than gmail ! notification_toast += "</b>, has new mail." elif self.prot==2:#gmail if (self.newMsg - self.oldMsg >1): *************** *** 110,132 **** notification_toast += ", totalling " notification_toast += str(self.newMsg) ! notification_toast += ".' " ! os.system(notification_toast) self.oldMsg = self.newMsg#store temporarily the number of old messages to prevent false alerts elif (self.newMsg - self.oldMsg == 1): ! notification_toast += "</b>, has new mail.' " ! os.system(notification_toast) self.oldMsg = self.newMsg#store temporarily the number of old messages to prevent false alerts else: ! pass #nothing to notify the user about. elif self.type==2:#folder ! notification_toast_icon = "/usr/share/specto/icons/notifier/big/folder.png" ! notification_toast += notification_toast_icon ! notification_toast += " 'Specto' 'The file/folder, <b>" ! notification_toast += str(self.name) ! notification_toast += "</b>, has been updated.' " ! os.system(notification_toast) else: self.specto.logger.log("Not implemented yet", "warning", self.__class__)#TODO: implement other notifications ! #end of the libnotify madness def on_pressed(self): --- 101,120 ---- notification_toast += ", totalling " notification_toast += str(self.newMsg) ! notification_toast += "." self.oldMsg = self.newMsg#store temporarily the number of old messages to prevent false alerts elif (self.newMsg - self.oldMsg == 1): ! notification_toast += "</b>, has new mail." self.oldMsg = self.newMsg#store temporarily the number of old messages to prevent false alerts else: ! notification_toast = None#nothing to notify the user about. ! ! if notification_toast: ! NotificationToast(self.specto, notification_toast, "/usr/share/specto/icons/notifier/big/mail.png") ! elif self.type==2:#folder ! NotificationToast(self.specto, "The file/folder, <b>"+str(self.name)+"</b>, has been updated.", "/usr/share/specto/icons/notifier/big/folder.png") else: self.specto.logger.log("Not implemented yet", "warning", self.__class__)#TODO: implement other notifications ! #end of the libnotify madness def on_pressed(self): |
|
From: Jeff F. <kid...@us...> - 2006-10-15 19:04:42
|
Update of /cvsroot/specto/specto In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv19840 Modified Files: ChangeLog Log Message: Thanks to Giulio, we now have proper libnotify support. Note that this will break compatibility with ubuntu dapper users in a sense that you need the python-notify package installed for libnotify to work. This is available in ubuntu edgy eft. Index: ChangeLog =================================================================== RCS file: /cvsroot/specto/specto/ChangeLog,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ChangeLog 27 Sep 2006 16:10:36 -0000 1.15 --- ChangeLog 15 Oct 2006 19:04:37 -0000 1.16 *************** *** 1,2 **** --- 1,6 ---- + 2006-10-15 Giulio Lotti + * proper libnotify support. The dependency on libnotify-bin is now deprecated for a dependency on + python-notify + 2006-09-27 Wout Clymans * (bug #60261) mime is used when you open a file watch |