|
From: Stas Z. <sta...@us...> - 2005-10-02 21:39:22
|
Update of /cvsroot/gmailagent/GA-main In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1530 Modified Files: AboutDialog_forms.py AddressDialog1_forms.py CHANGELOG GmailAgent.e3p GuiQT.py HelpDialog_forms.py LoginDialog_forms.py MainWin_forms.py version.py Log Message: Minor updates Index: version.py =================================================================== RCS file: /cvsroot/gmailagent/GA-main/version.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** version.py 2 Oct 2005 09:44:40 -0000 1.11 --- version.py 2 Oct 2005 14:33:26 -0000 1.12 *************** *** 3,7 **** # it to get a version number ! VERSION = "0.7.1" #last changed on Okt 01 --sz-- --- 3,7 ---- # it to get a version number ! VERSION = "0.7.2" #last changed on Okt 01 --sz-- Index: CHANGELOG =================================================================== RCS file: /cvsroot/gmailagent/GA-main/CHANGELOG,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CHANGELOG 2 Oct 2005 09:44:40 -0000 1.1 --- CHANGELOG 2 Oct 2005 14:33:26 -0000 1.2 *************** *** 1,2 **** --- 1,5 ---- + GmailAgent (0.7.2) + * Prevent double logins into Gmail. + GmailAgent (0.7.1) * Made the whole GUI resizeable. Index: GmailAgent.e3p =================================================================== RCS file: /cvsroot/gmailagent/GA-main/GmailAgent.e3p,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** GmailAgent.e3p 2 Oct 2005 09:44:40 -0000 1.16 --- GmailAgent.e3p 2 Oct 2005 14:33:26 -0000 1.17 *************** *** 2,6 **** <!DOCTYPE Project SYSTEM "Project-3.5.dtd"> <!-- Project file for project GmailAgent --> ! <!-- Saved: 2005-10-02, 11:31:14 --> <!-- Copyright (C) 2005 Stas Zytkiewicz, st...@li... --> <Project version="3.5"> --- 2,6 ---- <!DOCTYPE Project SYSTEM "Project-3.5.dtd"> <!-- Project file for project GmailAgent --> ! <!-- Saved: 2005-10-02, 12:27:58 --> <!-- Copyright (C) 2005 Stas Zytkiewicz, st...@li... --> <Project version="3.5"> *************** *** 76,82 **** <Others> <Other> - <Name>Changelog</Name> - </Other> - <Other> <Name>INSTALL</Name> </Other> --- 76,79 ---- *************** *** 87,90 **** --- 84,90 ---- <Name>TODO</Name> </Other> + <Other> + <Name>CHANGELOG</Name> + </Other> </Others> <MainScript> Index: AboutDialog_forms.py =================================================================== RCS file: /cvsroot/gmailagent/GA-main/AboutDialog_forms.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** AboutDialog_forms.py 2 Oct 2005 09:24:54 -0000 1.26 --- AboutDialog_forms.py 2 Oct 2005 14:33:26 -0000 1.27 *************** *** 3,7 **** # Form implementation generated from reading ui file 'AboutDialog.ui' # ! # Created: Sun Oct 2 11:20:56 2005 # by: The PyQt User Interface Compiler (pyuic) 3.14.1 # --- 3,7 ---- # Form implementation generated from reading ui file 'AboutDialog.ui' # ! # Created: Sun Oct 2 11:49:36 2005 # by: The PyQt User Interface Compiler (pyuic) 3.14.1 # Index: GuiQT.py =================================================================== RCS file: /cvsroot/gmailagent/GA-main/GuiQT.py,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** GuiQT.py 2 Oct 2005 09:24:54 -0000 1.39 --- GuiQT.py 2 Oct 2005 14:33:26 -0000 1.40 *************** *** 42,46 **** --- 42,49 ---- helppath = paths.helppath if GQ_DEBUG: logging.debug("helppath is %s" % helppath) + RCFILE = os.path.expanduser('~/.gmailagent') + # This will hold a reference to a logged in GmailAccount globally. + GA_LOGIN = None # TODO Add a addrfile path to the RCFILE? *************** *** 62,71 **** """Classic observer to monitor changes in some model TODO: replace this with the Observer from the gcm.""" ! def __init__(self,func): if GQ_DEBUG: logging.debug("\n>>>>>>>> Class: %s" % self.__class__.__name__) self.func = func def update(self,*args): if GQ_DEBUG: logging.debug("Observer calls %s with %s" % (self.func,args)) ! apply(self.func,args) class NotYet: --- 65,77 ---- """Classic observer to monitor changes in some model TODO: replace this with the Observer from the gcm.""" ! def __init__(self,func,*args): if GQ_DEBUG: logging.debug("\n>>>>>>>> Class: %s" % self.__class__.__name__) self.func = func + self.args = args def update(self,*args): + if args: + self.args = args if GQ_DEBUG: logging.debug("Observer calls %s with %s" % (self.func,args)) ! apply(self.func,self.args) class NotYet: *************** *** 94,103 **** if GQ_DEBUG: logging.debug("\n>>>>>>>> Class: %s" % self.__class__.__name__) Form1.__init__(self,parent,name,fl) ! global Qapplication Qapplication = application self.mailheader = {'to':'','subject':'','cc':'','bc':''} self.mailbody = '' self.attachments = att ! self.ga = None self.login = {'login':'','passwrd':''} if self.attachments: --- 100,109 ---- if GQ_DEBUG: logging.debug("\n>>>>>>>> Class: %s" % self.__class__.__name__) Form1.__init__(self,parent,name,fl) ! global Qapplication,GA_LOGIN Qapplication = application self.mailheader = {'to':'','subject':'','cc':'','bc':''} self.mailbody = '' self.attachments = att ! #self.ga = None self.login = {'login':'','passwrd':''} if self.attachments: *************** *** 137,142 **** self.attachments = filter(os.path.exists,txt.split('\n')) self.mailbody = str(self.textEditMesg.text()) ! obs = Observer(self.send_message) ! login = Login(parent=self,observer=obs)# this will login and call send_message def send_message(self,ga): --- 143,151 ---- self.attachments = filter(os.path.exists,txt.split('\n')) self.mailbody = str(self.textEditMesg.text()) ! if not GA_LOGIN: ! obs = Observer(self.send_message) ! login = Login(parent=self,observer=obs)# this will login and call send_message ! else: ! self.send_message(GA_LOGIN) def send_message(self,ga): *************** *** 150,156 **** obj.attachments = self.attachments obj.mailbody = self.mailbody ! #obj.login = self.login# not used, yet? ! obj.ga = ga#gmail account object ! self.ga = ga result = Gmail.send_message(obj) if result[0]: --- 159,164 ---- obj.attachments = self.attachments obj.mailbody = self.mailbody ! obj.ga = ga ! result = Gmail.send_message(obj) if result[0]: *************** *** 179,182 **** --- 187,191 ---- # lineEditTo.setCurrentText will called when the model calls the update method of the obs #The 'To:' field is filled by the AddressBookDialog through the observer + global GA_LOGIN if not Gmail.USE_CONTACTS: text = "You don't have the Gmail Contacts manager installed.\n"+\ *************** *** 187,191 **** return # we have gcm so now we can use it here and in the AddressBookDialog ! if not self.ga: txt = "Do you want to import your contacts from your Gmail\n"+\ "account?\n"+\ --- 196,200 ---- return # we have gcm so now we can use it here and in the AddressBookDialog ! if not GA_LOGIN: txt = "Do you want to import your contacts from your Gmail\n"+\ "account?\n"+\ *************** *** 201,211 **** self._get_local_contacts() else: ! self._get_contacts(self.ga) def _get_contacts(self,ga): """Callback for the observer from the pushButtonAdress_clicked""" ! self.ga = ga# we also set the login object which is used to test if we logged in self.obs = Observer(self.lineEditTo.setText) ! AddressBookDialog(self,gac=ga,observer=self.obs) def _get_local_contacts(self): """get the contacts from the local dbase, if available""" --- 210,221 ---- self._get_local_contacts() else: ! self._get_contacts(GA_LOGIN) def _get_contacts(self,ga): """Callback for the observer from the pushButtonAdress_clicked""" ! global GA_LOGIN ! GA_LOGIN = ga self.obs = Observer(self.lineEditTo.setText) ! AddressBookDialog(self,observer=self.obs) def _get_local_contacts(self): """get the contacts from the local dbase, if available""" *************** *** 223,226 **** --- 233,237 ---- if GQ_DEBUG: logging.debug("\n>>>>>>>> Class: %s" % self.__class__.__name__) FormLogin.__init__(self,parent,name,modal,fl) + global GA_LOGIN self.parent = parent self.obs = observer# the update method is called after a succesfull login *************** *** 256,259 **** --- 267,271 ---- # int is 0 or 1; 0 is succes, 1 is faillure # ga is the Gmail account object + global GA_LOGIN self.progress_dlg = ProgressDialog(self,"Log into Gmail",2) result = Gmail.login(log,pas) *************** *** 265,274 **** QMessageBox.Ok) else: if self.obs: self.obs.update(result[2]) - #if GQ_DEBUG: logging.debug("Uploading new contacts, if any") - #self.progress_dlg.set_label("Uploading new contacts, if any") - #Gmail.upload_local_contacts(addrfile,result[2]) - self.progress_dlg.update() if self.keepsettings: result = Gmail.store_login(log,pas) --- 277,284 ---- QMessageBox.Ok) else: + GA_LOGIN = result[2] + self.progress_dlg.update() if self.obs: self.obs.update(result[2]) if self.keepsettings: result = Gmail.store_login(log,pas) *************** *** 318,333 **** class AddressBookDialog(FormAddress1): ! def __init__(self,parent=None,name=None,modal=0,fl=0,gac='',observer=None): if GQ_DEBUG: logging.debug("\n>>>>>>>> Class: %s" % self.__class__.__name__) FormAddress1.__init__(self,parent,name,modal,fl) self.parent = parent self.selecteditem = None self.parent_observer = observer self.progress_dlg = None - self.ga = gac self.gcm = None # The mainwin checks for availablility gcm ! if self.ga: ! self.GC = Gmail.Contrgcm.GC(self.ga.name,'',self.ga) conlist = self.GC.import_contacts_gmail() else: --- 328,343 ---- class AddressBookDialog(FormAddress1): ! def __init__(self,parent=None,name=None,modal=0,fl=0,observer=None): if GQ_DEBUG: logging.debug("\n>>>>>>>> Class: %s" % self.__class__.__name__) FormAddress1.__init__(self,parent,name,modal,fl) + global GA_LOGIN self.parent = parent self.selecteditem = None self.parent_observer = observer self.progress_dlg = None self.gcm = None # The mainwin checks for availablility gcm ! if GA_LOGIN: ! self.GC = Gmail.Contrgcm.GC(GA_LOGIN.name,'',GA_LOGIN) conlist = self.GC.import_contacts_gmail() else: *************** *** 409,429 **** break - ## def pushButtonImport_clicked(self): - ## print "FormAddressEditor.pushButtonImport_clicked()" - ## # The observer is passed to Login, after succes Login will call the observers - ## # _login_success method - ## obs = Observer(self._login_success) - ## # this looks like a hack but Login is used by other objects also. - ## Login(parent=self.parent,observer=obs) - - ## def _login_success(self,ga): - ## """This is the method which is called through the observer by the Login.""" - ## # ga is the Gmail account after a succseful login - ## self.ga = ga - ## # Get the contacts and merge them with the local copy - ## # The new local copy will be saved on disk and returnt to the caller. - ## Gmail.import_contacts(addrfile,self.ga) - ## self._load(addrfile) - def _load( self, lines): """Loads a local address file into the widget.""" --- 419,422 ---- Index: MainWin_forms.py =================================================================== RCS file: /cvsroot/gmailagent/GA-main/MainWin_forms.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** MainWin_forms.py 2 Oct 2005 09:24:54 -0000 1.29 --- MainWin_forms.py 2 Oct 2005 14:33:26 -0000 1.30 *************** *** 3,7 **** # Form implementation generated from reading ui file 'MainWin.ui' # ! # Created: Sun Oct 2 11:20:56 2005 # by: The PyQt User Interface Compiler (pyuic) 3.14.1 # --- 3,7 ---- # Form implementation generated from reading ui file 'MainWin.ui' # ! # Created: Sun Oct 2 11:49:36 2005 # by: The PyQt User Interface Compiler (pyuic) 3.14.1 # Index: HelpDialog_forms.py =================================================================== RCS file: /cvsroot/gmailagent/GA-main/HelpDialog_forms.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** HelpDialog_forms.py 2 Oct 2005 09:24:54 -0000 1.15 --- HelpDialog_forms.py 2 Oct 2005 14:33:26 -0000 1.16 *************** *** 3,7 **** # Form implementation generated from reading ui file 'HelpDialog.ui' # ! # Created: Sun Oct 2 11:20:56 2005 # by: The PyQt User Interface Compiler (pyuic) 3.14.1 # --- 3,7 ---- # Form implementation generated from reading ui file 'HelpDialog.ui' # ! # Created: Sun Oct 2 11:49:36 2005 # by: The PyQt User Interface Compiler (pyuic) 3.14.1 # Index: LoginDialog_forms.py =================================================================== RCS file: /cvsroot/gmailagent/GA-main/LoginDialog_forms.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** LoginDialog_forms.py 2 Oct 2005 09:24:54 -0000 1.29 --- LoginDialog_forms.py 2 Oct 2005 14:33:26 -0000 1.30 *************** *** 3,7 **** # Form implementation generated from reading ui file 'LoginDialog.ui' # ! # Created: Sun Oct 2 11:20:56 2005 # by: The PyQt User Interface Compiler (pyuic) 3.14.1 # --- 3,7 ---- # Form implementation generated from reading ui file 'LoginDialog.ui' # ! # Created: Sun Oct 2 11:49:36 2005 # by: The PyQt User Interface Compiler (pyuic) 3.14.1 # Index: AddressDialog1_forms.py =================================================================== RCS file: /cvsroot/gmailagent/GA-main/AddressDialog1_forms.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AddressDialog1_forms.py 2 Oct 2005 09:28:46 -0000 1.1 --- AddressDialog1_forms.py 2 Oct 2005 14:33:26 -0000 1.2 *************** *** 3,7 **** # Form implementation generated from reading ui file 'AddressDialog1.ui' # ! # Created: Sun Oct 2 11:20:56 2005 # by: The PyQt User Interface Compiler (pyuic) 3.14.1 # --- 3,7 ---- # Form implementation generated from reading ui file 'AddressDialog1.ui' # ! # Created: Sun Oct 2 11:49:36 2005 # by: The PyQt User Interface Compiler (pyuic) 3.14.1 # |