You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(5) |
Jun
(43) |
Jul
(2) |
Aug
(6) |
Sep
(13) |
Oct
(5) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Stas Z. <sta...@us...> - 2007-01-09 07:46:47
|
Update of /cvsroot/gmailagent/GA-Qgcm In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv4826 Modified Files: ModalPopupDialog.ui.h Added Files: INSTALL __init__.py Log Message: Added missing files --- NEW FILE: INSTALL --- To install GContactsAgent in the normal way: Unpack the tarball. Now make sure your inside the gca directory and type in a xterm ( as root), "python setup.py install" This will install and set up GContactsAgent. Make sure you have the programs mentioned below installed on your system. Dependencies: Python >= 2.3 Python-dev Python-qt3 (pyQT3) libgmail If you have problems with GContactsAgent or just want to talk to me :-) gma...@us... Index: ModalPopupDialog.ui.h =================================================================== RCS file: /cvsroot/gmailagent/GA-Qgcm/ModalPopupDialog.ui.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 Binary files /tmp/cvsLvuruC and /tmp/cvspWJIIn differ --- NEW FILE: __init__.py --- #Just to shutup the distutils installer :-) |
From: Stas Z. <sta...@us...> - 2005-10-02 23:17:59
|
Update of /cvsroot/gmailagent/GA-main In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12868 Added Files: AddressDialog1.ui AddressDialog1.ui.h AddressDialog1_forms.py Log Message: Added new designed gui forms --- NEW FILE: AddressDialog1.ui.h --- /**************************************************************************** ** ui.h extension file, included from the uic-generated form implementation. ** ** If you want to add, delete, or rename functions or slots, use ** Qt Designer to update this file, preserving your code. ** ** You should not define a constructor or destructor in this file. ** Instead, write your code in functions called init() and destroy(). ** These will automatically be called by the form's constructor and ** destructor. *****************************************************************************/ void FormAddress1::listViewBook_clicked( QListViewItem * ) { } void FormAddress1::listViewSend_clicked( QListViewItem * ) { } void FormAddress1::pushButton_remove_clicked() { } void FormAddress1::lineEditSearch_textChanged( const QString & ) { } void FormAddress1::pushButtonEdit_clicked() { } void FormAddress1::pushButtonOk_clicked() { } void FormAddress1::pushButtonCancel_clicked() { } void FormAddress1::pushButton_add_clicked() { } --- NEW FILE: AddressDialog1_forms.py --- # -*- coding: utf-8 -*- # 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 # # WARNING! All changes made in this file will be lost! from qt import * image0_data = \ "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d" \ "\x49\x48\x44\x52\x00\x00\x00\x18\x00\x00\x00\x18" \ "\x08\x06\x00\x00\x00\xe0\x77\x3d\xf8\x00\x00\x01" \ "\xcb\x49\x44\x41\x54\x48\x89\xe5\x95\x31\x4c\xdb" \ "\x40\x14\x86\x3f\x3f\x3b\x85\xb4\xb4\x42\x2a\x74" \ "\xc8\xd2\x31\x15\x53\xc5\x00\xec\xac\x0c\x5d\x2b" \ "\xd6\x8e\xac\x48\xb0\x75\x64\x61\xec\xd4\xa9\xaa" \ "\x18\xbb\x54\xb4\x42\x42\x88\x15\xa6\x22\x90\x10" \ "\x03\x6a\x87\x4a\x1d\xd2\x54\x90\x04\x4c\x62\x9f" \ "\xef\x3a\xf8\x42\xd5\x70\x36\xb6\xc8\xc6\x2f\x9d" \ "\x2c\xf9\xec\xff\x7b\xff\xdd\xf3\x19\xee\xa3\xbc" \ "\x32\x0f\x4b\x49\x73\x03\x8c\x00\x95\xb2\xa0\x22" \ "\xf2\x2c\xc0\x00\x4f\x2d\x68\xa8\x10\x01\xcc\xd2" \ "\xbb\xed\x3e\x64\xb2\x08\x24\x6b\x89\x3c\x3b\x37" \ "\x38\x98\x7b\x51\x63\x71\xed\x33\x40\x03\x78\x02" \ "\x3c\xc8\x83\xb8\x00\x06\xd0\x40\x32\x30\x62\x00" \ "\x5f\x3c\xe6\x5f\x3e\xe7\xd5\xdb\x4f\x85\x20\x83" \ "\x37\x05\x48\xbe\xec\x9f\x12\x29\x8d\x2f\x1e\x81" \ "\xff\x7f\x0d\xcd\x56\x88\x88\xd0\x8d\x14\x9b\xfb" \ "\xa7\x6c\xad\xbf\xa1\xdb\x39\x7b\x06\xb4\x81\xc8" \ "\x16\x98\x0f\x78\xff\xf5\x80\x4a\xe0\xa3\x12\xfd" \ "\x2f\x96\x31\x18\x63\x10\x11\x02\x5f\x50\x89\x26" \ "\x56\x09\x7b\x27\xbf\xf8\xb0\xbc\x00\xe0\x84\x38" \ "\xf7\x20\x8c\x14\x5a\x6b\xb4\xd6\xa8\x24\xbd\x02" \ "\x88\x08\xe2\x71\x0d\xae\x8e\x54\x98\xa9\xd7\x58" \ "\x58\xfd\x98\xb9\x5c\x81\x0b\xb0\xfb\xed\x07\x51" \ "\x37\x44\x7c\xe7\xf4\x0d\x69\xad\x99\x9a\x5f\xe4" \ "\x78\x67\xa3\x01\x4c\xd8\x24\x71\x26\xa0\x77\xd9" \ "\x22\x6c\x35\x0b\x99\x03\xfc\xfe\x7e\xc4\xf1\xce" \ "\x06\xc0\x34\x50\x05\x42\x40\x01\xa6\xec\x97\x9c" \ "\x67\x3e\x07\x5c\xd9\xa1\xb0\xfb\xe0\x4c\xa0\xe2" \ "\x88\xee\xc5\xb9\xd3\x70\x74\x6c\x3c\xcb\xbc\x0d" \ "\xfc\x01\x2e\x2c\x00\xc8\xe8\xa2\xbc\x8a\x67\x5f" \ "\xaf\x30\x3a\x36\xee\x32\x6f\xe2\xe8\x22\x57\x82" \ "\xc7\xa4\x1b\xf5\x88\x9b\x5d\x76\x98\x51\xb9\xd3" \ "\xdc\x05\xd0\x40\xcf\xbe\x70\x3e\x90\x50\x00\x3a" \ "\x8d\x9f\x85\xcd\x21\xfb\x0c\xf1\x1c\x73\x82\x6d" \ "\x3d\x60\x86\x74\xad\x73\xcd\x5d\x09\xfa\xea\x9f" \ "\x98\x2e\xd5\xed\xf5\xec\x36\xf3\x7e\xa5\x45\xe5" \ "\x01\x0f\x49\xf7\x28\x26\x4d\x90\x6b\x5e\x16\x00" \ "\x69\xe2\x80\xb4\xd3\xae\x7b\x7d\xd8\x1a\xfa\xaf" \ "\xf2\x4e\xfa\x0b\x9a\x70\xc4\x5f\x6e\x36\x99\x19" \ "\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82" image1_data = \ "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d" \ "\x49\x48\x44\x52\x00\x00\x00\x18\x00\x00\x00\x18" \ "\x08\x06\x00\x00\x00\xe0\x77\x3d\xf8\x00\x00\x01" \ "\xd4\x49\x44\x41\x54\x48\x89\xe5\x95\xcd\x4e\x14" \ "\x41\x10\xc7\x7f\xd3\xdd\xbb\x1a\xfc\x08\x31\xe0" \ "\xc9\x8b\x1e\x89\xbc\x80\xd1\x93\x07\x1f\x42\xaf" \ "\x5e\xb9\x72\xf4\xc8\x2b\xf0\x02\x70\x22\xbe\x01" \ "\x5e\x84\x27\x50\x57\x8c\x89\x06\x97\xf5\x03\x08" \ "\x64\x57\x97\xcc\xee\x74\x77\x79\xe8\x9e\x75\x99" \ "\x0c\x33\x83\x59\x4f\x56\xd2\xc9\x54\x75\x57\xfd" \ "\xeb\x5f\xd5\x5d\x03\xff\xab\x24\x4d\x0f\xaa\xbf" \ "\x08\x2c\xc0\x15\xc0\xcc\x1a\x20\x01\x7c\xfc\x9e" \ "\x8f\x20\xb5\x4c\x9a\x02\x24\x80\x7f\xb9\xf3\x21" \ "\xd7\x6f\x02\xad\x59\x01\x24\x80\xdf\x79\xdb\x25" \ "\x1d\xdb\xdc\xd6\x8e\xbe\x65\xeb\x1c\x68\x5d\x1d" \ "\x27\xc1\x3f\x7f\xef\x23\x22\xb9\xfd\x4d\x85\xcf" \ "\x0d\x60\x04\x64\x79\x80\xda\xe0\x5f\x0e\x07\x18" \ "\xad\x10\x11\x94\x52\x18\xad\xb0\xce\xa3\x55\x70" \ "\x1f\xa6\x19\xbb\x9d\x1e\xeb\x2b\x4f\x00\xee\x02" \ "\xc7\xc0\x19\xe0\x2f\x62\x30\x09\xbe\xd7\x3d\xe1" \ "\x6a\xdb\x30\xca\x1c\x22\x82\xf3\x16\xeb\xfc\xe4" \ "\xa0\xd1\x8a\xcc\x3a\xf6\xbb\xbd\xdc\x74\x0d\xe8" \ "\xe7\x4a\x59\x0f\x92\x3b\xcb\x8f\xfc\xee\xbb\x03" \ "\x3e\xf6\x4e\x31\x5a\x31\xce\x2c\x99\x75\x38\x2f" \ "\x38\x2f\x18\x1d\x58\xb4\x8c\x06\xa0\x65\x34\x4a" \ "\x4f\x72\xad\xed\x81\x7f\xbe\xba\xc6\xd6\xeb\x3d" \ "\x94\xaa\xbf\x03\x2a\x01\xe7\x85\xfe\x8f\xfd\x46" \ "\x00\x09\x30\xf7\xe2\xd9\xc3\xb3\xa5\xc7\x4f\x59" \ "\xbc\xb7\x5c\x0b\x90\x4b\x3a\x38\x2e\x4f\xa0\xa0" \ "\x0b\x60\x81\x85\xce\xf6\x06\x47\x9f\xaa\x2e\x4b" \ "\x33\x29\x2b\x91\x05\x7e\x01\xb7\x3b\xdb\x1b\x87" \ "\x4b\xfc\x61\x32\x3c\xf9\xc6\xf0\xf4\xa8\x3c\x50" \ "\xab\xdd\x18\x40\x80\x31\x30\x28\x03\x79\xff\x6a" \ "\xb3\x2e\x69\x3f\xad\x5c\x74\x4d\x4b\x41\xe6\xe6" \ "\x17\xf2\xfd\x07\x40\x4a\x60\x5b\x0c\x3e\x24\x3e" \ "\x32\xa8\x1e\x15\x45\x90\xe9\xbd\x94\xf0\x98\xbe" \ "\x02\x07\x53\xab\x17\xed\xa3\x22\x93\x2a\x49\x08" \ "\x93\x73\x31\x82\x0a\x70\x1f\xb8\x45\xa8\x40\xe5" \ "\x2c\x6a\x32\xec\xce\x31\x89\xb6\x71\xcc\xb0\x6c" \ "\xc9\xb4\x73\xe3\x3f\x53\x3c\xdb\x06\xae\x13\x46" \ "\xf5\x4f\xc2\xbc\x91\x3a\xa7\xcb\x48\x42\x28\x8b" \ "\x26\x34\xb8\xd8\xe4\x99\xc9\x65\x13\xfb\x77\xf2" \ "\x1b\xe3\x9e\xb3\xca\x19\xa0\xfc\x58\x00\x00\x00" \ "\x00\x49\x45\x4e\x44\xae\x42\x60\x82" class FormAddress1(QDialog): def __init__(self,parent = None,name = None,modal = 0,fl = 0): QDialog.__init__(self,parent,name,modal,fl) self.image0 = QPixmap() self.image0.loadFromData(image0_data,"PNG") self.image1 = QPixmap() self.image1.loadFromData(image1_data,"PNG") if not name: self.setName("FormAddress1") FormAddress1Layout = QVBoxLayout(self,11,6,"FormAddress1Layout") layout7 = QHBoxLayout(None,0,6,"layout7") self.groupBox1 = QGroupBox(self,"groupBox1") self.groupBox1.setColumnLayout(0,Qt.Vertical) self.groupBox1.layout().setSpacing(6) self.groupBox1.layout().setMargin(11) groupBox1Layout = QHBoxLayout(self.groupBox1.layout()) groupBox1Layout.setAlignment(Qt.AlignTop) self.listViewBook = QListView(self.groupBox1,"listViewBook") self.listViewBook.addColumn(self.__tr("Name")) self.listViewBook.addColumn(self.__tr("Email Address")) self.listViewBook.setSizePolicy(QSizePolicy(QSizePolicy.Expanding,QSizePolicy.Expanding,0,0,self.listViewBook.sizePolicy().hasHeightForWidth())) self.listViewBook.setMinimumSize(QSize(200,0)) self.listViewBook.setFrameShadow(QListView.Sunken) self.listViewBook.setSelectionMode(QListView.Extended) self.listViewBook.setAllColumnsShowFocus(1) self.listViewBook.setShowSortIndicator(1) groupBox1Layout.addWidget(self.listViewBook) layout7.addWidget(self.groupBox1) self.groupBox2 = QGroupBox(self,"groupBox2") self.groupBox2.setSizePolicy(QSizePolicy(QSizePolicy.Preferred,QSizePolicy.Fixed,0,0,self.groupBox2.sizePolicy().hasHeightForWidth())) self.groupBox2.setFrameShape(QGroupBox.NoFrame) self.groupBox2.setColumnLayout(0,Qt.Vertical) self.groupBox2.layout().setSpacing(6) self.groupBox2.layout().setMargin(11) groupBox2Layout = QVBoxLayout(self.groupBox2.layout()) groupBox2Layout.setAlignment(Qt.AlignTop) self.pushButton_add = QPushButton(self.groupBox2,"pushButton_add") self.pushButton_add.setSizePolicy(QSizePolicy(QSizePolicy.Minimum,QSizePolicy.Fixed,0,0,self.pushButton_add.sizePolicy().hasHeightForWidth())) self.pushButton_add.setPixmap(self.image0) groupBox2Layout.addWidget(self.pushButton_add) self.pushButton_remove = QPushButton(self.groupBox2,"pushButton_remove") self.pushButton_remove.setSizePolicy(QSizePolicy(QSizePolicy.Minimum,QSizePolicy.Fixed,0,0,self.pushButton_remove.sizePolicy().hasHeightForWidth())) self.pushButton_remove.setPixmap(self.image1) groupBox2Layout.addWidget(self.pushButton_remove) layout7.addWidget(self.groupBox2) self.groupBox3 = QGroupBox(self,"groupBox3") self.groupBox3.setColumnLayout(0,Qt.Vertical) self.groupBox3.layout().setSpacing(6) self.groupBox3.layout().setMargin(11) groupBox3Layout = QVBoxLayout(self.groupBox3.layout()) groupBox3Layout.setAlignment(Qt.AlignTop) self.listViewSend = QListView(self.groupBox3,"listViewSend") self.listViewSend.addColumn(self.__tr("Name")) self.listViewSend.addColumn(self.__tr("Email Address")) self.listViewSend.setSizePolicy(QSizePolicy(QSizePolicy.Expanding,QSizePolicy.Expanding,0,0,self.listViewSend.sizePolicy().hasHeightForWidth())) self.listViewSend.setMinimumSize(QSize(200,0)) self.listViewSend.setSelectionMode(QListView.Extended) self.listViewSend.setAllColumnsShowFocus(1) groupBox3Layout.addWidget(self.listViewSend) layout7.addWidget(self.groupBox3) FormAddress1Layout.addLayout(layout7) self.buttonGroup1 = QButtonGroup(self,"buttonGroup1") self.buttonGroup1.setSizePolicy(QSizePolicy(QSizePolicy.Fixed,QSizePolicy.Preferred,0,0,self.buttonGroup1.sizePolicy().hasHeightForWidth())) self.buttonGroup1.setColumnLayout(0,Qt.Vertical) self.buttonGroup1.layout().setSpacing(6) self.buttonGroup1.layout().setMargin(11) buttonGroup1Layout = QVBoxLayout(self.buttonGroup1.layout()) buttonGroup1Layout.setAlignment(Qt.AlignTop) self.lineEditSearch = QLineEdit(self.buttonGroup1,"lineEditSearch") buttonGroup1Layout.addWidget(self.lineEditSearch) FormAddress1Layout.addWidget(self.buttonGroup1) self.groupBox4 = QGroupBox(self,"groupBox4") self.groupBox4.setFrameShape(QGroupBox.NoFrame) self.groupBox4.setColumnLayout(0,Qt.Vertical) self.groupBox4.layout().setSpacing(6) self.groupBox4.layout().setMargin(11) groupBox4Layout = QHBoxLayout(self.groupBox4.layout()) groupBox4Layout.setAlignment(Qt.AlignTop) self.pushButtonEdit = QPushButton(self.groupBox4,"pushButtonEdit") self.pushButtonEdit.setSizePolicy(QSizePolicy(QSizePolicy.Minimum,QSizePolicy.Fixed,0,0,self.pushButtonEdit.sizePolicy().hasHeightForWidth())) groupBox4Layout.addWidget(self.pushButtonEdit) spacer1 = QSpacerItem(220,20,QSizePolicy.Expanding,QSizePolicy.Minimum) groupBox4Layout.addItem(spacer1) self.pushButtonOk = QPushButton(self.groupBox4,"pushButtonOk") groupBox4Layout.addWidget(self.pushButtonOk) spacer2 = QSpacerItem(40,20,QSizePolicy.Expanding,QSizePolicy.Minimum) groupBox4Layout.addItem(spacer2) self.pushButtonCancel = QPushButton(self.groupBox4,"pushButtonCancel") self.pushButtonCancel.setDefault(1) groupBox4Layout.addWidget(self.pushButtonCancel) FormAddress1Layout.addWidget(self.groupBox4) self.languageChange() self.resize(QSize(606,394).expandedTo(self.minimumSizeHint())) self.clearWState(Qt.WState_Polished) self.connect(self.listViewBook,SIGNAL("clicked(QListViewItem*)"),self.listViewBook_clicked) self.connect(self.listViewSend,SIGNAL("clicked(QListViewItem*)"),self.listViewSend_clicked) self.connect(self.pushButton_remove,SIGNAL("clicked()"),self.pushButton_remove_clicked) self.connect(self.lineEditSearch,SIGNAL("textChanged(const QString&)"),self.lineEditSearch_textChanged) self.connect(self.pushButtonEdit,SIGNAL("clicked()"),self.pushButtonEdit_clicked) self.connect(self.pushButtonOk,SIGNAL("clicked()"),self.pushButtonOk_clicked) self.connect(self.pushButtonCancel,SIGNAL("clicked()"),self.pushButtonCancel_clicked) self.connect(self.pushButton_add,SIGNAL("clicked()"),self.pushButton_add_clicked) def languageChange(self): self.setCaption(self.__tr("GmailAgent - contacts")) self.groupBox1.setTitle(self.__tr("Gmail contacts")) self.listViewBook.header().setLabel(0,self.__tr("Name")) self.listViewBook.header().setLabel(1,self.__tr("Email Address")) self.groupBox2.setTitle(QString.null) self.pushButton_add.setText(QString.null) QToolTip.add(self.pushButton_add,self.__tr("Add selected address to the 'Send to' list")) self.pushButton_remove.setText(QString.null) QToolTip.add(self.pushButton_remove,self.__tr("Remove selected address from the 'Send to' list")) self.groupBox3.setTitle(self.__tr("Send to:")) self.listViewSend.header().setLabel(0,self.__tr("Name")) self.listViewSend.header().setLabel(1,self.__tr("Email Address")) self.buttonGroup1.setTitle(self.__tr("Search for a name in the contacts")) self.groupBox4.setTitle(QString.null) self.pushButtonEdit.setText(self.__tr("Start contacts manager")) self.pushButtonOk.setText(self.__tr("Ok")) self.pushButtonCancel.setText(self.__tr("Cancel")) def listViewBook_clicked(self,a0): print "FormAddress1.listViewBook_clicked(QListViewItem*): Not implemented yet" def listViewSend_clicked(self,a0): print "FormAddress1.listViewSend_clicked(QListViewItem*): Not implemented yet" def pushButton_remove_clicked(self): print "FormAddress1.pushButton_remove_clicked(): Not implemented yet" def lineEditSearch_textChanged(self,a0): print "FormAddress1.lineEditSearch_textChanged(const QString&): Not implemented yet" def pushButtonEdit_clicked(self): print "FormAddress1.pushButtonEdit_clicked(): Not implemented yet" def pushButtonOk_clicked(self): print "FormAddress1.pushButtonOk_clicked(): Not implemented yet" def pushButtonCancel_clicked(self): print "FormAddress1.pushButtonCancel_clicked(): Not implemented yet" def pushButton_add_clicked(self): print "FormAddress1.pushButton_add_clicked(): Not implemented yet" def __tr(self,s,c = None): return qApp.translate("FormAddress1",s,c) --- NEW FILE: AddressDialog1.ui --- <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>FormAddress1</class> <widget class="QDialog"> <property name="name"> <cstring>FormAddress1</cstring> </property> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>606</width> <height>394</height> </rect> </property> <property name="caption"> <string>GmailAgent - contacts</string> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> <widget class="QLayoutWidget"> <property name="name"> <cstring>layout7</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> <widget class="QGroupBox"> <property name="name"> <cstring>groupBox1</cstring> </property> <property name="title"> <string>Gmail contacts</string> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> <widget class="QListView"> <column> <property name="text"> <string>Name</string> </property> <property name="clickable"> <bool>true</bool> </property> <property name="resizable"> <bool>true</bool> </property> </column> <column> <property name="text"> <string>Email Address</string> </property> <property name="clickable"> <bool>true</bool> </property> <property name="resizable"> <bool>true</bool> </property> </column> <property name="name"> <cstring>listViewBook</cstring> </property> <property name="sizePolicy"> <sizepolicy> <hsizetype>7</hsizetype> <vsizetype>7</vsizetype> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="minimumSize"> <size> <width>200</width> <height>0</height> </size> </property> <property name="frameShadow"> <enum>Sunken</enum> </property> <property name="selectionMode"> <enum>Extended</enum> </property> <property name="allColumnsShowFocus"> <bool>true</bool> </property> <property name="showSortIndicator"> <bool>true</bool> </property> </widget> </hbox> </widget> <widget class="QGroupBox"> <property name="name"> <cstring>groupBox2</cstring> </property> <property name="sizePolicy"> <sizepolicy> <hsizetype>5</hsizetype> <vsizetype>0</vsizetype> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="frameShape"> <enum>NoFrame</enum> </property> <property name="title"> <string></string> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> <widget class="QPushButton"> <property name="name"> <cstring>pushButton_add</cstring> </property> <property name="sizePolicy"> <sizepolicy> <hsizetype>1</hsizetype> <vsizetype>0</vsizetype> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="text"> <string></string> </property> <property name="pixmap"> <pixmap>image0</pixmap> </property> <property name="toolTip" stdset="0"> <string>Add selected address to the 'Send to' list</string> </property> </widget> <widget class="QPushButton"> <property name="name"> <cstring>pushButton_remove</cstring> </property> <property name="sizePolicy"> <sizepolicy> <hsizetype>1</hsizetype> <vsizetype>0</vsizetype> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="text"> <string></string> </property> <property name="pixmap"> <pixmap>image1</pixmap> </property> <property name="toolTip" stdset="0"> <string>Remove selected address from the 'Send to' list</string> </property> </widget> </vbox> </widget> <widget class="QGroupBox"> <property name="name"> <cstring>groupBox3</cstring> </property> <property name="title"> <string>Send to:</string> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> <widget class="QListView"> <column> <property name="text"> <string>Name</string> </property> <property name="clickable"> <bool>true</bool> </property> <property name="resizable"> <bool>true</bool> </property> </column> <column> <property name="text"> <string>Email Address</string> </property> <property name="clickable"> <bool>true</bool> </property> <property name="resizable"> <bool>true</bool> </property> </column> <property name="name"> <cstring>listViewSend</cstring> </property> <property name="sizePolicy"> <sizepolicy> <hsizetype>7</hsizetype> <vsizetype>7</vsizetype> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="minimumSize"> <size> <width>200</width> <height>0</height> </size> </property> <property name="selectionMode"> <enum>Extended</enum> </property> <property name="allColumnsShowFocus"> <bool>true</bool> </property> </widget> </vbox> </widget> </hbox> </widget> <widget class="QButtonGroup"> <property name="name"> <cstring>buttonGroup1</cstring> </property> <property name="sizePolicy"> <sizepolicy> <hsizetype>0</hsizetype> <vsizetype>5</vsizetype> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="title"> <string>Search for a name in the contacts</string> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> <widget class="QLineEdit"> <property name="name"> <cstring>lineEditSearch</cstring> </property> </widget> </vbox> </widget> <widget class="QGroupBox"> <property name="name"> <cstring>groupBox4</cstring> </property> <property name="frameShape"> <enum>NoFrame</enum> </property> <property name="title"> <string></string> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> <widget class="QPushButton"> <property name="name"> <cstring>pushButtonEdit</cstring> </property> <property name="sizePolicy"> <sizepolicy> <hsizetype>1</hsizetype> <vsizetype>0</vsizetype> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="text"> <string>Start contacts manager</string> </property> </widget> <spacer> <property name="name"> <cstring>spacer1</cstring> </property> <property name="orientation"> <enum>Horizontal</enum> </property> <property name="sizeType"> <enum>Expanding</enum> </property> <property name="sizeHint"> <size> <width>220</width> <height>20</height> </size> </property> </spacer> <widget class="QPushButton"> <property name="name"> <cstring>pushButtonOk</cstring> </property> <property name="text"> <string>Ok</string> </property> </widget> <spacer> <property name="name"> <cstring>spacer2</cstring> </property> <property name="orientation"> <enum>Horizontal</enum> </property> <property name="sizeType"> <enum>Expanding</enum> </property> <property name="sizeHint"> <size> <width>40</width> <height>20</height> </size> </property> </spacer> <widget class="QPushButton"> <property name="name"> <cstring>pushButtonCancel</cstring> </property> <property name="text"> <string>Cancel</string> </property> <property name="default"> <bool>true</bool> </property> </widget> </hbox> </widget> </vbox> </widget> <images> <image name="image0"> <data format="PNG" length="516">89504e470d0a1a0a0000000d4948445200000018000000180806000000e0773df8000001cb494441544889e595314cdb4014863f3f3b85b4b4422a74c8d2311553c500ecac0c5d2bd68eac48b0756461ecd4a9aa18bb54b442428815a6229010036a874a1dd25490044c629fef3af842d57036b6c8c62f9d2cf9ecff7bffddf319eea3bc320f4b4973038c0095b2a022f22cc0004f2d68a81001ccd2bbed3e64b208246b893c3b3738987b516371ed33400378023cc883b80006d040323062005f3ce65f3ee7d5db4f852083370548beec9f12298d2f1e81ff7f0dcd568888d08d149bfba76cadbfa1db397b06b481c816980f78fff5804ae0a312fd2f963118631011025f50892656097b27bff8b0bc00e08438f7208c145a6bb4d6a824bd028808e2710dae8e5498a9d75858fd98b95c810bb0fbed075137447ce7f40d69ad999a5fe47867a3014cd8247126a077d9226c350b9903fcfe7ec4f1ce06c0345005424001a6ec979c673e075cd9a1b0fbe04ca0e288eec5b9d370746c3ccbbc0dfc012e2c00c8e8a2bc8a675faf303a36ee326fe2e8225782c7a41bf5889b5d769851b9d3dc05d040cfbe703e9050003a8d9f85cd21fb0cf11c73826d3d608674ad73cd5d09faea9f982ed5edf5ec36f37ea545e5010f49f728264d906b5e160069e280b4d3ae7b7dd81afaaff24efa0b9a70c45f6e3699190000000049454e44ae426082</data> </image> <image name="image1"> <data format="PNG" length="525">89504e470d0a1a0a0000000d4948445200000018000000180806000000e0773df8000001d4494441544889e595cd4e144110c77fd3ddbb1afc0831e0c98b1e89bc80d193071f42af5eb972f4c82bf0027022be015e842750578c890697f50308645797ccee747779e89e75990c3383594f56d2c9547557fdeb5fd55d03ffab244d0faabf082cc015c0cc1a20017cfc9e8f20b54c9a0224807fb9f321d76f02ad59012480df79db251ddbdcd68ebe65eb1c685d1d27c13f7fef2322b9fd4d85cf0d6004647980dae05f0e0718ad1011945218adb0cea355701fa619bb9d1eeb2b4f00ee02c7c019e02f623009bed73de16adb30ca1c2282f316ebfce4a0d18acc3af6bbbddc740de8e74a590f923bcb8ffceebb033ef64e315a31ce2c9975382f382f181d58b48c06a065344a4f72aded817fbebac6d6eb3d94aabf032a01e785fe8ffd46000930f7e2d9c3b3a5c74f59bcb75c0b904b3a382e4fa0a00b608185cef606479faa2e4b33292b91057e01b73bdb1b874bfc61323cf9c6f0f4a83c50abdd1840803130280379ff6ab32e693fad5c744d4b41e6e617f2fd07404a605b0c3e243e32a81e154590e9bd94f098be020753ab17eda322932a4908937331820a701fb845a840e52c6a32ecce3189b671ccb06cc9b473e33f533cdb06ae1346f54fc2bc913aa7cb4842288b2634b8d8e499c96513fb77f21be39eb3ca19a0fc580000000049454e44ae426082</data> </image> </images> <connections> <connection> <sender>listViewBook</sender> <signal>clicked(QListViewItem*)</signal> <receiver>FormAddress1</receiver> <slot>listViewBook_clicked(QListViewItem*)</slot> </connection> <connection> <sender>listViewSend</sender> <signal>clicked(QListViewItem*)</signal> <receiver>FormAddress1</receiver> <slot>listViewSend_clicked(QListViewItem*)</slot> </connection> <connection> <sender>pushButton_remove</sender> <signal>clicked()</signal> <receiver>FormAddress1</receiver> <slot>pushButton_remove_clicked()</slot> </connection> <connection> <sender>lineEditSearch</sender> <signal>textChanged(const QString&)</signal> <receiver>FormAddress1</receiver> <slot>lineEditSearch_textChanged(const QString&)</slot> </connection> <connection> <sender>pushButtonEdit</sender> <signal>clicked()</signal> <receiver>FormAddress1</receiver> <slot>pushButtonEdit_clicked()</slot> </connection> <connection> <sender>pushButtonOk</sender> <signal>clicked()</signal> <receiver>FormAddress1</receiver> <slot>pushButtonOk_clicked()</slot> </connection> <connection> <sender>pushButtonCancel</sender> <signal>clicked()</signal> <receiver>FormAddress1</receiver> <slot>pushButtonCancel_clicked()</slot> </connection> <connection> <sender>pushButton_add</sender> <signal>clicked()</signal> <receiver>FormAddress1</receiver> <slot>pushButton_add_clicked()</slot> </connection> </connections> <includes> <include location="local" impldecl="in implementation">AddressDialog1.ui.h</include> </includes> <slots> <slot>listViewBook_clicked( QListViewItem * )</slot> <slot>listViewSend_clicked( QListViewItem * )</slot> <slot>pushButton_remove_clicked()</slot> <slot>lineEditSearch_textChanged( const QString & )</slot> <slot>pushButtonEdit_clicked()</slot> <slot>pushButtonOk_clicked()</slot> <slot>pushButtonCancel_clicked()</slot> <slot>pushButton_add_clicked()</slot> </slots> <layoutdefaults spacing="6" margin="11"/> </UI> |
From: Stas Z. <sta...@us...> - 2005-10-02 22:38:30
|
Update of /cvsroot/gmailagent/GA-main In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12638 Removed Files: AddressDialog_forms.py AddressEditDialog_forms.py AddressEditorDialog_forms.py Log Message: removed old files --- AddressEditorDialog_forms.py DELETED --- --- AddressEditDialog_forms.py DELETED --- --- AddressDialog_forms.py DELETED --- |
From: Stas Z. <sta...@us...> - 2005-10-02 21:43:56
|
Update of /cvsroot/gmailagent/GA-main In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15333 Modified Files: GmailAgent.e3p version.py Added Files: CHANGELOG Removed Files: Changelog Log Message: changed name Index: version.py =================================================================== RCS file: /cvsroot/gmailagent/GA-main/version.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** version.py 1 Jun 2005 18:01:55 -0000 1.10 --- version.py 2 Oct 2005 09:44:40 -0000 1.11 *************** *** 3,7 **** # it to get a version number ! VERSION = "0.7" ! #last changed on May 15 --sz-- --- 3,7 ---- # it to get a version number ! VERSION = "0.7.1" ! #last changed on Okt 01 --sz-- --- NEW FILE: CHANGELOG --- GmailAgent (0.7.1) * Made the whole GUI resizeable. * Redesigned the contacts dialog. GmailAgent (0.7) * Replaced addressbook with a a call to GContactsAgent. * Added some progress dialogs. * Now using the official libgmail. * Changed the debugging output. GmailAgent (0.6) * New release. * Added a help browser. * Added a 'sending message' progress dialog. * Started to fork libgmail. * Improved the installer. It now installs the docs and generates modules at run time used by gmailagent. GmailAgent (0.5) * New Release. * Added a check to prevent storing the same address multiple times. * Fixed: exception raised when clicking ok in the addressdialog while nothing is selected. * Added address lookup while typing for the search field in the addressdialog . GmailAgent (0.4.1) * Bugfix release. * Fixed the mainwindow title. GmailAgent (0.4) * New release. * Added a about dialog. * Updated the main win layout * Fixed a wrong tooltip. * Removed the print statement which echos the login values to stderr. This could be a security risk when GA is run from a console. * Added an addressbook with all the functionality one would expect. * Added support for multiple addresses as recipients. * Added attachments file checks. * Removed debug messages to stderr. GmailAgent (0.3) * Updated the README * Added a install script. GmailAgent (0.2.1) * Fixed the CC entry in a message. * Commented the redirection of streams. * Added support for non-mozilla syntax. * Resized the GUI to fix some display problems with various themes. --- Changelog DELETED --- Index: GmailAgent.e3p =================================================================== RCS file: /cvsroot/gmailagent/GA-main/GmailAgent.e3p,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** GmailAgent.e3p 14 Sep 2005 11:36:28 -0000 1.15 --- GmailAgent.e3p 2 Oct 2005 09:44:40 -0000 1.16 *************** *** 2,6 **** <!DOCTYPE Project SYSTEM "Project-3.5.dtd"> <!-- Project file for project GmailAgent --> ! <!-- Saved: 2005-08-11, 17:20:42 --> <!-- 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, 11:31:14 --> <!-- Copyright (C) 2005 Stas Zytkiewicz, st...@li... --> <Project version="3.5"> *************** *** 38,44 **** </Source> <Source> - <Name>AddressDialog_forms.py</Name> - </Source> - <Source> <Name>HelpDialog_forms.py</Name> </Source> --- 38,41 ---- *************** *** 46,55 **** <Name>setup.py</Name> </Source> - <Source> - <Name>AddressEditDialog_forms.py</Name> - </Source> - <Source> - <Name>AddressEditorDialog_forms.py</Name> - </Source> </Sources> <Forms> --- 43,46 ---- *************** *** 73,82 **** </Form> <Form> - <Name>AddressDialog.ui</Name> - </Form> - <Form> - <Name>AddressDialog.ui.h</Name> - </Form> - <Form> <Name>HelpDialog.ui</Name> </Form> --- 64,67 ---- *************** *** 84,99 **** <Name>HelpDialog.ui.h</Name> </Form> - <Form> - <Name>AddressEditorDialog.ui</Name> - </Form> - <Form> - <Name>AddressEditorDialog.ui.h</Name> - </Form> - <Form> - <Name>AddressEditDialog.ui</Name> - </Form> - <Form> - <Name>AddressEditDialog.ui.h</Name> - </Form> </Forms> <Translations> --- 69,72 ---- |
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 # |
From: Stas Z. <sta...@us...> - 2005-10-02 19:19:26
|
Update of /cvsroot/gmailagent/GA-main In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12028 Modified Files: AboutDialog_forms.py Changelog GuiQT.py HelpDialog_forms.py LoginDialog_forms.py MainWin.ui MainWin_forms.py Makefile Removed Files: AddressDialog.ui AddressDialog.ui.h AddressEditDialog.ui AddressEditDialog.ui.h AddressEditorDialog.ui AddressEditorDialog.ui.h Log Message: removed obselete files --- AddressEditorDialog.ui.h DELETED --- --- AddressDialog.ui.h DELETED --- Index: Changelog =================================================================== RCS file: /cvsroot/gmailagent/GA-main/Changelog,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Changelog 10 Jun 2005 09:22:07 -0000 1.16 --- Changelog 2 Oct 2005 09:24:54 -0000 1.17 *************** *** 1,6 **** GmailAgent (0.7) ! * Replaced addressbook with a frontend for the Gmail contacts. * Added some progress dialogs. ! * Fork of libgmail is now complete, and it's called libgmail2. * Changed the debugging output. --- 1,6 ---- GmailAgent (0.7) ! * Replaced addressbook with a a call to GContactsAgent. * Added some progress dialogs. ! * Now using the official libgmail. * Changed the debugging output. --- AddressEditDialog.ui DELETED --- Index: MainWin.ui =================================================================== RCS file: /cvsroot/gmailagent/GA-main/MainWin.ui,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** MainWin.ui 11 May 2005 14:27:39 -0000 1.11 --- MainWin.ui 2 Oct 2005 09:24:54 -0000 1.12 *************** *** 10,192 **** <y>0</y> <width>522</width> ! <height>546</height> </rect> </property> <property name="caption"> ! <string>GmailAgent - Send your picture with Gmail</string> </property> ! <widget class="QPushButton"> ! <property name="name"> ! <cstring>pushButtonSend</cstring> ! </property> ! <property name="geometry"> ! <rect> ! <x>190</x> ! <y>470</y> ! <width>100</width> ! <height>26</height> ! </rect> ! </property> ! <property name="text"> ! <string>Send</string> ! </property> ! </widget> ! <widget class="QTextEdit"> ! <property name="name"> ! <cstring>textEditMesg</cstring> ! </property> ! <property name="geometry"> ! <rect> ! <x>10</x> ! <y>280</y> ! <width>500</width> ! <height>180</height> ! </rect> ! </property> ! </widget> ! <widget class="QLabel"> ! <property name="name"> ! <cstring>textLabel4</cstring> ! </property> ! <property name="geometry"> ! <rect> ! <x>10</x> ! <y>120</y> ! <width>200</width> ! <height>20</height> ! </rect> ! </property> ! <property name="text"> ! <string>Attachments:</string> ! </property> ! </widget> ! <widget class="QLabel"> ! <property name="name"> ! <cstring>textLabel5</cstring> ! </property> ! <property name="geometry"> ! <rect> ! <x>10</x> ! <y>250</y> ! <width>290</width> ! <height>16</height> ! </rect> ! </property> ! <property name="text"> ! <string>Type your message below:</string> ! </property> ! </widget> ! <widget class="QTextEdit"> ! <property name="name"> ! <cstring>textEditAttach</cstring> ! </property> ! <property name="geometry"> ! <rect> ! <x>10</x> ! <y>140</y> ! <width>500</width> ! <height>100</height> ! </rect> ! </property> ! </widget> ! <widget class="QGroupBox"> <property name="name"> ! <cstring>groupBox1</cstring> ! </property> ! <property name="geometry"> ! <rect> ! <x>10</x> ! <y>10</y> ! <width>500</width> ! <height>100</height> ! </rect> ! </property> ! <property name="title"> ! <string>Recipient</string> </property> ! <widget class="QLabel"> ! <property name="name"> ! <cstring>textLabel1</cstring> ! </property> ! <property name="geometry"> ! <rect> ! <x>20</x> ! <y>20</y> ! <width>30</width> ! <height>20</height> ! </rect> ! </property> ! <property name="text"> ! <string>To :</string> ! </property> ! </widget> ! <widget class="QLabel"> <property name="name"> ! <cstring>textLabel2</cstring> </property> ! <property name="geometry"> ! <rect> ! <x>10</x> ! <y>60</y> ! <width>52</width> ! <height>20</height> ! </rect> </property> ! <property name="text"> ! <string>Subject:</string> </property> </widget> ! <widget class="QPushButton"> <property name="name"> ! <cstring>pushButtonAdress</cstring> </property> ! <property name="geometry"> ! <rect> ! <x>390</x> ! <y>20</y> ! <width>100</width> ! <height>30</height> ! </rect> </property> ! <property name="text"> ! <string>Adressbook</string> </property> ! <property name="toolTip" stdset="0"> ! <string>Open the addressbook</string> </property> </widget> ! <widget class="QLineEdit"> <property name="name"> ! <cstring>lineEditSub</cstring> </property> ! <property name="geometry"> ! <rect> ! <x>60</x> ! <y>60</y> ! <width>400</width> ! <height>20</height> ! </rect> </property> </widget> ! <widget class="QLineEdit"> <property name="name"> ! <cstring>lineEditTo</cstring> ! </property> ! <property name="geometry"> ! <rect> ! <x>60</x> ! <y>20</y> ! <width>310</width> ! <height>20</height> ! </rect> </property> ! <property name="alignment"> ! <set>AlignAuto</set> </property> ! <property name="toolTip" stdset="0"> ! <string></string> </property> </widget> ! </widget> </widget> <menubar> --- 10,223 ---- <y>0</y> <width>522</width> ! <height>544</height> </rect> </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>7</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>124</width> + <height>425</height> + </size> + </property> <property name="caption"> ! <string>GmailAgent - Your local email client for Gmail</string> </property> ! <vbox> <property name="name"> ! <cstring>unnamed</cstring> </property> ! <widget class="QGroupBox"> <property name="name"> ! <cstring>groupBox1</cstring> </property> ! <property name="sizePolicy"> ! <sizepolicy> ! <hsizetype>5</hsizetype> ! <vsizetype>5</vsizetype> ! <horstretch>0</horstretch> ! <verstretch>0</verstretch> ! </sizepolicy> </property> ! <property name="title"> ! <string>Recipient</string> </property> + <widget class="QLabel"> + <property name="name"> + <cstring>textLabel1</cstring> + </property> + <property name="geometry"> + <rect> + <x>20</x> + <y>20</y> + <width>30</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>To :</string> + </property> + </widget> + <widget class="QLineEdit"> + <property name="name"> + <cstring>lineEditTo</cstring> + </property> + <property name="geometry"> + <rect> + <x>60</x> + <y>20</y> + <width>310</width> + <height>20</height> + </rect> + </property> + <property name="alignment"> + <set>AlignAuto</set> + </property> + <property name="toolTip" stdset="0"> + <string></string> + </property> + </widget> + <widget class="QPushButton"> + <property name="name"> + <cstring>pushButtonAdress</cstring> + </property> + <property name="geometry"> + <rect> + <x>390</x> + <y>20</y> + <width>100</width> + <height>30</height> + </rect> + </property> + <property name="text"> + <string>Adressbook</string> + </property> + <property name="toolTip" stdset="0"> + <string>Open the addressbook</string> + </property> + </widget> + <widget class="QLabel"> + <property name="name"> + <cstring>textLabel2</cstring> + </property> + <property name="geometry"> + <rect> + <x>10</x> + <y>60</y> + <width>52</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Subject:</string> + </property> + </widget> + <widget class="QLineEdit"> + <property name="name"> + <cstring>lineEditSub</cstring> + </property> + <property name="geometry"> + <rect> + <x>60</x> + <y>60</y> + <width>400</width> + <height>20</height> + </rect> + </property> + </widget> </widget> ! <widget class="QGroupBox"> <property name="name"> ! <cstring>groupBox7</cstring> </property> ! <property name="sizePolicy"> ! <sizepolicy> ! <hsizetype>5</hsizetype> ! <vsizetype>5</vsizetype> ! <horstretch>0</horstretch> ! <verstretch>0</verstretch> ! </sizepolicy> </property> ! <property name="maximumSize"> ! <size> ! <width>32767</width> ! <height>150</height> ! </size> </property> ! <property name="title"> ! <string>Attachments:</string> </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QTextEdit"> + <property name="name"> + <cstring>textEditAttach</cstring> + </property> + <property name="maximumSize"> + <size> + <width>32767</width> + <height>140</height> + </size> + </property> + </widget> + </vbox> </widget> ! <widget class="QGroupBox"> <property name="name"> ! <cstring>groupBox8</cstring> </property> ! <property name="sizePolicy"> ! <sizepolicy> ! <hsizetype>5</hsizetype> ! <vsizetype>5</vsizetype> ! <horstretch>0</horstretch> ! <verstretch>0</verstretch> ! </sizepolicy> </property> + <property name="title"> + <string>Message:</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QTextEdit"> + <property name="name"> + <cstring>textEditMesg</cstring> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>180</height> + </size> + </property> + </widget> + </vbox> </widget> ! <widget class="QPushButton"> <property name="name"> ! <cstring>pushButtonSend</cstring> </property> ! <property name="sizePolicy"> ! <sizepolicy> ! <hsizetype>5</hsizetype> ! <vsizetype>0</vsizetype> ! <horstretch>0</horstretch> ! <verstretch>0</verstretch> ! </sizepolicy> </property> ! <property name="text"> ! <string>Send you message</string> </property> </widget> ! </vbox> </widget> <menubar> *************** *** 256,265 **** <connections> <connection> - <sender>pushButtonSend</sender> - <signal>clicked()</signal> - <receiver>Form1</receiver> - <slot>pushButtonSend_clicked()</slot> - </connection> - <connection> <sender>Form1QuitAction</sender> <signal>activated()</signal> --- 287,290 ---- *************** *** 274,281 **** </connection> <connection> ! <sender>pushButtonAdress</sender> <signal>clicked()</signal> <receiver>Form1</receiver> ! <slot>pushButtonAdress_clicked()</slot> </connection> <connection> --- 299,312 ---- </connection> <connection> ! <sender>Form1HelpAction</sender> ! <signal>activated()</signal> ! <receiver>Form1</receiver> ! <slot>Form1Help_activate()</slot> ! </connection> ! <connection> ! <sender>pushButtonSend</sender> <signal>clicked()</signal> <receiver>Form1</receiver> ! <slot>pushButtonSend_clicked()</slot> </connection> <connection> *************** *** 286,293 **** </connection> <connection> ! <sender>Form1HelpAction</sender> ! <signal>activated()</signal> <receiver>Form1</receiver> ! <slot>Form1Help_activate()</slot> </connection> </connections> --- 317,324 ---- </connection> <connection> ! <sender>pushButtonAdress</sender> ! <signal>clicked()</signal> <receiver>Form1</receiver> ! <slot>pushButtonAdress_clicked()</slot> </connection> </connections> Index: Makefile =================================================================== RCS file: /cvsroot/gmailagent/GA-main/Makefile,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Makefile 14 Jun 2005 14:17:31 -0000 1.10 --- Makefile 2 Oct 2005 09:24:54 -0000 1.11 *************** *** 5,9 **** pyuic AboutDialog.ui -o AboutDialog_forms.py pyuic HelpDialog.ui -o HelpDialog_forms.py ! pyuic AddressDialog.ui -o AddressDialog_forms.py # pyuic AddressEditDialog.ui -o AddressEditDialog_forms.py # pyuic AddressEditorDialog.ui -o AddressEditorDialog_forms.py --- 5,9 ---- pyuic AboutDialog.ui -o AboutDialog_forms.py pyuic HelpDialog.ui -o HelpDialog_forms.py ! pyuic AddressDialog1.ui -o AddressDialog1_forms.py # pyuic AddressEditDialog.ui -o AddressEditDialog_forms.py # pyuic AddressEditorDialog.ui -o AddressEditorDialog_forms.py Index: AboutDialog_forms.py =================================================================== RCS file: /cvsroot/gmailagent/GA-main/AboutDialog_forms.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** AboutDialog_forms.py 14 Sep 2005 15:23:45 -0000 1.25 --- AboutDialog_forms.py 2 Oct 2005 09:24:54 -0000 1.26 *************** *** 3,7 **** # Form implementation generated from reading ui file 'AboutDialog.ui' # ! # Created: Wed Sep 14 17:23:00 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:20:56 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.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** GuiQT.py 28 Sep 2005 12:41:27 -0000 1.38 --- GuiQT.py 2 Oct 2005 09:24:54 -0000 1.39 *************** *** 29,33 **** ##from AddressEditorDialog_forms import FormAddressEditor ##from AddressEditDialog_forms import FormAddressEdit ! from AddressDialog_forms import FormAddress import Gmail --- 29,33 ---- ##from AddressEditorDialog_forms import FormAddressEditor ##from AddressEditDialog_forms import FormAddressEdit ! from AddressDialog1_forms import FormAddress1 import Gmail *************** *** 317,324 **** self.show() ! class AddressBookDialog(FormAddress): 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__) ! FormAddress.__init__(self,parent,name,modal,fl) self.parent = parent self.selecteditem = None --- 317,324 ---- self.show() ! 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 Index: MainWin_forms.py =================================================================== RCS file: /cvsroot/gmailagent/GA-main/MainWin_forms.py,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** MainWin_forms.py 14 Sep 2005 15:23:45 -0000 1.28 --- MainWin_forms.py 2 Oct 2005 09:24:54 -0000 1.29 *************** *** 3,7 **** # Form implementation generated from reading ui file 'MainWin.ui' # ! # Created: Wed Sep 14 17:23:00 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:20:56 2005 # by: The PyQt User Interface Compiler (pyuic) 3.14.1 # *************** *** 20,59 **** self.setName("Form1") self.setCentralWidget(QWidget(self,"qt_central_widget")) ! ! self.pushButtonSend = QPushButton(self.centralWidget(),"pushButtonSend") ! self.pushButtonSend.setGeometry(QRect(190,470,100,26)) ! ! self.textEditMesg = QTextEdit(self.centralWidget(),"textEditMesg") ! self.textEditMesg.setGeometry(QRect(10,280,500,180)) ! ! self.textLabel4 = QLabel(self.centralWidget(),"textLabel4") ! self.textLabel4.setGeometry(QRect(10,120,200,20)) ! ! self.textLabel5 = QLabel(self.centralWidget(),"textLabel5") ! self.textLabel5.setGeometry(QRect(10,250,290,16)) ! ! self.textEditAttach = QTextEdit(self.centralWidget(),"textEditAttach") ! self.textEditAttach.setGeometry(QRect(10,140,500,100)) self.groupBox1 = QGroupBox(self.centralWidget(),"groupBox1") ! self.groupBox1.setGeometry(QRect(10,10,500,100)) self.textLabel1 = QLabel(self.groupBox1,"textLabel1") self.textLabel1.setGeometry(QRect(20,20,30,20)) ! self.textLabel2 = QLabel(self.groupBox1,"textLabel2") ! self.textLabel2.setGeometry(QRect(10,60,52,20)) self.pushButtonAdress = QPushButton(self.groupBox1,"pushButtonAdress") self.pushButtonAdress.setGeometry(QRect(390,20,100,30)) self.lineEditSub = QLineEdit(self.groupBox1,"lineEditSub") self.lineEditSub.setGeometry(QRect(60,60,400,20)) ! self.lineEditTo = QLineEdit(self.groupBox1,"lineEditTo") ! self.lineEditTo.setGeometry(QRect(60,20,310,20)) ! self.lineEditTo.setAlignment(QLineEdit.AlignAuto) self.Action = QAction(self,"Action") --- 20,79 ---- self.setName("Form1") + self.setSizePolicy(QSizePolicy(QSizePolicy.Expanding,QSizePolicy.Expanding,0,0,self.sizePolicy().hasHeightForWidth())) + self.setMinimumSize(QSize(124,425)) self.setCentralWidget(QWidget(self,"qt_central_widget")) ! Form1Layout = QVBoxLayout(self.centralWidget(),11,6,"Form1Layout") self.groupBox1 = QGroupBox(self.centralWidget(),"groupBox1") ! self.groupBox1.setSizePolicy(QSizePolicy(QSizePolicy.Preferred,QSizePolicy.Preferred,0,0,self.groupBox1.sizePolicy().hasHeightForWidth())) self.textLabel1 = QLabel(self.groupBox1,"textLabel1") self.textLabel1.setGeometry(QRect(20,20,30,20)) ! self.lineEditTo = QLineEdit(self.groupBox1,"lineEditTo") ! self.lineEditTo.setGeometry(QRect(60,20,310,20)) ! self.lineEditTo.setAlignment(QLineEdit.AlignAuto) self.pushButtonAdress = QPushButton(self.groupBox1,"pushButtonAdress") self.pushButtonAdress.setGeometry(QRect(390,20,100,30)) + self.textLabel2 = QLabel(self.groupBox1,"textLabel2") + self.textLabel2.setGeometry(QRect(10,60,52,20)) + self.lineEditSub = QLineEdit(self.groupBox1,"lineEditSub") self.lineEditSub.setGeometry(QRect(60,60,400,20)) + Form1Layout.addWidget(self.groupBox1) ! self.groupBox7 = QGroupBox(self.centralWidget(),"groupBox7") ! self.groupBox7.setSizePolicy(QSizePolicy(QSizePolicy.Preferred,QSizePolicy.Preferred,0,0,self.groupBox7.sizePolicy().hasHeightForWidth())) ! self.groupBox7.setMaximumSize(QSize(32767,150)) ! self.groupBox7.setColumnLayout(0,Qt.Vertical) ! self.groupBox7.layout().setSpacing(6) ! self.groupBox7.layout().setMargin(11) ! groupBox7Layout = QVBoxLayout(self.groupBox7.layout()) ! groupBox7Layout.setAlignment(Qt.AlignTop) ! ! self.textEditAttach = QTextEdit(self.groupBox7,"textEditAttach") ! self.textEditAttach.setMaximumSize(QSize(32767,140)) ! groupBox7Layout.addWidget(self.textEditAttach) ! Form1Layout.addWidget(self.groupBox7) ! ! self.groupBox8 = QGroupBox(self.centralWidget(),"groupBox8") ! self.groupBox8.setSizePolicy(QSizePolicy(QSizePolicy.Preferred,QSizePolicy.Preferred,0,0,self.groupBox8.sizePolicy().hasHeightForWidth())) ! self.groupBox8.setColumnLayout(0,Qt.Vertical) ! self.groupBox8.layout().setSpacing(6) ! self.groupBox8.layout().setMargin(11) ! groupBox8Layout = QVBoxLayout(self.groupBox8.layout()) ! groupBox8Layout.setAlignment(Qt.AlignTop) ! ! self.textEditMesg = QTextEdit(self.groupBox8,"textEditMesg") ! self.textEditMesg.setMinimumSize(QSize(0,180)) ! groupBox8Layout.addWidget(self.textEditMesg) ! Form1Layout.addWidget(self.groupBox8) ! ! self.pushButtonSend = QPushButton(self.centralWidget(),"pushButtonSend") ! self.pushButtonSend.setSizePolicy(QSizePolicy(QSizePolicy.Preferred,QSizePolicy.Fixed,0,0,self.pushButtonSend.sizePolicy().hasHeightForWidth())) ! Form1Layout.addWidget(self.pushButtonSend) self.Action = QAction(self,"Action") *************** *** 77,102 **** self.languageChange() ! self.resize(QSize(522,546).expandedTo(self.minimumSizeHint())) self.clearWState(Qt.WState_Polished) - self.connect(self.pushButtonSend,SIGNAL("clicked()"),self.pushButtonSend_clicked) self.connect(self.Form1QuitAction,SIGNAL("activated()"),self.Form1Quit_activate) self.connect(self.Form1AboutAction,SIGNAL("activated()"),self.Form1About_activate) - self.connect(self.pushButtonAdress,SIGNAL("clicked()"),self.pushButtonAdress_clicked) - self.connect(self.lineEditTo,SIGNAL("selectionChanged()"),self.lineEditTo_selectionChanged) self.connect(self.Form1HelpAction,SIGNAL("activated()"),self.Form1Help_activate) def languageChange(self): ! self.setCaption(self.__tr("GmailAgent - Send your picture with Gmail")) ! self.pushButtonSend.setText(self.__tr("Send")) ! self.textLabel4.setText(self.__tr("Attachments:")) ! self.textLabel5.setText(self.__tr("Type your message below:")) self.groupBox1.setTitle(self.__tr("Recipient")) self.textLabel1.setText(self.__tr("To :")) ! self.textLabel2.setText(self.__tr("Subject:")) self.pushButtonAdress.setText(self.__tr("Adressbook")) QToolTip.add(self.pushButtonAdress,self.__tr("Open the addressbook")) ! QToolTip.add(self.lineEditTo,QString.null) self.Action.setText(self.__tr("Unnamed")) self.Form1HelpAction.setText(self.__tr("&Help")) --- 97,122 ---- self.languageChange() ! self.resize(QSize(522,544).expandedTo(self.minimumSizeHint())) self.clearWState(Qt.WState_Polished) self.connect(self.Form1QuitAction,SIGNAL("activated()"),self.Form1Quit_activate) self.connect(self.Form1AboutAction,SIGNAL("activated()"),self.Form1About_activate) self.connect(self.Form1HelpAction,SIGNAL("activated()"),self.Form1Help_activate) + self.connect(self.pushButtonSend,SIGNAL("clicked()"),self.pushButtonSend_clicked) + self.connect(self.lineEditTo,SIGNAL("selectionChanged()"),self.lineEditTo_selectionChanged) + self.connect(self.pushButtonAdress,SIGNAL("clicked()"),self.pushButtonAdress_clicked) def languageChange(self): ! self.setCaption(self.__tr("GmailAgent - Your local email client for Gmail")) self.groupBox1.setTitle(self.__tr("Recipient")) self.textLabel1.setText(self.__tr("To :")) ! QToolTip.add(self.lineEditTo,QString.null) self.pushButtonAdress.setText(self.__tr("Adressbook")) QToolTip.add(self.pushButtonAdress,self.__tr("Open the addressbook")) ! self.textLabel2.setText(self.__tr("Subject:")) ! self.groupBox7.setTitle(self.__tr("Attachments:")) ! self.groupBox8.setTitle(self.__tr("Message:")) ! self.pushButtonSend.setText(self.__tr("Send you message")) self.Action.setText(self.__tr("Unnamed")) self.Form1HelpAction.setText(self.__tr("&Help")) Index: HelpDialog_forms.py =================================================================== RCS file: /cvsroot/gmailagent/GA-main/HelpDialog_forms.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** HelpDialog_forms.py 14 Sep 2005 15:23:45 -0000 1.14 --- HelpDialog_forms.py 2 Oct 2005 09:24:54 -0000 1.15 *************** *** 3,7 **** # Form implementation generated from reading ui file 'HelpDialog.ui' # ! # Created: Wed Sep 14 17:23:00 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:20:56 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.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** LoginDialog_forms.py 14 Sep 2005 15:23:45 -0000 1.28 --- LoginDialog_forms.py 2 Oct 2005 09:24:54 -0000 1.29 *************** *** 3,7 **** # Form implementation generated from reading ui file 'LoginDialog.ui' # ! # Created: Wed Sep 14 17:23:00 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:20:56 2005 # by: The PyQt User Interface Compiler (pyuic) 3.14.1 # --- AddressDialog.ui DELETED --- --- AddressEditorDialog.ui DELETED --- --- AddressEditDialog.ui.h DELETED --- |
From: Stas Z. <sta...@us...> - 2005-09-28 12:41:42
|
Update of /cvsroot/gmailagent/GA-main In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26598 Modified Files: Gmail.py GuiQT.py INSTALL Removed Files: libgmail.py Log Message: minor fixes Index: GuiQT.py =================================================================== RCS file: /cvsroot/gmailagent/GA-main/GuiQT.py,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** GuiQT.py 14 Sep 2005 15:23:45 -0000 1.37 --- GuiQT.py 28 Sep 2005 12:41:27 -0000 1.38 *************** *** 19,23 **** # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! GQ_DEBUG = 1 from qt import * --- 19,23 ---- # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! GQ_DEBUG = 0 from qt import * *************** *** 237,245 **** --- 237,248 ---- self.lineEditLogin.setText(log) self.lineEditPass.setText(pas) + self.butlogin_state = 0# used to signal button is pushed. (It sucks, it's a quick hack) self.setModal(1) self.show() def pushButtonLogin_clicked(self): + if self.butlogin_state: return print "FormLogin.pushButtonLogin_clicked()" + self.butlogin_state = 1 log = str(self.lineEditLogin.text()) pas = str(self.lineEditPass.text()) *************** *** 274,280 **** --- 277,285 ---- "Error", result[1], QMessageBox.Ok) + self.butlogin_state = 0 def pushButtonCancel_clicked(self): print "FormLogin.pushButtonCancel_clicked()" + self.butlogin_state = 0 self.done(1) def checkBoxPass_toggled(self,a0): *************** *** 338,342 **** if conlist: self._load(conlist) - print "AddressBookDialog conlist",conlist self.show() --- 343,346 ---- --- libgmail.py DELETED --- Index: INSTALL =================================================================== RCS file: /cvsroot/gmailagent/GA-main/INSTALL,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** INSTALL 14 May 2005 06:10:20 -0000 1.5 --- INSTALL 28 Sep 2005 12:41:27 -0000 1.6 *************** *** 12,15 **** --- 12,16 ---- Python-dev Python-qt3 (pyQT3) + libgmail If you have problems with GmailAgent or just want to talk to me :-) Index: Gmail.py =================================================================== RCS file: /cvsroot/gmailagent/GA-main/Gmail.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Gmail.py 14 Sep 2005 11:36:28 -0000 1.20 --- Gmail.py 28 Sep 2005 12:41:27 -0000 1.21 *************** *** 22,26 **** access gcm stuff.""" ! GM_DEBUG = 1 import libgmail,urllib2,logging,ConfigParser,os try: --- 22,26 ---- access gcm stuff.""" ! GM_DEBUG = 0 import libgmail,urllib2,logging,ConfigParser,os try: |
From: Stas Z. <sta...@us...> - 2005-09-28 12:40:25
|
Update of /cvsroot/gmailagent/GA-Qgcm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26171 Modified Files: Contrgcm.py GuiQTgcm.py MakeTarBall.py QgcmDialogs.py README TODO filelist setup.py Log Message: Bunch of little fixes Index: MakeTarBall.py =================================================================== RCS file: /cvsroot/gmailagent/GA-Qgcm/MakeTarBall.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MakeTarBall.py 10 Aug 2005 14:42:47 -0000 1.1 --- MakeTarBall.py 28 Sep 2005 12:40:09 -0000 1.2 *************** *** 15,32 **** myFiles = filelist.readlines() myFolders = folderlist.readlines() ! os.system('mkdir gcm-qt_%s' % VERSION) for file in myFiles: ! os.system('cp %s gcm-qt_%s' % (file[:-1], VERSION)) for folder in myFolders: ! os.system('mkdir gcm-qt_%s/%s' % (VERSION, folder[:-1])) ! os.system('cp -r %s gcm-qt_%s' % (folder[:-1], VERSION)) # removing the CVS stuff ! os.path.walk('gcm-qt_%s' % VERSION,cleanup,None) print "\nCreate a GNU/Linux tarball..." try: ! execString = 'tar -czf gcm-qt_%s.tgz gcm-qt_%s/' % (VERSION, VERSION) print execString os.system(execString) --- 15,32 ---- myFiles = filelist.readlines() myFolders = folderlist.readlines() ! os.system('mkdir gca-qt_%s' % VERSION) for file in myFiles: ! os.system('cp %s gca-qt_%s' % (file[:-1], VERSION)) for folder in myFolders: ! os.system('mkdir gca-qt_%s/%s' % (VERSION, folder[:-1])) ! os.system('cp -r %s gca-qt_%s' % (folder[:-1], VERSION)) # removing the CVS stuff ! os.path.walk('gca-qt_%s' % VERSION,cleanup,None) print "\nCreate a GNU/Linux tarball..." try: ! execString = 'tar -czf gca-qt_%s.tgz gca-qt_%s/' % (VERSION, VERSION) print execString os.system(execString) *************** *** 38,42 **** print "Create a Windows compatible zipfile..." try: ! execString = 'zip -rq gcm-qt_%s.zip ./gcm-qt_%s' % (VERSION, VERSION) print execString os.system(execString) --- 38,42 ---- print "Create a Windows compatible zipfile..." try: ! execString = 'zip -rq gca-qt_%s.zip ./gca-qt_%s' % (VERSION, VERSION) print execString os.system(execString) *************** *** 45,47 **** else: print "Done\n" ! os.system('rm -rf gcm-qt_%s' % VERSION) --- 45,47 ---- else: print "Done\n" ! os.system('rm -rf gca-qt_%s' % VERSION) Index: Contrgcm.py =================================================================== RCS file: /cvsroot/gmailagent/GA-Qgcm/Contrgcm.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Contrgcm.py 28 Sep 2005 09:14:58 -0000 1.3 --- Contrgcm.py 28 Sep 2005 12:40:09 -0000 1.4 *************** *** 181,186 **** database. When the db exist it will be updated else it will be created. It return a list of tuples containing the contacts. """ - if CG_DEBUG: logging.debug("\n>>>>>>>> Function: import_contacts_gmail") if not self.ga: return None try: --- 181,188 ---- database. When the db exist it will be updated else it will be created. It return a list of tuples containing the contacts. + This will also set two attributes: + self.gm_contacts - a libgmail GmailContactList object + self.gm_allcontacts - a libgmail GmailContactList.contactslist """ if not self.ga: return None try: *************** *** 203,206 **** --- 205,209 ---- self._DBase._store_value(conitem[3],conitem) if CG_DEBUG > 1: logging.debug("Database values %s" % self._DBase._get_all_values()) + self.gm_allcontacts = contacts return conlist *************** *** 259,267 **** def export_contacts(self,file): ! """export_contacts --> True on succes, False on faillure. Export contacts into the VCard format to a file. @file must be a valid path writable by the user. """ ! pass def sync_contacts(self): --- 262,283 ---- def export_contacts(self,file): ! """export_contacts --> tuple True on succes, False on faillure. Export contacts into the VCard format to a file. @file must be a valid path writable by the user. """ ! # refresh contacts list. self.gm_contacts will hold the contacts objects ! # so we don't care about the returnt contacts list. ! self.import_contacts_gmail() ! vc = [] ! for cnt in self.gm_allcontacts: ! vc.append(cnt.getVCard()) ! try: ! f = open(file,'w') ! f.write("".join(vc)) ! f.close() ! except Exception,info: ! print info ! return (False,str(info)) ! return (True,) def sync_contacts(self): Index: QgcmDialogs.py =================================================================== RCS file: /cvsroot/gmailagent/GA-Qgcm/QgcmDialogs.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** QgcmDialogs.py 28 Sep 2005 09:14:58 -0000 1.2 --- QgcmDialogs.py 28 Sep 2005 12:40:09 -0000 1.3 *************** *** 46,49 **** --- 46,50 ---- self.keepsettings = 0 self.ga = None + self.butlogin_state = 0# used to signal button is pushed. (It sucks, it's a quick hack) # Try to get the data from a rcfile result = Contrgcm.load_login() *************** *** 63,66 **** --- 64,68 ---- if not log or not pas: return + self.butlogin_state = 1 self._do_login(log,pas) *************** *** 86,89 **** --- 88,92 ---- "Error", "Failed to store the login data to disk", QMessageBox.Ok) + self.butlogin_state = 0 self.done(retval) *************** *** 91,94 **** --- 94,98 ---- return self.ga def pushButtonCancel_clicked(self): + self.butlogin_state = 0 self.done(False) def checkBoxPass_toggled(self,a0): Index: filelist =================================================================== RCS file: /cvsroot/gmailagent/GA-Qgcm/filelist,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** filelist 28 Sep 2005 09:14:58 -0000 1.3 --- filelist 28 Sep 2005 12:40:09 -0000 1.4 *************** *** 5,8 **** --- 5,9 ---- MainWinContacts_forms.py ModalPopUpDialog_forms.py + AboutDialog_forms.py Observers.py QgcmDialogs.py *************** *** 10,13 **** --- 11,15 ---- version.py README + INSTALL setup.py __init__.py Index: README =================================================================== RCS file: /cvsroot/gmailagent/GA-Qgcm/README,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** README 10 Aug 2005 14:42:47 -0000 1.1 --- README 28 Sep 2005 12:40:09 -0000 1.2 *************** *** 1,17 **** ! gcm-qt is a GUI to manage Gmail contacts and is part of the gmailagent ! project. ! It uses the QT widgetset and libgmail, you must make sure you ! have installed libgmail and pyqt before using gcm. ! ! gmailagent: http://gmailagent.sf.net ! libgmail: http://libgmail.sf.net ! pyqt: http://www.riverbankcomputing.co.uk/pyqt ! To install gcm-qt do as root: ! ./INSTALL.sh [Enter] ! This will install gcm-qt in /usr/local/... ! You can change the installation path by editing the INSTALL.sh file. ! gcm-qt is licensed under the GPL. See the file named COPYING for more information. --- 1,8 ---- ! GContactsAgent or gca for short is a GUI to manage Gmail contacts and ! is part of the gmailagent project. ! See the file INSTALL for installation instructions. ! gca-qt is licensed under the GPL. See the file named COPYING for more information. Index: setup.py =================================================================== RCS file: /cvsroot/gmailagent/GA-Qgcm/setup.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** setup.py 28 Sep 2005 09:14:58 -0000 1.2 --- setup.py 28 Sep 2005 12:40:09 -0000 1.3 *************** *** 1,5 **** #!/usr/bin/env python # ! # This is the distutils setup script for GmailAgent. # Based on the pygame setup scripts. --- 1,5 ---- #!/usr/bin/env python # ! # This is the distutils setup script for GControlAgent. # Based on the pygame setup scripts. *************** *** 8,12 **** # pointing to this location. basepath = '/usr/local/share' ! execpath = '/usr/local/bin/gcm-qt' import version --- 8,12 ---- # pointing to this location. basepath = '/usr/local/share' ! execpath = '/usr/local/bin/gca-qt' import version *************** *** 28,32 **** import distutils except ImportError: ! raise SystemExit, "gcm-qt requires distutils (Python-dev) to build and install." #get us to the correct directory --- 28,32 ---- import distutils except ImportError: ! raise SystemExit, "gca-qt requires distutils (Python-dev) to build and install." #get us to the correct directory *************** *** 118,124 **** print "=========== Installation Ok ================" ! print "\nThe gcm-qt executable is installed in\n %s" % execpath print "You should read the README file that came with this package\nfor possible usage" print "\n Be aware that not all the functionality is yet available." ! print " The things not yet implemented are: printing of the contacts and exporting them" print "Enjoy" --- 118,127 ---- print "=========== Installation Ok ================" ! print "\nThe gca-qt executable is installed in\n %s" % execpath print "You should read the README file that came with this package\nfor possible usage" print "\n Be aware that not all the functionality is yet available." ! print " The things not yet implemented are:" ! print " printing of the contacts" ! print " help files" ! print "" print "Enjoy" Index: GuiQTgcm.py =================================================================== RCS file: /cvsroot/gmailagent/GA-Qgcm/GuiQTgcm.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GuiQTgcm.py 28 Sep 2005 09:14:58 -0000 1.2 --- GuiQTgcm.py 28 Sep 2005 12:40:09 -0000 1.3 *************** *** 20,24 **** GQ_DEBUG = 0 ! import logging from qt import * --- 20,24 ---- GQ_DEBUG = 0 ! import logging,os from qt import * *************** *** 26,30 **** from MainWinContacts_forms import FormMainWin from Observers import Observer,Observable ! from QgcmDialogs import Login,ModalPopup,AddressEditDialog import BorgSingleton # We import Contrgcm only to access it's 'load_login' function and to set the --- 26,30 ---- from MainWinContacts_forms import FormMainWin from Observers import Observer,Observable ! from QgcmDialogs import Login,ModalPopup,AddressEditDialog,About import BorgSingleton # We import Contrgcm only to access it's 'load_login' function and to set the *************** *** 123,129 **** return if not self.gaContr: ! QMessageBox.information(self, ! "Information", "Please login in your Gmail account first", ! QMessageBox.Ok) return name = str(self.selecteditem.text(0)) --- 123,127 ---- return if not self.gaContr: ! self.no_login() return name = str(self.selecteditem.text(0)) *************** *** 158,163 **** def helpAbout_activated(self): ! print "FormMainWin.helpAbout_activated(): Not implemented yet" ! def pushButtonClose_clicked(self): --- 156,160 ---- def helpAbout_activated(self): ! About(self) def pushButtonClose_clicked(self): *************** *** 180,185 **** def contactsExportcontacts_activated(self): ! print "FormMainWin.contactsExportcontacts_activated(): Not implemented yet" ! def lineEditSearchToolbar_textChanged(self,a0): print "FormMainWin.lineEditSearchToolbar_textChanged(const QString&)" --- 177,194 ---- def contactsExportcontacts_activated(self): ! if not self.gaContr: ! self.no_login() ! return ! filename=str(QFileDialog.getSaveFileName(os.path.expanduser('~'),\ ! "VCard (*.vcf);;All (*.*)",\ ! self,\ ! "FileDialog",\ ! "Choose a filename to export to")) ! result = self.gaContr.export_contacts(filename) ! if not result[0]: ! QMessageBox.critical(self, ! "Error", "An error occured while exporting contacts:\n%s" % result[1], ! QMessageBox.Ok) ! def lineEditSearchToolbar_textChanged(self,a0): print "FormMainWin.lineEditSearchToolbar_textChanged(const QString&)" *************** *** 205,209 **** def contactsImportcontacts_activated(self): - if GQ_DEBUG: logging.debug("FormMainWin.contactsImportcontacts_activated()") if not self.gaContr: dlg = Login(self.Qapplication,parent=self) --- 214,217 ---- *************** *** 218,221 **** --- 226,230 ---- def contactsPrintAction_activated(self): print "FormMainWin.contactsPrintAction_activated(): Not implemented yet" + NotYet(self,"Printing is not yet available") def contactsExit_activated(self): Index: TODO =================================================================== RCS file: /cvsroot/gmailagent/GA-Qgcm/TODO,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** TODO 7 Aug 2005 19:08:45 -0000 1.1.1.1 --- TODO 28 Sep 2005 12:40:09 -0000 1.2 *************** *** 1,3 **** ! Progressbar sucks, see releaseforge for a better solution --- 1,4 ---- ! When searching a contact by using the menu searchbar the window doesn't ! scroll up or down. Progressbar sucks, see releaseforge for a better solution |
From: Stas Z. <sta...@us...> - 2005-09-23 18:02:53
|
Update of /cvsroot/gmailagent/GA-libgmail2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12222 Added Files: mkconstants.py setup.py Log Message: added libgmail stuff --- NEW FILE: mkconstants.py --- #!/usr/bin/env python # # mkconstants.py -- Extract constants from Gmail Javascript code # # $Revision: 1.3 $ ($Date: 2005/09/23 18:02:43 $) # # Author: fol...@my... # # License: GPL 2.0 # # This tool parses the Javascript file used by Gmail, extracts # useful constants and then generates an importable Python module. # # 2004-07-11: Hmmm, this script is not really any use now because # Gmail no longer includes the constants definitions # in the Javascript... # import re import sys import time OUTPUT_FILENAME = "lgconstants.py" # These enumerations start at 1 rather than 0 -- I haven't looked into # why they're are different. We want them to work correctly for Python # sequences so we have to fudge them and subtract one from each value. # NOTE: This means we can't send these values back, but that shouldn't be # a problem. FUDGE_OFFSET_PREFIXES = ["QU", "TS", "CS", "MI", "SM", "AR"] # Used to filter out only the constants we want to use at the moment. USEFUL_PREFIXES = ["D", "T", "CT", "A"] + FUDGE_OFFSET_PREFIXES USEFUL_SUFFIXES = ["SEARCH", "START", "VIEW", "COOKIE", "THREAD", "ACTION"] USEFUL_NAMES = ["U_REFERENCED_MSG", "U_DRAFT_MSG"] RE_CONSTANTS = "var ([A-Z]{1,}_[A-Z_]+?)=(.+?);" VAR_JS_VERSION = "js_version" FMT_DEFINITION = "%s = %s\n" FILE_HEADER = """\ # # Generated file -- DO NOT EDIT # # %s -- Useful constants extracted from Gmail Javascript code # # Source version: %s # # Generated: %s # """ % (OUTPUT_FILENAME, "%s", time.strftime("%Y-%m-%d %H:%M UTC", time.gmtime())) if __name__ == "__main__": lines = [] try: inputFilename = sys.argv[1] except IndexError: print "Usage: mkconstants.py <gmail.js>" raise SystemExit print "Reading `%s`..." % inputFilename code = open(inputFilename).read() jsVersion = re.search("var %s=(.+?);" % VAR_JS_VERSION, code).group(1) lines.extend([FMT_DEFINITION % (VAR_JS_VERSION, jsVersion), "\n"]) matches = re.findall(RE_CONSTANTS, code) for name, value in matches: prefix = name[:name.index("_")] suffix = name[name.rindex("_")+1:] if prefix in USEFUL_PREFIXES or suffix in USEFUL_SUFFIXES or \ name.startswith("U_AS_") or name.startswith("U_COMPOSE") or \ name.startswith("U_ACTION_") or \ name in USEFUL_NAMES: if prefix in FUDGE_OFFSET_PREFIXES: value = int(value) - 1 lines.append(FMT_DEFINITION % (name, value)) lines.insert(0, FILE_HEADER % jsVersion.strip("'")) print "Writing `%s`..." % OUTPUT_FILENAME open(OUTPUT_FILENAME, "w").writelines(lines) print "Done." --- NEW FILE: setup.py --- #!/usr/bin/env python # Setup script for the libgmail package # Usage: # To create a source package; python setup.py sdist # To install to your system; python setup.py install from distutils.core import setup mods = ['libgmail','lgconstants'] setup (name = "libgmail", version = "0.1.3.1", description = "python bindings to access Gmail", author = "wd...@mi..., st...@li...,fol...@my...", author_email = "st...@li...", url = "http://libgmail.sourceforge.net/", license = "GPL", py_modules = mods, ) |
From: Stas Z. <sta...@us...> - 2005-09-23 17:58:17
|
Update of /cvsroot/gmailagent/GA-libgmail2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10623 Added Files: ANNOUNCE CHANGELOG COPYING MANIFEST README lgconstants.py libgmail.py testlibgmail.py Log Message: Added the libgmail files --- NEW FILE: CHANGELOG --- == Version 0.1.4 == libgmail.py * Added some attributes to the message class: cc, bcc, sender. == Version 0.1.3.1 == libgmail.py * Fixed the problem that not all the messages from a thread were returnt. --SZ-- * Added a exception catch for a "500 server error" --SZ-- == Version 0.1.3 == libgmail.py * Fixed bugs that crashes libgmail when accessing an empty account --SZ-- * Fixed returning not all the messages in large accounts. --SZ-- == Version 0.1.2 == libgmail.py * Added a \r to the line endings in the VCard export function. This is done to comply with rfc2425 section 5.8.1 --SZ-- * Fixed a security bug in the page parser. --SZ-- == Version: 0.1.1 == All * Renamed the shabang to use the 'env' program in all executables. --SZ-- * Fixed the redirect bug caused by the changed Gmail login pages. --WD-- == Version: 0.1.0 == libgmail.py * Added contacts support. --WD-- * Added contacts test suite. --WD-- * Added finer-grained debugging control --WD-- * Applied patch that handles login redirect URL properly now Login now works. --WD-- * Removed fork message. It was a left over from the initial forking. --SZ-- constants.py * Renamed to lgconstants.py to avoid name conflicts --WD-- == Version: 0.0.8 (23 August 2004) == libgmail.py * Fixed login to work again after it was broken by a Gmail change. Centralised cookie extraction. Added debug-level logging of cookie extraction & storage. * Add trash/delete message thread functionality to account object. constants.py, libgmail.py, mkconstants.py * Add trash/delete single message functionality to account object. demos/gmailpopd.py * Initial rough POP3 proxy server demo. Works with Mail.app when I tried it... :-) Sometimes causes items to be downloaded even when they don't *really* need to be. Causes some items to be marked as read even if the client doesn't actually request them. * Refactored message retrieval from account snapshot to allow partial message retrieval (for TOP functionality). * Added POP3 TOP command functionality which is required by Mozilla as it (wrongly) doesn't work with the absolute minimum command set specified by the RFC and requires TOP. * Fixed copy/paste error to change 'ftp_QUIT' to 'pop_QUIT'. * Moved byte-stuffing and message massaging into separate functions. libgmail.py, demos/archive.py, demos/gmailftpd.py, demos/gmailpopd.py, demos/gmailsmtp.py, demos/sendmsg.py * Added `GmailLoginFailure` exception to enable tidier handling of login failures (which could be bad username/password or a Gmail change). * Updated demos to catch `GmailLoginFailure` exception. * Removed non-supported "LOGIN" authentication method in SMTP demo that was included in the server capability response in error. ANNOUNCE * Minor typo fix. == Version: 0.0.7 (03 August 2004) == constants.py, mkconstants.py * Added attachment related constants. libgmail.py, demos/gmailsmtp.py * Allow file data to be specified directly (rather than via an on- disk file) when specifying attachments (this allows using existing Message instance payloads mostly directly). Modify SMTP Proxy demo to handle sending attachments. demos/gmailftpd.py * Initial import of Gmail attachments FTP Proxy! libgmail.py * Corrected version info for previous release. * Added 'getMessagesByQuery' function. Added initial attachment retrieval handling. Clean up handling of references to parent objects & account objects. Version info update. * Handle sending attachments. Works, but implementation is extremely *cough* sub-optimal... * Don't try to attach files if there are none. == Version: 0.0.6 (15 July 2004) == demos/gmailsmtp.py * That was too easy, there oughta be a law! Thanks to Python's undocumented SMTP server module we can now send mail with a standard mail client via (E)SMTP. Extended standard SMTP class to handle ESMTP EHLO & AUTH PLAIN commands. libgmail.py * Added utility function '_retrieveJavascript' to 'GmailAccount' to help developers who want to look at it. (In theory also so you can regenerate 'constants.py' but the Javascript Gmail now uses isn't actually useful for that anymore...) (Added by request.) == Version: 0.0.5 (11 July 2004) == libgmail.py, demos/sendmsg.py * Added functionality to enable message sending. Modified automatic cookie handling. Added command line example to send a message. Enabled page requests to be either a URL or a Request instance. constants.py, mkconstants.py * Added more useful constants. == Version: 0.0.4 (11 July 2004) == constants.py, mkconstants.py * Include standard folder/search name constants. * Add more useful constants. constants.py, libgmail.py, mkconstants.py * Added category name retrieval. mkconstants.py * 'mkconstants' isn't really useful anymore with the new JS version. libgmail.py * Add ability to get number of unread messages. * Handle items that might be 'bunched' such as thread lists better. * Only warn about mismatched Javascript versions once module import. (Note: This may mean the Javascript version may change more than once in a session and the second change won't be warned, but that shouldn't be much of an issue...) * Refactor URL construction. Refactor query/search operation in preparation for adding searches. * More refactoring. Made thread search query more generic to allow use by (to come) label searches etc. Threads now belong to 'GmailSearchResult' instances rather than folders. Threads now retrieve their own messages rather than relying on their parent to do so. * We now refer to categories as labels, as the UI does. Enable retrieval by label. libgmail.py, demos/archive.py * Allow all pages of results to be returned for a 'getFolder' request. (Not tested much.) * Provide easy access to standard folder names. Added length property to folders. Examples now handle empty folders gracefully. * Now uses 'getMessagesByXXXXX' style method names for folders & labels. Now refer to original message source as 'source' & not 'body'. Enable demos to search by folder name or label name. == Version: 0.0.3 (8 July 2004) == libgmail.py * Allow username to be specified on the command line instead of prompting. * Rough special case handling of when more than one set of thread information data is present on a page (seemed to occur when using 'all' search after a certain number of items). TODO: Make this fix work at the page parsing level, but splitting all tuples into individual items. * Add cookie handling code to enable us to remove requirement for ClientCookie package. (Especially for Adrian... :-) ) demos/archive.py * *Extremely* rough mbox creation--turns out the mails retrieved had '\r' characters at the end of the headers. The mbox file appears to be successfully imported by OS X's Mail.app client. * Allow username to be specified on the command line instead of prompting. == Version: 0.0.2a (~6 July 2004) == * No code change, renamed to try to avoid SourceForge mirroring problems. == Version: 0.0.2 (5 July 2004) == constants.py * Useful constants from the Gmail Javascript code as Python module. * Update to match current live Javascript. * Fudge some enumerations that we need to start at 0. libgmail.py * Refactor to make use of Folder/Thread/Message model. Standardised some naming. Make use of imported Gmail constants. Centralise page retrieval & parsing. * Calculate number of messages in thread. * Refactor & reorganise code. Minor style edits. Refine design of folder, thread & message classes. Modify folders, threads & messages to be as lazy as possible when it comes to retrieving data from the net. Enable message instances to retrieve their original mail text. Add Gmail implementation notes. Hide password entry. Demo now displays threads & messages. * Version date change. mkconstants.py * Tool to make useful constants from the Gmail Javascript code available via a Python module. * Fudge some enumerations that we need to start at 0. demos/archive.py * Initial rough demo to archive all messages into text files. CHANGELOG * Added. == Version: 0.0.1 (2 July 2004) == libgmail.py * Initial import of version 0.0.1 (as posted in comp.lang.python). --- NEW FILE: MANIFEST --- COPYING README CHANGELOG lgconstants.py libgmail.py setup.py --- NEW FILE: testlibgmail.py --- #!/usr/bin/env python """ libgmail test suite Tests: Contacts """ import unittest from libgmail import * import getpass class ContactsTests(unittest.TestCase): """ Set of tests that exercise the contacts portion of libgmail """ def setUp(self): """ Delete all entries in the addressbook so we start fresh """ #print "Setting up!" contacts = account.getContacts().getAllContacts() for contact in contacts: # print "Removing", contact account.removeContact(contact) def tearDown(self): """ Delete all entries in the addressbook so we start fresh """ #print "Tearing down!" contacts = account.getContacts().getAllContacts() for contact in contacts: # print "Removing", contact account.removeContact(contact) def test1_BasicAddContact(self): """Create and retrieve an entry-level contact""" name = 'John Smith' email = 'joh...@gm...' notes = 'I am average' account.addContact(name, email, notes) myContacts = account.getContacts() contact = myContacts.getContactByName(name) self.assertEqual(contact.getName(), name, "Returned name isn't the one we created initially") self.assertEqual(contact.getEmail(), email, "Returned email isn't the one we created initially") self.assertEqual(contact.getNotes(), notes, "Returned note isn't the one we created initially") ## Coomented out by stas ## The multiline notes support is not yet implemented in libgmail ## def test2_AdvancedAddContact(self): ## """Create and retrieve a contact with a newline in the notes""" ## name = 'W4533m' ## email = 'fak...@gm...' ## notes = 'Is\nawesome' ## account.addContact(name, email, notes) ## myContacts = account.getContacts() ## contact = myContacts.getContactByName(name) ## self.assertEqual(contact.getName(), name, "Returned name isn't the one we created initially") ## self.assertEqual(contact.getEmail(), email, "Returned email isn't the one we created initially") ## ## print "Returned notes is: ", contact.getNotes() ## print "Desired notes was: " + notes ## ## self.assertEqual(contact.getNotes(), notes, "Returned note isn't the one we created initially") def test3_GmailContact(self): """Check that GmailContact equality and accessor methods work""" w = GmailContact('a','b','c','d') x = GmailContact('x','y','z') y = GmailContact('a','b','c','d') z = GmailContact('a','b','c','d') self.assertEqual(w,w, "%s doesn't equals %s" % (w,w)) self.assertEqual(x,x, "%s doesn't equals %s" % (x,x)) self.assertEqual(y,y, "%s doesn't equals %s" % (y,y)) self.assertEqual(z,z, "%s doesn't equals %s" % (z,z)) self.assertEqual(w,y, "%s doesn't equals %s" % (w,y)) self.assertEqual(y,z, "%s doesn't equals %s" % (y,z)) self.assertEqual(w,z, "%s doesn't equals %s" % (w,z)) self.assertEqual(z,w, "%s doesn't equals %s" % (z,w)) self.assertNotEqual(w,x, "%s shouldn't equals %s" % (w,x)) self.assertNotEqual(x,w, "%s shouldn't equals %s" % (x,w)) i,a,e,n = w.getId(),w.getName(),w.getEmail(),w.getNotes() self.assertEqual(i, 'a', "%s doesn't equals 'a'" % i) self.assertEqual(a, 'b', "%s doesn't equals 'b'" % a) self.assertEqual(e, 'c', "%s doesn't equals 'c'" % e) self.assertEqual(n, 'd', "%s doesn't equals 'd'" % n) self.assertEqual(x.getNotes(), '', "getNotes() should return ''") def test4_GetBy(self): """Get a contact by name, email, and id""" account.addContact('Waseem', 'wd...@gm...', 'Is awesome') myContacts = account.getContacts() waseem = myContacts.getContactByName('Waseem') self.assertEqual(waseem, myContacts.getContactByEmail('wd...@gm...')) self.assertEqual(waseem, myContacts.getContactById(waseem.getId())) def test5_GetByLists(self): """Get a contact list by name, email, and id""" account.addContact('Waseem', 'wd...@gm...', 'Is awesome') account.addContact('Daher', 'te...@fo...r') myContacts = account.getContacts() waseem = myContacts.getContactByName('Waseem') result = [waseem] obj = myContacts.getContactListByName('Waseem') self.assertEqual(result, obj, "%s doesn't equals %s" % (result,obj)) obj = myContacts.getContactListByEmail('wd...@gm...') self.assertEqual([waseem], obj,"%s doesn't equals %s" % (result,obj)) obj = myContacts.getContactListById(waseem.getId()) self.assertEqual([waseem], obj,"%s doesn't equals %s" % (result,obj)) def test6_SmallGetAndRemove(self): """Add one address and remove it again""" count = 1 # Add some for x in range(count): account.addContact(str(x), str(x)) myContactList = account.getContacts() self.assertEqual(myContactList.getCount(), count) # Now remove them all for x in range(count): self.assertEqual(True, account.removeContact(myContactList.getContactByName(str(x)))) myContactList = account.getContacts() self.assertEqual(myContactList.getCount(), 0) ## MediumGetAndRemove and LargeGetAndRemove pound ## gmail's servers faster than they'd like to be accessed, ## so this usually gets our account suspended, it seems. ## If you really want to test that these large gets/sets work, ## maybe insert a delay and run them? Doesn't really make ## sense to run them every time though # def test7_MediumGetAndRemove(self): # """Add 14 addresses and remove them again""" # count = 14 # for x in range(count): # account.addContact(str(x), str(x)) # myContactList = account.getContacts() # self.assertEqual(myContactList.getCount(), count) # # Now remove them all # for x in range(count): # self.assertTrue(account.removeContact(myContactList.getContactByName(str(x)))) # myContactList = account.getContacts() # self.assertEqual(myContactList.getCount(), 0) # def test8_LargeGetAndRemove(self): # """Add 25 addresses and remove them again""" # count = 25 # for x in range(count): # account.addContact(str(x), str(x)) # myContactList = account.getContacts() # self.assertEqual(myContactList.getCount(), count) # # Now remove them all # for x in range(count): # self.assertTrue(account.removeContact(myContactList.getContactByName(str(x)))) # myContactList = account.getContacts() # self.assertEqual(myContactList.getCount(), 0) ## Commented out by stas ## It fails due to wrong testing ? ## ## def test9_vCard(self): ## """Test vCard export""" ## waseem = GmailContact("0", "Waseem Daher", "wd...@mi...", "GmailAgent developer") ## vcard = waseem.getVCard() ## expectedVCard="""BEGIN:VCARD ##VERSION:3.0 ##NOTE:GmailAgent developer ##N:Daher;Waseem ##FN:Waseem Daher ##EMAIL;TYPE=INTERNET:wd...@mi... ##END:VCARD ## ##""" ## self.assertEqual(vcard, expectedVCard, "getVCard() did not export what we expected for Waseem") ## ## # Test multi-line NOTEs ## bob = GmailContact("0", "BillyJo", "bi...@jo...", "I like multilines\nwoo") ## bobvcard=bob.getVCard() ## bobexpectedVCard="""BEGIN:VCARD ##VERSION:3.0 ##NOTE:I like multilines\\nwoo ##N:BillyJo ##FN:BillyJo ##EMAIL;TYPE=INTERNET:bi...@jo... ##END:VCARD ##""" ## self.assertEqual(vcard, expectedVCard, "getVCard() didn't export what we expected for BillyJo") if __name__ == '__main__': #unittest.main() ## With this we get a better output print "\n==============================================" print "Start 'libgmail contacts' testsuite" print "------------------------------------------------\n" print "WARNING: THIS WILL DELETE/REARRANGE" print " YOUR ADDRESSBOOK/EMAILS" print " BE SURE TO RUN THIS TEST ONLY ON A 'test' ACCOUNT" name = raw_input("Gmail account name:") pw = getpass.getpass("Password: ") account = GmailAccount(name, pw) try: account.login() print "Login successful.\n" except GmailLoginFailure,e: print "\nLogin failed. (%s)" % e.message else: suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(ContactsTests)) unittest.TextTestRunner(verbosity=2).run(suite) --- NEW FILE: COPYING --- GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> 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 Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. --- NEW FILE: README --- libgmail is licensed under the GPL. See the file named COPYING for more information. Please refer to the libgmail website or project page at sourceforge if you encouter problems using libgmail. http://libgmail.sf.net http://sourceforge.net/projects/libgmail/ You can contact us by email: stas AT linux DOT isbeter DOT nl wdaher AT mit DOT edu follower AT myrealbox DOT com ----------------------------------------------- Possible usage: Run this: python libgmail.py When you have the demos package installed you could do this: python demos/archive.py or even this: python demos/sendmsg.py <account> <to address> <subject> <body> or perhaps this: python demos/gmailsmtp.py # (Then connect to SMTP proxy on local port 8025) or how about this: python demos/gmailftpd.py # (Then connect to FTP proxy on local port 8021, # after creating a label named 'ftp' and # applying it to some messages with attachments.) or maybe this: python demos/gmailpopd.py # (Then connect to POP3 proxy on local port 8110) for hours of fun!(*) (*) Note: Fun may not last for hours. Use at your own risk, blah, blah, etc... --- NEW FILE: ANNOUNCE --- ANN: libgmail 0.0.8 - Gmail access via Python - POP3 Proxy added! libgmail -- Python binding for Google's Gmail service <http://libgmail.sf.net/> The `libgmail` project is a pure Python binding to provide access to Google's Gmail web-mail service. The library currently ships with a demonstration utility to archive messages from a Gmail account into mbox files, suitable for importing into a local email client. Also includes a demonstration utility that acts as a SMTP proxy to allow mail to be sent from any standard mail client that uses SMTP (e.g. Mail.app, Mozilla etc). (Now handles attachments.) New demonstration utility acts as a POP3 proxy to allow mail to be retrieved from any standard mail client that uses POP3 (e.g. Mail.app, Mozilla etc). Features demonstration utility to provide access to Gmail message attachments via a download-only FTP proxy--this allows retrieval of suitably marked attachments by a standard FTP client. Utilize more of your Gmail space! License: GPL 2.0 (gmailftpd.py/gmailpopd.py are dual licensed with PSF) Major changes since 0.0.7: * Fixed login to work again after it was broken by a Gmail change. * Added trash/delete message thread & trash/delete single message functionality. (By request.) * POP3 proxy server demo. (By request.) * Added `GmailLoginFailure` exception to enable tidier handling of login failures (which could be bad username/password or a Gmail change). <p><a href="http://libgmail.sf.net/">libgmail 0.0.8</a> - The `libgmail` project is a pure Python binding to provide access to Google's Gmail web-mail service; includes SMTP, POP3 & FTP proxies. (23-Aug-04)</p> --- NEW FILE: libgmail.py --- #!/usr/bin/env python # # libgmail -- Gmail access via Python # ## To get the version number of the available libgmail version. ## Reminder: add date before next release. Version = '0.0.0' # (sep 2005) print "\n Be aware that your running a special 'Greg' version of libgmail\n" # Original author: fol...@my... # Maintainers: Waseem (wd...@mi...) and Stas Z (st...@li...) # # Contacts support added by wd...@mi... and Stas Z # (with massive initial help from # Adrian Holovaty's 'gmail.py' # and the Johnvey Gmail API) # # License: GPL 2.0 # [...1472 lines suppressed...] print "No threads found in `%s`." % name break tot = len(result._threads) i = 0 for thread in result: #print thread.id, len(thread), thread.subject for msg in thread: print "\n ", msg.id, msg.number, msg.author,msg.subject print " ", msg.cc, msg.bcc,msg.sender print "\nraw message:\n",msg._getSource() i += 1 print print "number of threads:",tot print "number of messages:",i except KeyboardInterrupt: break print "\n\nDone." --- NEW FILE: lgconstants.py --- # # Generated file -- DO NOT EDIT # # Note: This file is now edited! 2005-04-25 # # constants.py -- Useful constants extracted from Gmail Javascript code # # Source version: 44f09303f2d4f76f # # Generated: 2004-08-10 13:08 UTC # js_version = '44f09303f2d4f76f' D_VERSION = "v" D_QUOTA = "qu" D_DEFAULTSEARCH_SUMMARY = "ds" D_THREADLIST_SUMMARY = "ts" D_THREADLIST_END = "te" D_THREAD = "t" D_CONV_SUMMARY = "cs" D_CONV_END = "ce" D_MSGINFO = "mi" D_MSGBODY = "mb" D_MSGATT = "ma" D_COMPOSE = "c" D_CONTACT = "co" D_CATEGORIES = "ct" D_CATEGORIES_COUNT_ALL = "cta" D_ACTION_RESULT = "ar" D_SENDMAIL_RESULT = "sr" D_PREFERENCES = "p" D_PREFERENCES_PANEL = "pp" D_FILTERS = "fi" D_GAIA_NAME = "gn" D_INVITE_STATUS = "i" D_END_PAGE = "e" D_LOADING = "l" D_LOADED_SUCCESS = "ld" D_LOADED_ERROR = "le" D_QUICKLOADED = "ql" QU_SPACEUSED = 0 QU_QUOTA = 1 QU_PERCENT = 2 QU_COLOR = 3 TS_START = 0 TS_NUM = 1 TS_TOTAL = 2 TS_ESTIMATES = 3 TS_TITLE = 4 TS_TIMESTAMP = 5 + 1 TS_TOTAL_MSGS = 6 + 1 T_THREADID = 0 T_UNREAD = 1 T_STAR = 2 T_DATE_HTML = 3 T_AUTHORS_HTML = 4 T_FLAGS = 5 T_SUBJECT_HTML = 6 T_SNIPPET_HTML = 7 T_CATEGORIES = 8 T_ATTACH_HTML = 9 T_MATCHING_MSGID = 10 T_EXTRA_SNIPPET = 11 CS_THREADID = 0 CS_SUBJECT = 1 CS_TITLE_HTML = 2 CS_SUMMARY_HTML = 3 CS_CATEGORIES = 4 CS_PREVNEXTTHREADIDS = 5 CS_THREAD_UPDATED = 6 CS_NUM_MSGS = 7 CS_ADKEY = 8 CS_MATCHING_MSGID = 9 MI_FLAGS = 0 MI_NUM = 1 MI_MSGID = 2 MI_STAR = 3 MI_REFMSG = 4 MI_AUTHORNAME = 5 MI_AUTHORFIRSTNAME = 6 # ? -- Name supplied by rj MI_AUTHOREMAIL = 6 + 1 MI_MINIHDRHTML = 7 + 1 MI_DATEHTML = 8 + 1 MI_TO = 9 + 1 MI_CC = 10 + 1 MI_BCC = 11 + 1 MI_REPLYTO = 12 + 1 MI_DATE = 13 + 1 MI_SUBJECT = 14 + 1 MI_SNIPPETHTML = 15 + 1 MI_ATTACHINFO = 16 + 1 MI_KNOWNAUTHOR = 17 + 1 MI_PHISHWARNING = 18 + 1 A_ID = 0 A_FILENAME = 1 A_MIMETYPE = 2 A_FILESIZE = 3 CT_NAME = 0 CT_COUNT = 1 AR_SUCCESS = 0 AR_MSG = 1 SM_COMPOSEID = 0 SM_SUCCESS = 1 SM_MSG = 2 SM_NEWTHREADID = 3 CMD_SEARCH = "SEARCH" ACTION_TOKEN_COOKIE = "GMAIL_AT" U_VIEW = "view" U_PAGE_VIEW = "page" U_THREADLIST_VIEW = "tl" U_CONVERSATION_VIEW = "cv" U_COMPOSE_VIEW = "cm" U_PRINT_VIEW = "pt" U_PREFERENCES_VIEW = "pr" U_JSREPORT_VIEW = "jr" U_UPDATE_VIEW = "up" U_SENDMAIL_VIEW = "sm" U_AD_VIEW = "ad" U_REPORT_BAD_RELATED_INFO_VIEW = "rbri" U_ADDRESS_VIEW = "address" U_ADDRESS_IMPORT_VIEW = "ai" U_SPELLCHECK_VIEW = "sc" U_INVITE_VIEW = "invite" U_ORIGINAL_MESSAGE_VIEW = "om" U_ATTACHMENT_VIEW = "att" U_DEBUG_ADS_RESPONSE_VIEW = "da" U_SEARCH = "search" U_INBOX_SEARCH = "inbox" U_STARRED_SEARCH = "starred" U_ALL_SEARCH = "all" U_DRAFTS_SEARCH = "drafts" U_SENT_SEARCH = "sent" U_SPAM_SEARCH = "spam" U_TRASH_SEARCH = "trash" U_QUERY_SEARCH = "query" U_ADVANCED_SEARCH = "adv" U_CREATEFILTER_SEARCH = "cf" U_CATEGORY_SEARCH = "cat" U_AS_FROM = "as_from" U_AS_TO = "as_to" U_AS_SUBJECT = "as_subj" U_AS_SUBSET = "as_subset" U_AS_HAS = "as_has" U_AS_HASNOT = "as_hasnot" U_AS_ATTACH = "as_attach" U_AS_WITHIN = "as_within" U_AS_DATE = "as_date" U_AS_SUBSET_ALL = "all" U_AS_SUBSET_INBOX = "inbox" U_AS_SUBSET_STARRED = "starred" U_AS_SUBSET_SENT = "sent" U_AS_SUBSET_DRAFTS = "drafts" U_AS_SUBSET_SPAM = "spam" U_AS_SUBSET_TRASH = "trash" U_AS_SUBSET_ALLSPAMTRASH = "ast" U_AS_SUBSET_READ = "read" U_AS_SUBSET_UNREAD = "unread" U_AS_SUBSET_CATEGORY_PREFIX = "cat_" U_THREAD = "th" U_PREV_THREAD = "prev" U_NEXT_THREAD = "next" U_DRAFT_MSG = "draft" U_START = "start" U_ACTION = "act" U_ACTION_TOKEN = "at" U_INBOX_ACTION = "ib" U_MARKREAD_ACTION = "rd" U_MARKUNREAD_ACTION = "ur" U_MARKSPAM_ACTION = "sp" U_UNMARKSPAM_ACTION = "us" U_MARKTRASH_ACTION = "tr" U_ADDCATEGORY_ACTION = "ac_" U_REMOVECATEGORY_ACTION = "rc_" U_ADDSTAR_ACTION = "st" U_REMOVESTAR_ACTION = "xst" U_ADDSENDERTOCONTACTS_ACTION = "astc" U_DELETEMESSAGE_ACTION = "dm" U_DELETE_ACTION = "dl" U_EMPTYSPAM_ACTION = "es_" U_EMPTYTRASH_ACTION = "et_" U_SAVEPREFS_ACTION = "prefs" U_ADDRESS_ACTION = "a" U_CREATECATEGORY_ACTION = "cc_" U_DELETECATEGORY_ACTION = "dc_" U_RENAMECATEGORY_ACTION = "nc_" U_CREATEFILTER_ACTION = "cf" U_REPLACEFILTER_ACTION = "rf" U_DELETEFILTER_ACTION = "df_" U_ACTION_THREAD = "t" U_ACTION_MESSAGE = "m" U_ACTION_PREF_PREFIX = "p_" U_REFERENCED_MSG = "rm" U_COMPOSEID = "cmid" U_COMPOSE_MODE = "cmode" U_COMPOSE_SUBJECT = "su" U_COMPOSE_TO = "to" U_COMPOSE_CC = "cc" U_COMPOSE_BCC = "bcc" U_COMPOSE_BODY = "body" U_PRINT_THREAD = "pth" CONV_VIEW = "conv" TLIST_VIEW = "tlist" PREFS_VIEW = "prefs" HIST_VIEW = "hist" COMPOSE_VIEW = "comp" HIDDEN_ACTION = 0 USER_ACTION = 1 BACKSPACE_ACTION = 2 |
From: Stas Z. <sta...@us...> - 2005-09-23 17:58:15
|
Update of /cvsroot/gmailagent/GA-libgmail2/demos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10623/demos Added Files: COPYING MakeTarBall.py README archive.py filelist folderlist gcp.py gmailftpd.py gmailpopd.py gmailsmtp.py sendmsg.py test_fwd_attach.py test_notifier.py unreadmsgcount.py Log Message: Added the libgmail files --- NEW FILE: test_notifier.py --- #!/usr/bin/env python # # Rough first draft code to use "official" Gmail Notifier protocol # # Author: fol...@my... # # License: GPL 2.0 # # Obviously this all needs to be turned into something state-machiney # eventually. # # ObBlah: This program is for educational or interoperability purposes. # import os import sys # Allow us to run using installed `libgmail` or the one in parent directory. try: import libgmail logging.warn("Note: Using currently installed `libgmail` version.") except ImportError: # Urghhh... sys.path.insert(1, os.path.realpath(os.path.join(os.path.dirname(__file__), os.path.pardir))) import libgmail r = '\n\x82\x02\x10\x93\xdd\xf8\xab\x87\x99\xa7\xf5\x0f\x18\xc9\x8c\xb2\xce\xea\x1f\x82\x01\x04^all\x82\x01\x02^f\x82\x01\x02^i\x82\x01\x02^u\x92\x01\x1e\n\x18\n\x12...@gm...\x12\x02me\x10\x01\x18\x01\x98\x01\x02\xa2\x01\x97\x01[Test] This is a really really really really really really really really blah blah blah blah long subject line blah blah 123456789012345678901234567890\xaa\x01\x16So, did you see it all\xb8\x01\x01\n\xfa\x01\x10\xd0\x8a\xb8\x97\xf5\xcd\xa4\xf5\x0f\x18\xbd\xea\x9b\xc9\xea\x1f\x82\x01\x04^all\x82\x01\x02^i\x82\x01\x02^u\x92\x01,\n&\n\x18...@go...\x12\nGmail Team\x10\x01\x18\x01\x98\x01\x02\xa2\x014Xxxxxx Xxxxxxx has accepted your invitation to Gmail\xaa\x01iXxxxxx Xxxxxxx has accepted your invitation to Gmail and has chosen the brand new address xxxxxx …\xb8\x01\x01\x88\x01\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' from pprint import pprint #pprint(r.split("\x01")) from cStringIO import StringIO def _getCode(s): """ """ code = ord(s.read(1)) print "code:", hex(code) assert(s.read(1) == "\x01") return code def _getNextBytes(s, nextReadCount = 0): """ """ if not nextReadCount: nextReadCount = ord(s.read(1)) bytes = s.read(nextReadCount) print "bytes:", repr(bytes), return bytes def parseThreadData(s, obj): """ """ # Data header # Unknown initial bytes--maybe message Id? ##nextReadCount = 19 # This does not seem to be consistent... # TODO: Find out why. # # Example: # ## 0x82 02 10 93 dd f8 ab 87 99 a7 f5 0f 18 c9 8c b2 ce ea 1f code: 0x82 ## 0xfa 01 10 d0 8a b8 97 f5 cd a4 f5 0f 18 bd ea 9b c9 ea 1f code: 0x82 ## 0x7f 10 b8 d5 a2 bf b6 b7 a4 f5 0f 18 f8 ed ee c8 ea 1f code: 0x82 ## 0x83 01 10 de 8d d5 8f d6 b3 a4 f5 0f 18 80 ad e7 c8 ea 1f code: 0x82 ## 0x89 01 10 e0 be 9e cb f3 a8 a4 f5 0f 18 98 e7 d1 c8 ea 1f code: 0x82 ## 0x96 01 10 95 d4 e3 d8 d6 a7 a4 f5 0f 18 d8 ae cf c8 ea 1f code: 0x82 ## 0x9e 02 10 94 ba be c9 9b a7 a2 f5 0f 18 a2 b5 ce c4 ea 1f code: 0x82 ## 0xc5 01 10 f0 94 d6 dd fb 94 a2 f5 0f 18 87 f6 a9 c4 ea 1f code: 0x82 ## 0xf5 01 10 e5 f3 b8 97 cd ab a0 f5 0f 18 9b 99 d7 c0 ea 1f code: 0x82 ## 0xf1 01 10 e2 b2 c9 ed f3 96 9b f5 0f 18 87 e7 ad b6 ea 1f code: 0x82 ## 0xaa 02 10 8a 8e ab f9 e7 fd 93 f5 0f 18 a5 ce fb a7 ea 1f code: 0x82 ## 0x81 02 10 a8 aa f4 f2 80 a7 df f4 0f 18 d0 82 ce be e9 1f code: 0x82 ## 0x92 02 10 a0 ae 98 c6 a5 d3 aa f4 0f 18 b8 cb a6 d5 e8 1f code: 0x82 ## 0xf8 01 10 8e d5 bf 98 f9 a0 a1 f4 0f 18 81 f2 c1 c2 e8 1f code: 0x82 ## 0x9c 02 10 be f1 c5 e6 c9 e5 9a f4 0f 18 88 92 cb b5 e8 1f code: 0x82 ## 0x86 02 10 e6 bc 99 ca a0 e5 9a f4 0f 18 f8 c3 ca b5 e8 1f code: 0x82 ## 0x87 01 10 91 ce 8d e8 90 96 9a f4 0f 18 90 a2 ac b4 e8 1f code: 0x82 ## 0xd3 01 10 be f7 b9 8b 81 b2 99 f4 0f 18 a8 81 e4 b2 e8 1f code: 0x82 ## 0xf3 01 10 e6 df b1 c3 ae 9b 97 f4 0f 18 d7 dc b6 ae e8 1f code: 0x82 ## 0xf1 01 10 88 95 e0 8f d9 d0 90 f4 0f 18 c4 b0 a1 a1 e8 1f code: 0x82 ## 0xef 01 10 cc e0 f9 92 b2 da 8f f4 0f 18 f1 e6 b4 9f e8 1f code: 0x82 ## 0xf0 01 10 ac b5 b6 fe af ec 86 f4 0f 18 d3 dd d8 8d e8 1f code: 0x82 ## 0x7b 10 fc 82 eb e0 85 a6 86 f4 0f 18 b7 8a cc 8c e8 1f code: 0x82 ## 0xa5 01 10 e3 f0 87 db f6 91 86 f4 0f 18 a4 ee a3 8c e8 1f code: 0x82 ## 0x73 10 dd a8 e9 b5 ee ea 85 f4 0f 18 ca dd d5 8b e8 1f code: 0x82 byteString = "0x" while True: # Skip unknown bytes (Note: This method probably isn't 100% reliable.) # TODO: Work out what they are--there are some similarities. # Guess is date/time/id? byte = s.read(1) byteString += "%02x " % ord(byte) if byte == "\x1f": print byteString, code = _getCode(s) break while code != 0x92: bytes = _getNextBytes(s) ##, nextReadCount) code = _getCode(s) ##if code == 0x92: ## break fromCount = 0 while True: fromCount +=1 # Unknown, time/date? print "Hard-coded read." bytes = _getNextBytes(s, 4) print # From bytes = _getNextBytes(s) print assert(s.read(1) == "\x12") bytes = _getNextBytes(s) print # --- This isn't right/or is messy... ---- # 0x10 == From? # 0x18 == To? code = _getCode(s) assert((code == 0x10) or (code == 0x18) or (code == 0x98) or (code == 0x92)) if code == 0x98: break if code == 0x92: continue byte = _getCode(s) if byte == 0x18: byte = _getCode(s) if byte == 0x98: break else: assert(byte == 0x92) # ---------------- print "fromCount:", fromCount #elif code == 0x10: # break ##nextReadCount = ord(s.read(1)) ##print "next:", nextReadCount # Unknown for nextReadCount in [2]: bytes = _getNextBytes(s, nextReadCount) print assert(s.read(1) == "\x01") # Subject # Extra long (> n, where n = ???) subjects have form: # length, 0x01, subject # # Shorter length subject have form: # length, subject # # TODO: Determine what happens when length > 255? nextReadCount = ord(s.read(1)) if s.read(1) != "\x01": s.seek(-1, 1) bytes = _getNextBytes(s, nextReadCount) code = _getCode(s) obj.subject = bytes # Message snippet bytes = _getNextBytes(s) code = _getCode(s) obj.snippet = bytes # End of message data #assert(s.read(1) == "\x01") threadMsgCount = ord(s.read(1)) print "threadMsgCount", threadMsgCount # TODO: Find some way to make sure this is true... class GmailNotifierResponse: """ """ def __init__(self, responseData): """ """ # TODO: Merge this with GmailThread? class GmailNotifierThread: """ """ def __init__(self, threadData): """ """ # TODO: Move this to method of this object? parseThreadData(threadData, self) if __name__ == "__main__": # Change the `0` to a `1` to retrieve a live response. if 0: import sys from getpass import getpass try: name = sys.argv[1] except IndexError: name = raw_input("Gmail account name: ") pw = getpass("Password: ") ga = libgmail.GmailAccount(name, pw) print "\nPlease wait, logging in..." #import pdb; pdb.set_trace() ga.login() print "Log in successful.\n" r = ga._retrievePage("https://gmail.google.com/gmail?ui=pb&q=label:^i%20label:^u") #r = ga._retrievePage("https://gmail.google.com/gmail?ui=pb&q=label:^all") #print repr(r) pprint(r.split("\x01")) s = StringIO(r) numMsgs = 0 threads = [] while True: code = ord(s.read(1)) if code == 0x0a: numMsgs += 1 threads.append(GmailNotifierThread(s)) elif code == 0x88: # trailer assert(s.read(1) == "\x01") # If there are no messages there's no trailing count? msgCount = ord(s.read(1)) # TODO: What about count > 255? print "Messages:", msgCount print "Messages found:", numMsgs # Maximum of 30 Messages? try: assert(msgCount == numMsgs) print "All messages retrieved." except AssertionError: print "Not all messages retrieved." assert(msgCount > 30) assert(numMsgs == 30) padding = s.read() # Padding ensures data length is power of 2. print "padding bytes:", len(padding) try: assert(len([byte for byte in padding if byte != "\x00"]) == 0) except AssertionError: # What is the extra data value? ("more", "not all shown"?) print "AssertionError: Not all padding blank." print repr(padding[:10]) break else: raise Exception("Unknown code") print "Total length:", len(r) print for th in threads: print th.subject print th.snippet print --- NEW FILE: unreadmsgcount.py --- #!/usr/bin/env python # # unreadmsgcount.py -- Demo to return unread message count with saved state # # $Revision: 1.1 $ ($Date: 2005/09/23 17:58:08 $) # # Author: fol...@my... # # License: GPL 2.0 # # # This demo intends to show how account state can be saved between script # runs. # import os import sys import logging # Allow us to run using installed `libgmail` or the one in parent directory. try: import libgmail logging.warn("Note: Using currently installed `libgmail` version.") except ImportError: # Urghhh... sys.path.insert(1, os.path.realpath(os.path.join(os.path.dirname(__file__), os.path.pardir))) import libgmail if __name__ == "__main__": import sys from getpass import getpass try: filename = sys.argv[1] except IndexError: print "Usage: %s <state filename>" % sys.argv[0] raise SystemExit if not os.path.isfile(filename): name = raw_input("Gmail account name: ") pw = getpass("Password: ") ga = libgmail.GmailAccount(name, pw) print "\nPlease wait, logging in..." try: ga.login() except libgmail.GmailLoginFailure: print "\nLogin failed. (Wrong username/password?)" raise SystemExit print "Log in successful.\n" else: print "\nDon't wait, not logging in... :-)" ga = libgmail.GmailAccount( state = libgmail.GmailSessionState(filename = filename)) print "Unread messages: %s" % ga.getUnreadMsgCount() print "Saving state..." state = libgmail.GmailSessionState(account = ga).save(filename) print "Done." --- NEW FILE: test_fwd_attach.py --- #!/usr/bin/env python # # Usage: test_fwd_attach.py <account> <password> <recipient> <subject> # # This example forwards the first attachment from the search for "<subject>" # to the recipient. # import os import sys # Allow us to run using installed `libgmail` or the one in parent directory. try: import libgmail logging.warn("Note: Using currently installed `libgmail` version.") except ImportError: # Urghhh... sys.path.insert(1, os.path.realpath(os.path.join(os.path.dirname(__file__), os.path.pardir))) import libgmail account, pw, recipient, searchSubject = sys.argv[1:] ga = libgmail.GmailAccount(account, pw) ga.login() sr = ga.getMessagesByQuery("subject:%s" % searchSubject) attachmentId = None for thread in sr: for msg in thread: if msg.attachments: attachmentId = msg.attachments[0]._fullId break # Just use the first result. if not attachmentId: print "No attachment found." raise SystemExit cm = libgmail.GmailComposedMessage(to=recipient, subject="File attachment from: %s" % msg.subject, body="body") # Note: At present we can only have one forwarded attachment because # we're using a dictionary for the parameters, and all attachments # have the field name "attach". # TODO: Allow multiple forwarded attachments. (Probably by adding to the # `_paramsToMime` function, although that's kinda hacky.) if ga.sendMessage(cm, _extraParams = {'attach': attachmentId}): print "Succeeded." else: print "Failed." --- NEW FILE: archive.py --- #!/usr/bin/env python # # archive.py -- Demo to archive all threads in a Gmail folder # # $Revision: 1.1 $ ($Date: 2005/09/23 17:58:08 $) # # Author: fol...@my... # # License: GPL 2.0 # import os import sys import logging # Allow us to run using installed `libgmail` or the one in parent directory. try: import libgmail logging.warn("Note: Using currently installed `libgmail` version.") except ImportError: # Urghhh... sys.path.insert(1, os.path.realpath(os.path.join(os.path.dirname(__file__), os.path.pardir))) import libgmail if __name__ == "__main__": import sys from getpass import getpass try: name = sys.argv[1] except IndexError: name = raw_input("Gmail account name: ") pw = getpass("Password: ") ga = libgmail.GmailAccount(name, pw) print "\nPlease wait, logging in..." try: ga.login() except libgmail.GmailLoginFailure: print "\nLogin failed. (Wrong username/password?)" else: print "Log in successful.\n" searches = libgmail.STANDARD_FOLDERS + ga.getLabelNames() while 1: try: print "Select folder or label to archive: (Ctrl-C to exit)" print "Note: *All* pages of results will be archived." for optionId, optionName in enumerate(searches): print " %d. %s" % (optionId, optionName) name = searches[int(raw_input("Choice: "))] if name in libgmail.STANDARD_FOLDERS: result = ga.getMessagesByFolder(name, True) else: result = ga.getMessagesByLabel(name, True) print mbox = [] if len(result): for thread in result: print print thread.id, len(thread), thread.subject for msg in thread: print " ", msg.id, msg.number, msg.subject source = msg.source.replace("\r","").lstrip() mbox.append("From - Thu Jan 22 22:03:29 1998\n") mbox.append(source) mbox.append("\n\n") #TODO:Check if we need either/both? import time open("archive-%s-%s.mbox" % (name, time.time()), "w").writelines(mbox) else: print "No threads found in `%s`." % name print except KeyboardInterrupt: break print "\n\nDone." --- NEW FILE: MakeTarBall.py --- #!/usr/bin/env python # make tarball! VERSION = '0.1' PACKAGENAME = 'libgmail-docs_' import os print "\nCreate API docs" os.system('epydoc -o API ../libgmail.py') def cleanup(*args): """Used by os.path.walk to traverse the tree and remove CVS dirs""" if os.path.split(args[1])[1] == "CVS": print "Remove ",args[1] os.system('rm -r %s' % args[1]) filelist = open('filelist', 'r') folderlist = open('folderlist', 'r') myFiles = filelist.readlines() myFolders = folderlist.readlines() os.system('mkdir %s%s' % (PACKAGENAME,VERSION)) for file in myFiles: os.system('cp %s %s%s' % (file[:-1], PACKAGENAME,VERSION)) for folder in myFolders: os.system('mkdir %s%s/%s' % (PACKAGENAME,VERSION, folder[:-1])) os.system('cp -r %s %s%s' % (folder[:-1],PACKAGENAME, VERSION)) # removing the CVS stuff os.path.walk('%s%s' % (PACKAGENAME,VERSION),cleanup,None) print "\nCreate a GNU/Linux tarball..." try: execString = 'tar -czf %s%s.tgz %s%s/' % (PACKAGENAME,VERSION,PACKAGENAME, VERSION) print execString os.system(execString) except Exception,info: print info,"\nYou must have the tar package installed" else: print "Done.\n" print "Create a Windows compatible zipfile..." try: execString = 'zip -rq %s%s.zip ./%s%s' % (PACKAGENAME,VERSION,PACKAGENAME, VERSION) print execString os.system(execString) except Exception,info: print info,"\nYou must have the zip package installed." else: print "Done\n" os.system('rm -rf %s%s' % (PACKAGENAME,VERSION)) --- NEW FILE: filelist --- archive.py gcp.py gmailftpd.py gmailpopd.py gmailsmtp.py sendmsg.py test_fwd_attach.py test_notifier.py unreadmsgcount.py README COPYING --- NEW FILE: sendmsg.py --- #!/usr/bin/env python # # sendmsg.py -- Demo to send a message via Gmail using libgmail # # $Revision: 1.1 $ ($Date: 2005/09/23 17:58:08 $) # # Author: fol...@my... # # License: GPL 2.0 # import os import sys import logging # Allow us to run using installed `libgmail` or the one in parent directory. try: import libgmail ## Wouldn't this the preffered way? ## We shouldn't raise a warning about a normal import ##logging.warn("Note: Using currently installed `libgmail` version.") except ImportError: # Urghhh... sys.path.insert(1, os.path.realpath(os.path.join(os.path.dirname(__file__), os.path.pardir))) import libgmail if __name__ == "__main__": import sys from getpass import getpass try: name = sys.argv[1] to = sys.argv[2] subject = sys.argv[3] msg = sys.argv[4] except IndexError: print "Usage: %s <account> <to address> <subject> <body>" % sys.argv[0] raise SystemExit pw = getpass("Password: ") ga = libgmail.GmailAccount(name, pw) print "\nPlease wait, logging in..." try: ga.login() except libgmail.GmailLoginFailure: print "\nLogin failed. (Wrong username/password?)" else: print "Log in successful.\n" gmsg = libgmail.GmailComposedMessage(to, subject, msg) if ga.sendMessage(gmsg): print "Message sent `%s` successfully." % subject else: print "Could not send message." print "Done." --- NEW FILE: README --- libgmail is licensed under the GPL. See the file named COPYING for more information. Please refer to the libgmail website or project page at sourceforge if you encouter problems using libgmail. http://libgmail.sf.net http://sourceforge.net/projects/libgmail/ You can contact us by email: stas AT linux DOT isbeter DOT nl wdaher AT mit DOT edu follower AT myrealbox DOT com ----------------------------------------------- Possible usage: Run this: python libgmail.py or this: python demos/archive.py or even this: python demos/sendmsg.py <account> <to address> <subject> <body> or perhaps this: python demos/gmailsmtp.py # (Then connect to SMTP proxy on local port 8025) or how about this: python demos/gmailftpd.py # (Then connect to FTP proxy on local port 8021, # after creating a label named 'ftp' and # applying it to some messages with attachments.) or maybe this: python demos/gmailpopd.py # (Then connect to POP3 proxy on local port 8110) for hours of fun!(*) (*) Note: Fun may not last for hours. Use at your own risk, blah, blah, etc... --- NEW FILE: gmailsmtp.py --- #!/usr/bin/env python # # gmailsmtp.py -- Demo to allow smtp delivery via Gmail # # $Revision: 1.1 $ ($Date: 2005/09/23 17:58:08 $) # # Author: fol...@my... # # License: GPL 2.0 # import os import sys import email import base64 import asyncore import smtpd # Allow us to run using installed `libgmail` or the one in parent directory. try: import libgmail logging.warn("Note: Using currently installed `libgmail` version.") except ImportError: # Urghhh... sys.path.insert(1, os.path.realpath(os.path.join(os.path.dirname(__file__), os.path.pardir))) import libgmail ga = None class GmailSmtpProxy(smtpd.SMTPServer): """ """ def process_message(self, peer, mailfrom, rcpttos, data): """ """ result = None body = "" attachments = [] msg = email.message_from_string(data) #import pdb; pdb.set_trace() # Handle attachments, if present. if msg.is_multipart(): for part in msg.get_payload(): if part.get_content_type() == "text/plain": # TODO: Do we need to handle "message/rfc822" too? body = part.get_payload() else: attachments.append(part) else: body = msg.get_payload() gmsg = libgmail.GmailComposedMessage(to = msg["To"], subject = msg["Subject"], body = body, files = attachments) # Don't drop connection until we know we delivered... if not ga.sendMessage(gmsg): result = "Could not deliver." return result def handle_accept(self): conn, addr = self.accept() print >> smtpd.DEBUGSTREAM, 'Incoming connection from %s' % repr(addr) channel = ESMTPChannel(self, conn, addr) class ESMTPChannel(smtpd.SMTPChannel): """ """ def smtp_EHLO(self, arg): if not arg: self.push('501 Syntax: EHLO hostname') return ## if self.__greeting: if self._SMTPChannel__greeting: self.push('503 Duplicate HELO/EHLO') else: ## self.__greeting = arg ## self.push('250 %s' % self.__fqdn) self._SMTPChannel__greeting = arg self.push('250-%s' % self._SMTPChannel__fqdn) self.push('250 AUTH PLAIN') def smtp_AUTH(self, arg): """ """ kind, data = arg.split(" ") # TODO: Ensure kind == "PLAIN" # TODO: Support "LOGIN" (required by Outlook?) <http://www.technoids.org/saslmech.html> data = base64.decodestring(data)[1:] user, pw = data.split("\x00") global ga ga = libgmail.GmailAccount(user, pw) try: ga.login() except libgmail.GmailLoginFailure: self.push("535 Authorization failed") else: self.push('235 Ok') if __name__ == "__main__": #smtpd.DEBUGSTREAM = sys.stderr server = GmailSmtpProxy(("localhost", 8025), None) asyncore.loop() --- NEW FILE: gmailftpd.py --- #!/usr/bin/env python # # gmailftpd.py -- Demo to allow retrieval of attachments via FTP. # # $Revision: 1.1 $ ($Date: 2005/09/23 17:58:08 $) # # Author: fol...@my... # # License: Dual GPL 2.0 and PSF (This file only.) # # # Based on smtpd.py by Barry Warsaw <ba...@py...> (Thanks Barry!) # # Major rewrite of the datachannel handeling by Willy De la Court <wd...@li...> # # Note: Requires messages to be marked with a label named "ftp". # (This requirement can be removed.) # # TODO: Handle duplicate file names... # import sys import os import re import time import socket import asyncore import asynchat import logging program = sys.argv[0] __version__ = 'Python Gmail FTP proxy version 0.0.3' # Allow us to run using installed `libgmail` or the one in parent directory. try: import libgmail logging.warn("Note: Using currently installed `libgmail` version.") except ImportError: # Urghhh... sys.path.insert(1, os.path.realpath(os.path.join(os.path.dirname(__file__), os.path.pardir))) import libgmail class Devnull: def write(self, msg): pass def flush(self): pass DEBUGSTREAM = Devnull() NEWLINE = '\n' EMPTYSTRING = '' nextPort = 9021 class FTPChannel(asynchat.async_chat): def __init__(self, server, conn, addr): asynchat.async_chat.__init__(self, conn) self.__server = server self.__conn = conn self.__addr = addr self.__line = [] self.__fqdn = socket.getfqdn() self.__peer = conn.getpeername() print >> DEBUGSTREAM, 'Peer:', repr(self.__peer) self.push('220 %s %s' % (self.__fqdn, __version__)) self.set_terminator('\r\n') self.my_type = "A" self.my_cwd = "" self.my_user = "" self.filenames = {} self._activeDataChannel = None # Overrides base class for convenience def push(self, msg): asynchat.async_chat.push(self, msg + '\r\n') # Implementation of base class abstract method def collect_incoming_data(self, data): self.__line.append(data) # Implementation of base class abstract method def found_terminator(self): line = EMPTYSTRING.join(self.__line) print >> DEBUGSTREAM, 'Data:', repr(line) self.__line = [] if not line: self.push('500 Error: bad syntax') return method = None i = line.find(' ') if i < 0: command = line.upper() arg = None else: command = line[:i].upper() arg = line[i+1:].strip() method = getattr(self, 'ftp_' + command, None) if not method: self.push('502 Error: command "%s" not implemented' % command) return method(arg) return def get_filelist(self): """ Get the file list from GMail """ r = self.ga.getMessagesByLabel('ftp') for th in r: for m in th: for a in m.attachments: self.filenames[a.filename] = a def ftp_USER(self, arg): """ Process USER ftp command """ if not arg: self.push('501 Syntax: USER username') else: self.my_user = arg self.push('331 Password required') def ftp_PASS(self, arg = ''): """ Process PASS ftp command """ self.ga = libgmail.GmailAccount(self.my_user, arg) try: self.ga.login() except libgmail.GmailLoginFailure: self.push('530 Login failed. (Wrong username/password?)') else: self.push('230 User logged in') def ftp_LIST(self, arg): """ Process LIST ftp command """ self.filenames = {} self._activeDataChannel.cmd = "LIST " + str(arg) self._activeDataChannel.handle_LIST() def ftp_RNFR(self, arg): """ Process RNFR ftp command """ self.push('350 File exists, ready for destination name') def ftp_RNTO(self, arg): """ Process RNTO ftp command """ self.push('250 RNTO command successful.') def ftp_SIZE(self, arg): """ Process SIZE ftp command """ name_req = arg if name_req[:1] == '/': name_req = name_req[1:] try: response = "213 %d" % (self.filenames[name_req].filesize) except: self.push("550 %s: No such file or directory." % (name_req)) else: self.push(response) def ftp_RETR(self, arg): """ Process RETR ftp command """ self._activeDataChannel.cmd = "RETR " + str(arg) self._activeDataChannel.handle_RETR() def ftp_STOR(self, arg): """ Process STORE ftp command """ # TODO: Check this is legit, don't just copy & paste from RETR... self._activeDataChannel.cmd = "STOR " + str(arg) self._activeDataChannel.handle_STOR() def ftp_PASV(self, arg): """ Process PASV ftp command """ # *** TODO: Don't allow non-binary file transfers here? global nextPort PORT = nextPort nextPort += 1 ADDR = ('127.0.0.1', PORT) self._activeDataChannel = DataChannel(ADDR, self) self.push('227 =127,0,0,1,%d,%d' % (PORT / 256, PORT % 256)) def ftp_QUIT(self, arg): """ Process QUIT ftp command """ # args is ignored self.push('221 Bye') self.close_when_done() def ftp_CWD(self, arg): """ Process CWD ftp command """ # TODO: Attach CWD (and other items) to channel... self.my_cwd = arg self.push('550 ' + self.my_cwd + ': No such file or directory.') def ftp_PWD(self, arg): """ Process PWD ftp command """ self.push('257 "/" is current directory.') def ftp_TYPE(self, arg): """ Process TYPE ftp command """ response = '200 OK' if arg in ["A", "A N"]: self.my_type = "A" elif arg in ["I", "L 8"]: self.my_type = "I" else: response = "504 Unsupported TYPE parameter" self.push(response) import tempfile class DataChannel(asyncore.dispatcher): """ """ def __init__(self, localaddr, ControlChannel): self._ControlChannel = ControlChannel self._localaddr = localaddr asyncore.dispatcher.__init__(self) self.create_socket(socket.AF_INET, socket.SOCK_STREAM) # try to re-use a server port if possible self.set_reuse_addr() self.bind(localaddr) self.listen(5) print >> DEBUGSTREAM, \ '%s started at %s\n\tLocal addr: %s\n' % ( self.__class__.__name__, time.ctime(time.time()), localaddr) self.cmd = "" def handle_accept(self): """ Start the DATA connection """ conn, addr = self.accept() self._ControlChannel.push('150 Opening data connection.') self.conn = conn def handle_LIST(self): """ Send the data response for the LIST command """ self._ControlChannel.get_filelist() result = "" for file in self._ControlChannel.filenames.keys(): result = result + "-rw-r--r-- 1 %s %s %10d Jan 1 2000 %s\r\n" % (self._ControlChannel.my_user, self._ControlChannel.my_user, self._ControlChannel.filenames[file].filesize, self._ControlChannel.filenames[file].filename) self.conn.sendall(result) self._ControlChannel.push('226 Transfer complete.') self.close() self.conn.close() def handle_RETR(self): """ Send the file for the RETR command """ if self._ControlChannel.my_type != "I": self._ControlChannel.push('426 Only binary transfer mode is supported') self.close() self.conn.close() return name_req = self.cmd[5:] # Remove leading / if name_req[:1] == '/': name_req = name_req[1:] print >> DEBUGSTREAM, "Reading `%s`." % (name_req) # check if the file exists try: name = self._ControlChannel.filenames[name_req].filename except KeyError: # if not the list is probably not read yet self._ControlChannel.get_filelist() # try again try: self.conn.sendall(self._ControlChannel.filenames[name_req].content) response = '226 Transfer complete.' except KeyError: response = '550 ' + name_req + ': No such file or directory.' self._ControlChannel.push(response) self.close() self.conn.close() def handle_STOR(self): """ Receive the file for the STOR command """ if self._ControlChannel.my_type != "I": self._ControlChannel.push('426 Only binary transfer mode is supported') self.close() self.conn.close() return buffer = "" while True: data = self.conn.recv(1024) if not data: break buffer += data filename = self.cmd[5:] # Remove leading / if filename[:1] == '/': filename = filename[1:] tempDir = tempfile.mkdtemp() # Remove trailing '.part' KDE uses this to upload files tempFileName = re.sub('\.part', '', filename) tempFilePath = os.path.join(tempDir, tempFileName) print >> DEBUGSTREAM, "Writing `%s` to `%s`." % (filename, tempFilePath) open(tempFilePath, "wb").write(buffer) self._ControlChannel.ga.storeFile(tempFilePath, "ftp") os.remove(tempFilePath) os.rmdir(tempDir) self._ControlChannel.push('226 Transfer complete.') self.close() self.conn.close() class FTPServer(asyncore.dispatcher): def __init__(self, localaddr): self._localaddr = localaddr asyncore.dispatcher.__init__(self) self.create_socket(socket.AF_INET, socket.SOCK_STREAM) # try to re-use a server port if possible self.set_reuse_addr() self.bind(localaddr) self.listen(5) print >> DEBUGSTREAM, \ '%s started at %s\n\tLocal addr: %s\n' % ( self.__class__.__name__, time.ctime(time.time()), localaddr) def handle_accept(self): conn, addr = self.accept() print >> DEBUGSTREAM, 'Incoming connection from %s' % repr(addr) channel = FTPChannel(self, conn, addr) if __name__ == '__main__': DEBUGSTREAM = sys.stderr proxy = FTPServer(('127.0.0.1', 8021)) try: asyncore.loop() except KeyboardInterrupt: pass --- NEW FILE: folderlist --- API --- NEW FILE: COPYING --- GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> 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 Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. --- NEW FILE: gcp.py --- #!/usr/bin/env python # # gcp.py -- Demo to copy a file to Gmail using libgmail # # $Revision: 1.1 $ ($Date: 2005/09/23 17:58:08 $) # # Author: fol...@my... # # License: GPL 2.0 # import os import sys import logging # Allow us to run using installed `libgmail` or the one in parent directory. try: import libgmail logging.warn("Note: Using currently installed `libgmail` version.") except ImportError: # Urghhh... sys.path.insert(1, os.path.realpath(os.path.join(os.path.dirname(__file__), os.path.pardir))) import libgmail if __name__ == "__main__": import sys from getpass import getpass # TODO: Allow copy from account. try: filename = sys.argv[1] destination = sys.argv[2] except IndexError: print "Usage: %s <filename> <account>:[<label>/]" % sys.argv[0] raise SystemExit name, label = destination.split(":", 1) if label.endswith("/"): label = label[:-1] if not label: label = None pw = getpass("Password: ") ga = libgmail.GmailAccount(name, pw) print "\nPlease wait, logging in..." try: ga.login() except libgmail.GmailLoginFailure: print "\nLogin failed. (Wrong username/password?)" else: print "Log in successful.\n" if ga.storeFile(filename, label=label): print "File `%s` stored successfully in `%s`." % (filename, label) else: print "Could not store file." print "Done." --- NEW FILE: gmailpopd.py --- #!/usr/bin/env python # # gmailpopd.py -- Demo to provide POP3 proxy for Gmail message retrieval.. # # $Revision: 1.1 $ ($Date: 2005/09/23 17:58:08 $) # # Author: fol...@my... # # License: Dual GPL 2.0 and PSF (This file only.) # # # Based on smtpd.py by Barry Warsaw <ba...@py...> (Thanks Barry!) # ## Applied the Debian patch bug report #277310 --SZ-- import sys import os import time import socket import asyncore import asynchat program = sys.argv[0] __version__ = 'Python Gmail POP3 proxy version 0.0.1' # Allow us to run using installed `libgmail` or the one in parent directory. try: import libgmail logging.warn("Note: Using currently installed `libgmail` version.") except ImportError: # Urghhh... sys.path.insert(1, os.path.realpath(os.path.join(os.path.dirname(__file__), os.path.pardir))) import libgmail from libgmail import U_AS_SUBSET_UNREAD class Devnull: def write(self, msg): pass def flush(self): pass DEBUGSTREAM = Devnull() NEWLINE = '\n' EMPTYSTRING = '' # TODO: Get rid of this global stuff... my_user = "" snapshot = None # Account snapshot... class GmailAccountSnapshot: """ """ def __init__(self, ga): """ """ self.account = ga # TODO: Work out at what stage messages get marked as 'read'. # (as I think of it, it happens when I retrieve the # messages in the threads, should really preserve read/unread # state then.) # TODO: Fix this so it does not retrieve messages that have already # been read. ("unread" is a property of thread in this case?) # Is this even possible without caching stuff ourselves, # maybe use "archive" as the equivalent of read? self._unreadThreads = ga.getMessagesByQuery("is:" + U_AS_SUBSET_UNREAD, True)#TODO:True as default? self.unreadMsgs = [] for thread in self._unreadThreads: for msg in thread: self.unreadMsgs.append(msg) def retrieveMessage(self, msgNumber, bodyLines = None): """ Returns an array of lines... (TODO: Decide if we want this.) """ # TODO: Check request is in range... # TODO: Don't retrieve all of the message, just what's needed. msgContent = self.unreadMsgs[msgNumber].source msgContent = _massage(msgContent)# TODO: Remove this... msgLines = msgContent.split("\r\n") if bodyLines is not None: blankIndex = msgLines.index("") # Blank line between header & body. msgLines = msgLines[:blankIndex + 1 + bodyLines] return msgLines class POPChannel(asynchat.async_chat): def __init__(self, server, conn, addr): asynchat.async_chat.__init__(self, conn) self.__server = server self.__conn = conn self.__addr = addr self.__line = [] self.__fqdn = socket.getfqdn() self.__peer = conn.getpeername() print >> DEBUGSTREAM, 'Peer:', repr(self.__peer) self.push('+OK %s %s' % (self.__fqdn, __version__)) self.set_terminator('\r\n') self._activeDataChannel = None # Overrides base class for convenience def push(self, msg): asynchat.async_chat.push(self, msg + '\r\n') # Implementation of base class abstract method def collect_incoming_data(self, data): self.__line.append(data) # Implementation of base class abstract method def found_terminator(self): line = EMPTYSTRING.join(self.__line) print >> DEBUGSTREAM, 'Data:', repr(line) self.__line = [] if not line: self.push('500 Error: bad syntax') return method = None i = line.find(' ') if i < 0: command = line.upper() arg = None else: command = line[:i].upper() arg = line[i+1:].strip() method = getattr(self, 'pop_' + command, None) if not method: self.push('-ERR Error : command "%s" not implemented' % command) return method(arg) return def pop_USER... [truncated message content] |
From: Stas Z. <sta...@us...> - 2005-09-23 17:56:17
|
Update of /cvsroot/gmailagent/GA-libgmail2/demos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10398/demos Log Message: Directory /cvsroot/gmailagent/GA-libgmail2/demos added to the repository |
Update of /cvsroot/gmailagent/GA-libgmail2/frontend In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7136/frontend Removed Files: AddressEditDialog.ui AddressEditDialog.ui.h AddressEditDialog.ui.h~ AddressEditDialog.ui~ AddressEditDialog_forms.py AddressEditDialog_forms.pyc Contrgcm.py GuiQTgcm.py LoginDialog.ui LoginDialog.ui.h LoginDialog_forms.py MainWinContacts.ui MainWinContacts.ui.h MainWinContacts_forms.py Makefile ModalPopUpDialog_forms.py ModalPopupDialog.ui ModalPopupDialog.ui.h Observers.py Qgcm.e3p Qgcm.py QgcmDialogs.py testContrgcm.py Log Message: Removed old stuff --- MainWinContacts.ui DELETED --- --- QgcmDialogs.py DELETED --- --- Makefile DELETED --- --- LoginDialog.ui DELETED --- --- AddressEditDialog_forms.pyc DELETED --- --- GuiQTgcm.py DELETED --- --- AddressEditDialog.ui.h DELETED --- --- ModalPopupDialog.ui DELETED --- --- Contrgcm.py DELETED --- --- MainWinContacts.ui.h DELETED --- --- AddressEditDialog.ui~ DELETED --- --- testContrgcm.py DELETED --- --- Observers.py DELETED --- --- ModalPopUpDialog_forms.py DELETED --- --- MainWinContacts_forms.py DELETED --- --- AddressEditDialog.ui DELETED --- --- Qgcm.py DELETED --- --- ModalPopupDialog.ui.h DELETED --- --- Qgcm.e3p DELETED --- --- LoginDialog_forms.py DELETED --- --- AddressEditDialog.ui.h~ DELETED --- --- LoginDialog.ui.h DELETED --- --- AddressEditDialog_forms.py DELETED --- |
From: Stas Z. <sta...@us...> - 2005-09-23 17:27:27
|
Update of /cvsroot/gmailagent/GA-libgmail2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5473 Removed Files: constants.py Log Message: removed old stuff --- constants.py DELETED --- |
From: Stas Z. <sta...@us...> - 2005-09-23 17:25:40
|
Update of /cvsroot/gmailagent/GA-libgmail2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4948 Removed Files: libgmail2.py mkconstants.py testlibgmail2.py Log Message: removed old stuff --- mkconstants.py DELETED --- --- libgmail2.py DELETED --- --- testlibgmail2.py DELETED --- |
From: Stas Z. <sta...@us...> - 2005-09-14 15:45:20
|
Update of /cvsroot/gmailagent/GA-Qgcm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19641 Added Files: CHANGELOG Log Message: added a changelog --- NEW FILE: CHANGELOG --- initial release (0.2) * Initial release |
Update of /cvsroot/gmailagent/GA-main In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14380 Modified Files: AboutDialog_forms.py AddressDialog.ui AddressDialog_forms.py GuiQT.py HelpDialog_forms.py LoginDialog_forms.py MainWin_forms.py Log Message: update the GUI logic Index: AddressDialog.ui =================================================================== RCS file: /cvsroot/gmailagent/GA-main/AddressDialog.ui,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** AddressDialog.ui 14 Sep 2005 11:36:28 -0000 1.6 --- AddressDialog.ui 14 Sep 2005 15:23:45 -0000 1.7 *************** *** 281,290 **** <x>20</x> <y>360</y> ! <width>110</width> <height>26</height> </rect> </property> <property name="text"> ! <string>Edit addressbook</string> </property> </widget> --- 281,290 ---- <x>20</x> <y>360</y> ! <width>150</width> <height>26</height> </rect> </property> <property name="text"> ! <string>Start contacts manager</string> </property> </widget> Index: AddressDialog_forms.py =================================================================== RCS file: /cvsroot/gmailagent/GA-main/AddressDialog_forms.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** AddressDialog_forms.py 14 Sep 2005 11:36:28 -0000 1.14 --- AddressDialog_forms.py 14 Sep 2005 15:23:45 -0000 1.15 *************** *** 3,7 **** # Form implementation generated from reading ui file 'AddressDialog.ui' # ! # Created: Mon Aug 15 12:50:15 2005 # by: The PyQt User Interface Compiler (pyuic) 3.14.1 # --- 3,7 ---- # Form implementation generated from reading ui file 'AddressDialog.ui' # ! # Created: Wed Sep 14 17:23:00 2005 # by: The PyQt User Interface Compiler (pyuic) 3.14.1 # *************** *** 164,168 **** self.pushButtonEdit = QPushButton(self,"pushButtonEdit") ! self.pushButtonEdit.setGeometry(QRect(20,360,110,26)) self.languageChange() --- 164,168 ---- self.pushButtonEdit = QPushButton(self,"pushButtonEdit") ! self.pushButtonEdit.setGeometry(QRect(20,360,150,26)) self.languageChange() *************** *** 196,200 **** self.listViewBook.header().setLabel(1,self.__tr("Email Address")) self.textLabel1.setText(self.__tr("<b>Gmail contacts</b>")) ! self.pushButtonEdit.setText(self.__tr("Edit addressbook")) --- 196,200 ---- self.listViewBook.header().setLabel(1,self.__tr("Email Address")) self.textLabel1.setText(self.__tr("<b>Gmail contacts</b>")) ! self.pushButtonEdit.setText(self.__tr("Start contacts manager")) Index: AboutDialog_forms.py =================================================================== RCS file: /cvsroot/gmailagent/GA-main/AboutDialog_forms.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** AboutDialog_forms.py 14 Sep 2005 11:36:28 -0000 1.24 --- AboutDialog_forms.py 14 Sep 2005 15:23:45 -0000 1.25 *************** *** 3,7 **** # Form implementation generated from reading ui file 'AboutDialog.ui' # ! # Created: Mon Aug 15 12:50:15 2005 # by: The PyQt User Interface Compiler (pyuic) 3.14.1 # --- 3,7 ---- # Form implementation generated from reading ui file 'AboutDialog.ui' # ! # Created: Wed Sep 14 17:23:00 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.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** GuiQT.py 14 Sep 2005 11:36:28 -0000 1.36 --- GuiQT.py 14 Sep 2005 15:23:45 -0000 1.37 *************** *** 33,37 **** import Gmail ! import sys,os,logging try: --- 33,37 ---- import Gmail ! import sys,os,logging,weakref try: *************** *** 195,199 **** "contacts require access to your Gmail account." dlg = Gmail.ModalPopup(parent=self,text=txt) - ## BIG TODO: make this work :-) if dlg.start():# Yes obs = Observer(self._get_contacts) --- 195,198 ---- *************** *** 205,209 **** def _get_contacts(self,ga): ! """Callback for the observer""" self.obs = Observer(self.lineEditTo.setText) AddressBookDialog(self,gac=ga,observer=self.obs) --- 204,209 ---- 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) *************** *** 342,347 **** def pushButtonEdit_clicked(self): - if self.gcm: - return result = Gmail.start_gcm(self.GC,Qapplication) print "result",result --- 342,345 ---- *************** *** 353,356 **** --- 351,356 ---- else: #We make it a attribute to prevent destruction by the Python Garbage collector + # As a reminder GuiQTgcm.MainWin is a singleton so no need to prevent + # multiple instances. self.gcm = result[1] Index: MainWin_forms.py =================================================================== RCS file: /cvsroot/gmailagent/GA-main/MainWin_forms.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** MainWin_forms.py 14 Sep 2005 11:36:28 -0000 1.27 --- MainWin_forms.py 14 Sep 2005 15:23:45 -0000 1.28 *************** *** 3,7 **** # Form implementation generated from reading ui file 'MainWin.ui' # ! # Created: Mon Aug 15 12:50:15 2005 # by: The PyQt User Interface Compiler (pyuic) 3.14.1 # --- 3,7 ---- # Form implementation generated from reading ui file 'MainWin.ui' # ! # Created: Wed Sep 14 17:23:00 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.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** HelpDialog_forms.py 14 Sep 2005 11:36:28 -0000 1.13 --- HelpDialog_forms.py 14 Sep 2005 15:23:45 -0000 1.14 *************** *** 3,7 **** # Form implementation generated from reading ui file 'HelpDialog.ui' # ! # Created: Mon Aug 15 12:50:15 2005 # by: The PyQt User Interface Compiler (pyuic) 3.14.1 # --- 3,7 ---- # Form implementation generated from reading ui file 'HelpDialog.ui' # ! # Created: Wed Sep 14 17:23:00 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.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** LoginDialog_forms.py 14 Sep 2005 11:36:28 -0000 1.27 --- LoginDialog_forms.py 14 Sep 2005 15:23:45 -0000 1.28 *************** *** 3,7 **** # Form implementation generated from reading ui file 'LoginDialog.ui' # ! # Created: Mon Aug 15 12:50:15 2005 # by: The PyQt User Interface Compiler (pyuic) 3.14.1 # --- 3,7 ---- # Form implementation generated from reading ui file 'LoginDialog.ui' # ! # Created: Wed Sep 14 17:23:00 2005 # by: The PyQt User Interface Compiler (pyuic) 3.14.1 # |
From: Stas Z. <sta...@us...> - 2005-09-14 14:42:38
|
Update of /cvsroot/gmailagent/GA-Qgcm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4925 Added Files: BorgSingleton.py Log Message: added singleton class --- NEW FILE: BorgSingleton.py --- """ Borg and more than one module, Jan Wender, 2001/10/11 If you want to use the Borg pattern from more than one module, it works as follows: Extract the Borg Pattern into a module and a class of its own: borg.py: class Borg: __shared_state = {} # or org.python.core.PyStringMap in jython def __init__(self): self.__dict__ = self.__shared_state Let your class in a separate module inherit from Borg and call Borg's initializer in your __init__: import borg class Test(borg.Borg): def __init__(s): borg.Borg.__init__(s) Although sounding like a swedish chef, it works now. The state is shared across all modules using the Test class. """ class Borg: __shared_state = {} def __init__(self): self.__dict__ = self.__shared_state # and whatever else you want in your class -- that's all! |
From: Stas Z. <sta...@us...> - 2005-09-14 11:36:42
|
Update of /cvsroot/gmailagent/GA-main In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22517 Modified Files: AboutDialog_forms.py AddressDialog.ui AddressDialog.ui.h AddressDialog_forms.py Gmail.py GmailAgent.e3p GmailAgent.py GuiQT.py HelpDialog_forms.py LoginDialog_forms.py MainWin_forms.py TODO filelist setup.py Log Message: Updates Index: Gmail.py =================================================================== RCS file: /cvsroot/gmailagent/GA-main/Gmail.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Gmail.py 14 Jun 2005 14:17:31 -0000 1.19 --- Gmail.py 14 Sep 2005 11:36:28 -0000 1.20 *************** *** 18,28 **** # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. GM_DEBUG = 1 ! import libgmail2,urllib2,logging,ConfigParser,os ! try: ! import Contrgmc except ImportError,info: USE_CONTACTS = False else: --- 18,38 ---- # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + """Provides some abstraction from the libgmail lib + It also imports the gcm stuff, if available, so GA can through this module + access gcm stuff.""" GM_DEBUG = 1 ! import libgmail,urllib2,logging,ConfigParser,os ! try: ! logging.basicConfig(level=logging.DEBUG,\ ! format='\n%(levelname)s,%(module)s:LineNo %(lineno)d:%(message)s') ! except TypeError: ! # Python <=2.3? ! pass try: ! from GCM_qt import Contrgcm ! from GCM_qt.QgcmDialogs import ModalPopup except ImportError,info: + print info USE_CONTACTS = False else: *************** *** 31,38 **** def login(name,pas): if GM_DEBUG: logging.debug("\n>>>>>>>> Function: login") ! ga = libgmail2.GmailAccount(name,pas) try: ga.login() ! except (libgmail2.GmailLoginFailure,urllib2.HTTPError),info: if GM_DEBUG: logging.warning("%s" % info) return (1,"%s" % info) --- 41,48 ---- def login(name,pas): if GM_DEBUG: logging.debug("\n>>>>>>>> Function: login") ! ga = libgmail.GmailAccount(name,pas) try: ga.login() ! except (libgmail.GmailLoginFailure,urllib2.HTTPError),info: if GM_DEBUG: logging.warning("%s" % info) return (1,"%s" % info) *************** *** 45,49 **** header = obj.mailheader ! gmsg = libgmail2.GmailComposedMessage(to = header['to'], subject = header['subject'], body = obj.mailbody, --- 55,59 ---- header = obj.mailheader ! gmsg = libgmail.GmailComposedMessage(to = header['to'], subject = header['subject'], body = obj.mailbody, *************** *** 82,261 **** except: if GM_DEBUG: logging.warning("Failed to load the password from %s" % rcfile) ! return (1,"Failed to load the password from %s" % rcfile) return (0,(name,pas)) - ######## Everything below this point will become part of a seperate module ##### - ######## Leave it here until the new contacts frontend is functional ########### ! ##def upload_local_contacts(addrfile,ga): ! ## """Returns the contacts from the local file which don't have a ID entry. ! ## Contacts without an ID are considered local only and must be added to the Gmail ! ## contacts list. ! ## This function is called whenever the user logs into Gmail. ! ## Returns error message on faillure, None on succes.""" ! ## if GM_DEBUG: logging.debug("\n>>>>>>>> Function: upload_local_contacts") ! ## contacts = load_addressfile(addrfile) ! ## for line in contacts: ! ## if GM_DEBUG: logging.debug("Found local contact %s %s %s %s" % line) ! ## if not line[3]: ! ## logging.debug("Adding %s %s %s %s to Gmail" % line) ! ## if not ga.addContact(line[0],line[1],line[2]):#libgmail2 checks for exception ! ## return ("Unable to add contact %s %s %s %s" % line) ! ## # Now we reload the contacts to create a new local contacts list ! ## #import_contacts(addrfile,ga) ! ## ! ## ! ##def store_address(addrfile,name,addr,notes='',id='',ga=None): ! ## """The contacts will be stored in the local copy on disk. ! ## If the id is given we assume the contact has a valid Gmail id and ! ## the contact is removed from the online contacts and replaced by the ! ## given contact. It will get a new id from Gmail. ! ## """ ! ## if GM_DEBUG: ! ## logging.debug("\n>>>>>>>> Function: store_address") ! ## logging.debug("store contact %s %s %s %s %s" % (name,addr,notes,id,ga)) ! ## if id and ga: ! ## if GM_DEBUG: logging.debug("Found id, removing original contact first") ! ## contacts = ga.getContacts() ! ## contact = contacts.getContactById(id) ! ## if contact: ! ## if not ga.removeContact(contact): ! ## logging.warning("Failed to remove contact %s" % contact) ! ## else: ! ## # Build the new local file with the contacts from Gmail ! ## import_contacts(addrfile,ga) ! ## # now we add the new contact to the local file ! ## store_address(addrfile,name,addr,notes) ! ## # And upload it to Gmail ! ## upload_local_contacts(addrfile,ga) ! ## # Retrieve Gmail contacts so that we have get an id for the new contact. ! ## import_contacts(addrfile,ga) ! ## # stuff is stored in a file like this: ! ## # name&&addr&¬es&&id ! ## # Contacts that are not (yet) in the Gmail contacts list have an empty ! ## # string as id. ! ## # After syncronizing the file with the contacts the id fields will be asigned. ! ## try: ! ## f = open(addrfile,'r') ! ## lines = f.readlines() ! ## f.close() ! ## except IOError,info: ! ## mesg = "Failed to check the address (IO), %s" % info ! ## if GM_DEBUG: logging.warning(mesg) ! ## return mesg ! ## else: ! ## for line in lines: ! ## if name in line and addr in line: ! ## return ! ## # It's a new entry ! ## line = "%s&&%s&&%s&&%s\n" % (name,addr,notes,id) ! ## if GM_DEBUG: logging.debug("Found new contact %s" % line) ! ## try: ! ## f = open(addrfile,'a') ! ## f.write(line) ! ## f.close() ! ## except IOError,info: ! ## f.close() ! ## mesg = "Failed to store address, %s" % info ! ## if GM_DEBUG: logging.warning(mesg) ! ## return mesg ! ## ! ##def load_addressfile(filename): ! ## if GM_DEBUG: logging.debug("\n>>>>>>>> Function: load_addressfile") ! ## try: ! ## f = open(filename,'r') ! ## lines = f.readlines() ! ## f.close() ! ## except IOError,info: ! ## if GM_DEBUG: logging.warning(str(info)) ! ## return ! ## if GM_DEBUG: logging.debug(str(lines)) ! ## newlines = [] ! ## for line in lines: ! ## newlines.append(tuple(line[:-1].split("&&"))) ! ## return (newlines) ! ## ! ##def import_contacts(addrfile,ga): ! ## """This gets the gmail contacts create a new local contacts list on disk.""" ! ## if GM_DEBUG: logging.debug("\n>>>>>>>> Function: import_contacts") ! ## upload_local_contacts(addrfile,ga) ! ## contacts = ga.getContacts().getAllContacts() ! ## logging.debug("Contacts imported:\n%s" % contacts) ! ## if contacts: ! ## # remove local file, we can remove it because the upload_local_contacts method will make sure ! ## # that the contacts are syncronized. ! ## logging.debug("Removing local file") ! ## open(addrfile,'w').close() ! ## else: ! ## return ! ## for obj in contacts: ! ## store_address(addrfile,\ ! ## obj.getName(),\ ! ## obj.getEmail(),\ ! ## obj.getNotes(),\ ! ## obj.getId()) ! ## return load_addressfile(addrfile) ! ## ! ##def export_contacts(addrfile,ga): ! ## """This will remove the contacts at the online contacts list and replace ! ## it with the local copy fom disk. ! ## It will return a message on any error. ! ## It returns None on succes.""" ! ## if GM_DEBUG: logging.debug("\n>>>>>>>> Function: export_contacts") ! ## entries = load_addressfile(addrfile) ! ## if len(entries) < 1: ! ## text = "Failed to load address file, %s" % addrfile ! ## if GM_DEBUG: logging.critical(text) ! ## return text ! ## try: ! ## contacts = ga.getContacts().getAllContacts() ! ## # Just to test save_contacts ! ## save_contacts(contacts) ! ## for contact in contacts: ! ## if GM_DEBUG: logging.debug("Removing contact %s", contact) ! ## ga.removeContact(contact) ! ## except Exception,info: ! ## logging.critical(str(info)) ! ## if contacts: ! ## save_contacts(contacts) ! ## return "An error occured, tried to save your contacts to\n%s and %s" %\ ! ## ('~/.GmailContacts.txt','~/.GmailContacts.pickle') ! ## # Now we fill the contacts list again from the local file. ! ## try: ! ## for entry in entries: ! ## if GM_DEBUG: logging.debug("Adding contact %s", entry) ! ## apply(ga.addContact,entry[:-1]) ! ## except Exception,info: ! ## logging.critical(str(info)) ! ## save_contacts(contacts) ! ## ! ##def save_contacts(contacts): ! ## """Save the contact in case of an error. This is an attempt to prevent ! ## data loss in case of an error when interacting with Gmail contacts.""" ! ## if GM_DEBUG: logging.debug("\n>>>>>>>> Function: save_contacts") ! ## try: ! ## f = open(os.path.expanduser('~/.GmailContacts.pickle'),'w') ! ## pickle.dump(contacts,f) ! ## ## XXX TODO: some way to load the pickled object and restore it ! ## except Exception,info: ! ## text = "Attempt to pickle the contacts %s" % str(info) ! ## logging.critical(text) ! ## f.close() ! ## try: ! ## f =open(os.path.expanduser('~/.GmailContacts.txt'),'w') ! ## text = "#An error occured in GmailAgent and these contacts are saved\n"+\ ! ## "#to this file in an attempt to save them\n"+\ ! ## "#A contact is saved as follows:\n"+\ ! ## "#GmailID Name email notes\n" ! ## f.write(text) ! ## for con in contacts: ! ## name,email,notes,id = con.getName(),con.getEmail(),con.getNotes(),con.getId() ! ## f.write("%s %s %s %s\n" % (con.getId(),\ ! ## con.getName(),\ ! ## con.getEmail(),\ ! ## con.getNotes())) ! ## f.close() ! ## except Exception,info: ! ## logging.critical(str(info)) ! ## return str(info) ! ## --- 92,111 ---- except: if GM_DEBUG: logging.warning("Failed to load the password from %s" % rcfile) ! return (1,"Failed to load the name and password from %s" % rcfile) return (0,(name,pas)) ! def start_gcm(gac,qapp): ! if not USE_CONTACTS: ! return (1, "Can't find gcm-qt.\nMake sure that you have installed gcm.\See the GmailAgent for more info.") ! try: ! from GCM_qt import GuiQTgcm ! gcm = GuiQTgcm.MainWin(gac=gac,application=qapp) ! except Exception,info: ! print info ! return (1, "An error occured in gcm:\n%s" % info) ! else: ! return (0, gcm) ! ! ! Index: AddressDialog.ui =================================================================== RCS file: /cvsroot/gmailagent/GA-main/AddressDialog.ui,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AddressDialog.ui 8 Jun 2005 12:28:17 -0000 1.5 --- AddressDialog.ui 14 Sep 2005 11:36:28 -0000 1.6 *************** *** 41,63 **** <widget class="QLabel"> <property name="name"> - <cstring>textLabel1</cstring> - </property> - <property name="geometry"> - <rect> - <x>80</x> - <y>10</y> - <width>140</width> - <height>20</height> - </rect> - </property> - <property name="text"> - <string><b>Addressbook</b></string> - </property> - <property name="textFormat"> - <enum>RichText</enum> - </property> - </widget> - <widget class="QLabel"> - <property name="name"> <cstring>textLabel2</cstring> </property> --- 41,44 ---- *************** *** 273,290 **** </property> </widget> ! <widget class="QPushButton"> <property name="name"> ! <cstring>pushButtonImport</cstring> </property> <property name="geometry"> <rect> ! <x>160</x> ! <y>360</y> ! <width>120</width> ! <height>26</height> </rect> </property> <property name="text"> ! <string>Import contacts</string> </property> </widget> --- 254,274 ---- </property> </widget> ! <widget class="QLabel"> <property name="name"> ! <cstring>textLabel1</cstring> </property> <property name="geometry"> <rect> ! <x>80</x> ! <y>10</y> ! <width>140</width> ! <height>20</height> </rect> </property> <property name="text"> ! <string><b>Gmail contacts</b></string> ! </property> ! <property name="textFormat"> ! <enum>RichText</enum> </property> </widget> *************** *** 363,372 **** <slot>lineEditSearch_textChanged(const QString&)</slot> </connection> - <connection> - <sender>pushButtonImport</sender> - <signal>clicked()</signal> - <receiver>FormAddress</receiver> - <slot>pushButtonImport_clicked()</slot> - </connection> </connections> <includes> --- 347,350 ---- *************** *** 382,386 **** <slot>listViewSend_clicked( QListViewItem * )</slot> <slot>lineEditSearch_textChanged( const QString & )</slot> - <slot>pushButtonImport_clicked()</slot> </slots> <layoutdefaults spacing="6" margin="11"/> --- 360,363 ---- Index: AddressDialog_forms.py =================================================================== RCS file: /cvsroot/gmailagent/GA-main/AddressDialog_forms.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** AddressDialog_forms.py 8 Jun 2005 12:28:17 -0000 1.13 --- AddressDialog_forms.py 14 Sep 2005 11:36:28 -0000 1.14 *************** *** 3,7 **** # Form implementation generated from reading ui file 'AddressDialog.ui' # ! # Created: Mon Jun 6 20:34:33 2005 # by: The PyQt User Interface Compiler (pyuic) 3.14.1 # --- 3,7 ---- # Form implementation generated from reading ui file 'AddressDialog.ui' # ! # Created: Mon Aug 15 12:50:15 2005 # by: The PyQt User Interface Compiler (pyuic) 3.14.1 # *************** *** 118,125 **** - self.textLabel1 = QLabel(self,"textLabel1") - self.textLabel1.setGeometry(QRect(80,10,140,20)) - self.textLabel1.setTextFormat(QLabel.RichText) - self.textLabel2 = QLabel(self,"textLabel2") self.textLabel2.setGeometry(QRect(390,10,80,20)) --- 118,121 ---- *************** *** 163,168 **** self.listViewBook.setShowSortIndicator(1) ! self.pushButtonImport = QPushButton(self,"pushButtonImport") ! self.pushButtonImport.setGeometry(QRect(160,360,120,26)) self.pushButtonEdit = QPushButton(self,"pushButtonEdit") --- 159,165 ---- self.listViewBook.setShowSortIndicator(1) ! self.textLabel1 = QLabel(self,"textLabel1") ! self.textLabel1.setGeometry(QRect(80,10,140,20)) ! self.textLabel1.setTextFormat(QLabel.RichText) self.pushButtonEdit = QPushButton(self,"pushButtonEdit") *************** *** 182,191 **** self.connect(self.listViewSend,SIGNAL("clicked(QListViewItem*)"),self.listViewSend_clicked) self.connect(self.lineEditSearch,SIGNAL("textChanged(const QString&)"),self.lineEditSearch_textChanged) - self.connect(self.pushButtonImport,SIGNAL("clicked()"),self.pushButtonImport_clicked) def languageChange(self): self.setCaption(self.__tr("GmailAgent - Addressbook")) - self.textLabel1.setText(self.__tr("<b>Addressbook</b>")) self.textLabel2.setText(self.__tr("<b>Send to:</b>")) self.pushButton_add.setText(QString.null) --- 179,186 ---- *************** *** 200,204 **** self.listViewBook.header().setLabel(0,self.__tr("Name")) self.listViewBook.header().setLabel(1,self.__tr("Email Address")) ! self.pushButtonImport.setText(self.__tr("Import contacts")) self.pushButtonEdit.setText(self.__tr("Edit addressbook")) --- 195,199 ---- self.listViewBook.header().setLabel(0,self.__tr("Name")) self.listViewBook.header().setLabel(1,self.__tr("Email Address")) ! self.textLabel1.setText(self.__tr("<b>Gmail contacts</b>")) self.pushButtonEdit.setText(self.__tr("Edit addressbook")) *************** *** 228,234 **** print "FormAddress.lineEditSearch_textChanged(const QString&): Not implemented yet" - def pushButtonImport_clicked(self): - print "FormAddress.pushButtonImport_clicked(): Not implemented yet" - def __tr(self,s,c = None): return qApp.translate("FormAddress",s,c) --- 223,226 ---- Index: GmailAgent.e3p =================================================================== RCS file: /cvsroot/gmailagent/GA-main/GmailAgent.e3p,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** GmailAgent.e3p 6 Jun 2005 18:26:08 -0000 1.14 --- GmailAgent.e3p 14 Sep 2005 11:36:28 -0000 1.15 *************** *** 2,6 **** <!DOCTYPE Project SYSTEM "Project-3.5.dtd"> <!-- Project file for project GmailAgent --> ! <!-- Saved: 2005-06-06, 17:29:27 --> <!-- 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-08-11, 17:20:42 --> <!-- Copyright (C) 2005 Stas Zytkiewicz, st...@li... --> <Project version="3.5"> *************** *** 38,44 **** </Source> <Source> - <Name>AddressBook.py</Name> - </Source> - <Source> <Name>AddressDialog_forms.py</Name> </Source> --- 38,41 ---- *************** *** 55,61 **** <Name>AddressEditorDialog_forms.py</Name> </Source> - <Source> - <Name>libgmail2.py</Name> - </Source> </Sources> <Forms> --- 52,55 ---- Index: AddressDialog.ui.h =================================================================== RCS file: /cvsroot/gmailagent/GA-main/AddressDialog.ui.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AddressDialog.ui.h 1 Jun 2005 18:07:28 -0000 1.2 --- AddressDialog.ui.h 14 Sep 2005 11:36:28 -0000 1.3 *************** *** 60,65 **** - void FormAddress::pushButtonImport_clicked() - { - - } --- 60,61 ---- Index: filelist =================================================================== RCS file: /cvsroot/gmailagent/GA-main/filelist,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** filelist 1 Jun 2005 18:35:23 -0000 1.8 --- filelist 14 Sep 2005 11:36:28 -0000 1.9 *************** *** 1,13 **** INSTALL README - ../GA-libgmail2/constants.py GmailAgent.py Gmail.py GuiQT.py - ../GA-libgmail2/libgmail2.py AboutDialog_forms.py LoginDialog_forms.py MainWin_forms.py - AddressBook.py AddressDialog_forms.py HelpDialog_forms.py --- 1,10 ---- Index: GuiQT.py =================================================================== RCS file: /cvsroot/gmailagent/GA-main/GuiQT.py,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** GuiQT.py 14 Jun 2005 14:17:31 -0000 1.35 --- GuiQT.py 14 Sep 2005 11:36:28 -0000 1.36 *************** *** 31,35 **** from AddressDialog_forms import FormAddress ! import Gmail,AddressBook import sys,os,logging --- 31,36 ---- from AddressDialog_forms import FormAddress ! import Gmail ! import sys,os,logging *************** *** 41,63 **** helppath = paths.helppath if GQ_DEBUG: logging.debug("helppath is %s" % helppath) ! rcfile = os.path.expanduser('~/.gmailagent') ! # TODO Add a addrfile path to the rcfile? # By doing so we can startup with the user selected addressfile? # REMINDER the addressfile is a local copy of the Gmail contacts. ! addrfile = os.path.expanduser('~/.gmailaddressbook') ! if not os.path.exists(addrfile): ! try: ! open(addrfile,'w') ! except IOError,info: ! if GQ_DEBUG: logging.warning(str(info)) class Message: ! """Just a container to pass stuff around""" pass # see self.send_message for usage class Observer: ! """Classic observer to monitor changes in some model""" def __init__(self,func): if GQ_DEBUG: logging.debug("\n>>>>>>>> Class: %s" % self.__class__.__name__) --- 42,65 ---- helppath = paths.helppath if GQ_DEBUG: logging.debug("helppath is %s" % helppath) ! RCFILE = os.path.expanduser('~/.gmailagent') ! # TODO Add a addrfile path to the RCFILE? # By doing so we can startup with the user selected addressfile? # REMINDER the addressfile is a local copy of the Gmail contacts. ! ##addrfile = os.path.expanduser('~/.gmailaddressbook') ! ##if not os.path.exists(addrfile): ! ## try: ! ## open(addrfile,'w') ! ## except IOError,info: ! ## if GQ_DEBUG: logging.warning(str(info)) class Message: ! """Just a container to hold the message.""" pass # see self.send_message for usage class Observer: ! """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__) *************** *** 97,100 **** --- 99,103 ---- self.mailbody = '' self.attachments = att + self.ga = None self.login = {'login':'','passwrd':''} if self.attachments: *************** *** 110,114 **** def pushButtonSend_clicked(self): - # get all the data from the dialog modal=0 --- 113,116 ---- *************** *** 140,144 **** def send_message(self,ga): """This will send the message to Gmail and stores the address(es) in the ! addressbook.""" self.progress_dlg.update() --- 142,147 ---- def send_message(self,ga): """This will send the message to Gmail and stores the address(es) in the ! addressbook. ! It's called by the observer.""" self.progress_dlg.update() *************** *** 149,153 **** #obj.login = self.login# not used, yet? obj.ga = ga#gmail account object ! result = Gmail.send_message(obj) if result[0]: --- 152,156 ---- #obj.login = self.login# not used, yet? obj.ga = ga#gmail account object ! self.ga = ga result = Gmail.send_message(obj) if result[0]: *************** *** 157,169 **** else: self.progress_dlg.update() - adrlist = self.mailheader['to'].split(',') - for adr in adrlist: - try: - name,foo = adr.split("@") - except Exception,info: - if GQ_DEBUG: logging.warning("trying to store address, %s" % info) - else: - if Gmail.store_address(addrfile,name,adr): - pass QMessageBox.information(self, "Info",result[1], --- 160,163 ---- *************** *** 182,186 **** return 1# this is checked by closeEvent ! def pushButtonAdress_clicked(self): # 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 --- 176,180 ---- return 1# this is checked by closeEvent ! def pushButtonAdress_clicked(self,ga=None): # 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 *************** *** 192,197 **** QMessageBox.Ok) return self.obs = Observer(self.lineEditTo.setText) ! ad = AddressBookDialog(self,observer=self.obs) def lineEditTo_textChanged(self,a0): --- 186,215 ---- QMessageBox.Ok) 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"+\ + "If you do not then a local copy, if available, will\n"+\ + "be used.\n"+\ + "Be aware that any changes you want to make to the\n"+\ + "contacts require access to your Gmail account." + dlg = Gmail.ModalPopup(parent=self,text=txt) + ## BIG TODO: make this work :-) + if dlg.start():# Yes + obs = Observer(self._get_contacts) + login = Login(parent=self,observer=obs) + else: + self._get_local_contacts() + else: + self._get_contacts(self.ga) + + def _get_contacts(self,ga): + """Callback for the observer""" 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""" ! self.obs = Observer(self.lineEditTo.setText) ! AddressBookDialog(self,observer=self.obs) def lineEditTo_textChanged(self,a0): *************** *** 209,214 **** self.keepsettings = 0 self.logindata = None ! if os.path.exists(rcfile): ! result = Gmail.load_login(rcfile) if result[0]: self.logindata = None --- 227,232 ---- self.keepsettings = 0 self.logindata = None ! if os.path.exists(RCFILE): ! result = Gmail.load_login(RCFILE) if result[0]: self.logindata = None *************** *** 295,299 **** class AddressBookDialog(FormAddress): ! def __init__(self,parent=None,name=None,modal=0,fl=0,file=addrfile,observer=None): if GQ_DEBUG: logging.debug("\n>>>>>>>> Class: %s" % self.__class__.__name__) FormAddress.__init__(self,parent,name,modal,fl) --- 313,317 ---- class AddressBookDialog(FormAddress): ! 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__) FormAddress.__init__(self,parent,name,modal,fl) *************** *** 302,316 **** self.parent_observer = observer self.progress_dlg = None ! if os.path.exists(file): ! self._load(file) self.show() def pushButtonEdit_clicked(self): ! pass ! # seems we must prevent the garbage collector from removing the observer ! # object so we make it a class attribute. ! ##self.Myobs = Observer(self._load) ! #ad = AddressBook.ABMainWindow(parent=self,observer=self.Myobs,file=addrfile) ! ##AddressBookEditorDialog(parent=self) def pushButtonOk_clicked(self): --- 320,357 ---- 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: ! result = Gmail.load_login(RCFILE) ! if result[0]: ! QMessageBox.critical(self, ! "Error", result[1], ! QMessageBox.Ok) ! return ! name,pas = result[1] ! self.GC = Gmail.Contrgcm.GC(name,pas) ! conlist = self.GC.import_contacts_db() ! if conlist: ! self._load(conlist) ! print "AddressBookDialog conlist",conlist self.show() def pushButtonEdit_clicked(self): ! if self.gcm: ! return ! result = Gmail.start_gcm(self.GC,Qapplication) ! print "result",result ! if result[0]: ! QMessageBox.critical(self, ! "Error", result[1], ! QMessageBox.Ok) ! return ! else: ! #We make it a attribute to prevent destruction by the Python Garbage collector ! self.gcm = result[1] def pushButtonOk_clicked(self): *************** *** 364,389 **** 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, filename): """Loads a local address file into the widget.""" # this is also called from the observer self.listViewBook.clear() ! lines = Gmail.load_addressfile(addrfile) # used by lineEditSearch_textChanged to lookup the name # keys are the names, vals are the listviewitems objects --- 405,430 ---- 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.""" # this is also called from the observer self.listViewBook.clear() ! ##lines = Gmail.load_addressfile(addrfile) # used by lineEditSearch_textChanged to lookup the name # keys are the names, vals are the listviewitems objects *************** *** 414,573 **** return objlist - ######## Everything below this point will become part of a seperate module ##### - ######## Leave it here until the new contacts frontend is functional ########### - - ##class AddressBookEditorDialog(FormAddressEditor): - ## def __init__(self,parent=None,name=None,modal=0,fl=0,file=addrfile,observer=None): - ## if GQ_DEBUG: logging.debug("\n>>>>>>>> Class: %s" % self.__class__.__name__) - ## FormAddressEditor.__init__(self,parent,name,modal,fl) - ## self.parent = parent - ## self.parent_observer = observer - ## self.loaded_local_file = None - ## self.selecteditem = None - ## self.ga = None# we want to test if we already have a Gmail account - ## text = "GmailAgent uses a local copy of your Gmail contacts list so\n"+\ - ## "before making changes you should (re)import your contacts list.\n\n"+\ - ## "Shall I import your Gmail contacts list now?" - ## ans = QMessageBox.information(self,"Question", text, - ## QMessageBox.Cancel,QMessageBox.Ok) - ## if ans == 1: - ## self.pushButtonImport_clicked() - ## else: - ## conlist = Gmail.load_addressfile(addrfile) - ## self._load(conlist) - ## self.loaded_local_file = 1 - ## self.show() - ## - ## def pushButtonImport_clicked(self): - ## print "FormAddressEditor.pushButtonImport_clicked()" - ## # The observer is passed to Login, after succes Login will call the observers - ## # _login_success method - ## self.progress_dlg = ProgressDialog(self,"Importing contacts",2) - ## 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 - ## self.progress_dlg.update() - ## # Get the contacts and merge them with the local copy - ## # The new local copy will be saved on disk and returnt to the caller. - ## conlist = Gmail.import_contacts(addrfile,self.ga) - ## self.loaded_local_file = None - ## self._load(conlist) - ## - ## def _load( self, conlist): - ## """Loads a contacts list into the widget.""" - ## self.listViewContacts.clear() - ## nameshash = {}# used also as a lookup hash - ## for line in conlist: - ## item = QListViewItem(self.listViewContacts) - ## try: - ## nameshash[line[0]] = item - ## item.setText(0,line[0]) - ## item.setText(1,line[1]) - ## item.setText(2,line[2][:60]) - ## item.setText(3,line[3]) - ## except Exception,info: - ## if GQ_DEBUG: - ## logging.warning("Reading addressbook failed, %s" % str(info)) - ## print info - ## return - ## self.parent._load(addrfile)# fill the parents view - ## try: - ## self.progress_dlg.update() - ## except: - ## pass - ## - ## def pushButtonOk_clicked(self): - ## print "FormAddressEditor.pushButtonOk_clicked()" - ## text = "Your contacts are kept in a local file on this system and you\n"+\ - ## "should summit it to your Gmail contacts list to keep everything\n"+\ - ## "in sync.\n\n"+\ - ## "WARNING,\n"+\ - ## "when summiting these contacts to your Gmail account the online Gmail\n"+\ - ## "the contacts list will be cleared and you will loose any changes you made online.\n\n"+\ - ## "Should I upload these contacts to your Gmail accounts contacts list?" - ## ans = QMessageBox.information(self,"Question", text, - ## QMessageBox.Cancel,QMessageBox.Ok) - ## if ans == 1: - ## if not self.ga: - ## obs = Observer(self._export_contacts) - ## Login(parent=self.parent,observer=obs) - ## else: - ## self._export_contacts(self.ga) - ## self.pushButtonCancel_clicked() - ## - ## def _export_contacts(self,ga): - ## Gmail.export_contacts(addrfile,ga) - ## - ## def pushButtonCancel_clicked(self): - ## # XXX we should also update the parent with the new contacts. - ## self.done(1) - ## - ## def pushButtonEdit_clicked(self): - ## print "FormAddressEditor.pushButtonEdit_clicked()" - ## entry = self.listViewContacts.selectedItem() - ## if not self.ga: - ## text = "You're not logged in your Gmail account.\n"+\ - ## "Hit the 'Import contacts' button to login and\n"+\ - ## "then you can edit the contacts." - ## QMessageBox.information(self,"Information", text,QMessageBox.Ok) - ## return - ## AddressBookEditDialog(entry,parent=self,ga=self.ga) - ## - ## def listView3_clicked(self,a0): - ## print "FormAddressEditor.listView3_clicked(QListViewItem*): Not implemented yet" - ## - ## def lineEditSearch_textChanged(self,a0): - ## print "FormAddressEditor.lineEditSearch_textChanged(const QString&)" - ## if not self.nameshash: return - ## # a0 is the text object - ## txt = str(a0) - ## for k,v in self.nameshash.items(): - ## if txt in k: - ## if self.selecteditem: - ## self.selecteditem.setSelected(0) - ## self.selecteditem.repaint() - ## v.setSelected(1) - ## v.repaint() - ## self.selecteditem = v - ## break - ## - ## def pushButtonAdd_clicked(self): - ## print "FormAddressEditor.pushButtonAdd_clicked(): Not implemented yet" - ## - ## def pushButtonRemove_clicked(self): - ## print "FormAddressEditor.pushButtonRemove_clicked(): Not implemented yet" - ## - ## def pushButtonHelp_clicked(self): - ## print "FormAddressEditor.pushButtonHelp_clicked(): Not implemented yet" - ## - ##class AddressBookEditDialog(FormAddressEdit): - ## def __init__(self,entry,parent=None,name=None,modal=0,fl=0,file=addrfile,observer=None,ga=None): - ## if GQ_DEBUG: logging.debug("\n>>>>>>>> Class: %s" % self.__class__.__name__) - ## FormAddressEdit.__init__(self,parent,name,modal,fl) - ## self.parent = parent - ## self.parent_observer = observer - ## self.entry = entry - ## self.ga = ga - ## name, email, notes,self.id = entry.text(0),entry.text(1),entry.text(2),entry.text(3) - ## if GQ_DEBUG: logging.debug("received entry: %s %s %s %s" % (name,email,notes,self.id)) - ## self.lineEditName.setText(name) - ## self.lineEditEmail.setText(email) - ## self.textEditNotes.setText(notes) - ## self.show() - ## - ## def pushButtonOk_clicked(self): - ## print "FormAddressEdit.pushButtonOk_clicked(): Not implemented yet" - ## self.entry.repaint()#update the entry in the view - ## name = str(self.lineEditName.text()) - ## email = str(self.lineEditEmail.text()) - ## notes = str(self.textEditNotes.text()) - ## Gmail.store_address(addrfile,name,email,notes,id=self.id,ga=self.ga) - ## - ## def pushButtonCancel_clicked(self): - ## self.done(1) - --- 455,456 ---- Index: MainWin_forms.py =================================================================== RCS file: /cvsroot/gmailagent/GA-main/MainWin_forms.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** MainWin_forms.py 8 Jun 2005 12:28:17 -0000 1.26 --- MainWin_forms.py 14 Sep 2005 11:36:28 -0000 1.27 *************** *** 3,7 **** # Form implementation generated from reading ui file 'MainWin.ui' # ! # Created: Mon Jun 6 20:34:32 2005 # by: The PyQt User Interface Compiler (pyuic) 3.14.1 # --- 3,7 ---- # Form implementation generated from reading ui file 'MainWin.ui' # ! # Created: Mon Aug 15 12:50:15 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.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** HelpDialog_forms.py 8 Jun 2005 12:28:17 -0000 1.12 --- HelpDialog_forms.py 14 Sep 2005 11:36:28 -0000 1.13 *************** *** 3,7 **** # Form implementation generated from reading ui file 'HelpDialog.ui' # ! # Created: Mon Jun 6 20:34:33 2005 # by: The PyQt User Interface Compiler (pyuic) 3.14.1 # --- 3,7 ---- # Form implementation generated from reading ui file 'HelpDialog.ui' # ! # Created: Mon Aug 15 12:50:15 2005 # by: The PyQt User Interface Compiler (pyuic) 3.14.1 # Index: AboutDialog_forms.py =================================================================== RCS file: /cvsroot/gmailagent/GA-main/AboutDialog_forms.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** AboutDialog_forms.py 8 Jun 2005 12:28:17 -0000 1.23 --- AboutDialog_forms.py 14 Sep 2005 11:36:28 -0000 1.24 *************** *** 3,7 **** # Form implementation generated from reading ui file 'AboutDialog.ui' # ! # Created: Mon Jun 6 20:34:33 2005 # by: The PyQt User Interface Compiler (pyuic) 3.14.1 # --- 3,7 ---- # Form implementation generated from reading ui file 'AboutDialog.ui' # ! # Created: Mon Aug 15 12:50:15 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.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** LoginDialog_forms.py 8 Jun 2005 12:28:17 -0000 1.26 --- LoginDialog_forms.py 14 Sep 2005 11:36:28 -0000 1.27 *************** *** 3,7 **** # Form implementation generated from reading ui file 'LoginDialog.ui' # ! # Created: Mon Jun 6 20:34:33 2005 # by: The PyQt User Interface Compiler (pyuic) 3.14.1 # --- 3,7 ---- # Form implementation generated from reading ui file 'LoginDialog.ui' # ! # Created: Mon Aug 15 12:50:15 2005 # by: The PyQt User Interface Compiler (pyuic) 3.14.1 # Index: GmailAgent.py =================================================================== RCS file: /cvsroot/gmailagent/GA-main/GmailAgent.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** GmailAgent.py 14 Jun 2005 14:17:31 -0000 1.16 --- GmailAgent.py 14 Sep 2005 11:36:28 -0000 1.17 *************** *** 31,35 **** try: logging.basicConfig(level=logging.DEBUG,\ ! format='GmailAgent:%(module)s,%(lineno)d; %(levelname)s %(message)s') except TypeError: # Python <=2.3? --- 31,35 ---- try: logging.basicConfig(level=logging.DEBUG,\ ! format='\nGmailAgent:%(module)s,%(lineno)d; %(levelname)s %(message)s') except TypeError: # Python <=2.3? Index: setup.py =================================================================== RCS file: /cvsroot/gmailagent/GA-main/setup.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** setup.py 26 May 2005 06:23:29 -0000 1.5 --- setup.py 14 Sep 2005 11:36:28 -0000 1.6 *************** *** 10,13 **** --- 10,24 ---- execpath = '/usr/local/bin/gmailagent' + import sys + # check for libgmail + try: + import libgmail + except ImportError,info: + print "******* ERROR ******" + print info + print "GmailAgent depends on libgmail which is not installed." + print "See http://libgmail.sf.net" + sys.exit(1) + import version DESCRIPTION = """GmailAgent is a application that acts as a email client and can be used by programs *************** *** 31,35 **** #get us to the correct directory ! import os, sys path = os.path.split(os.path.abspath(sys.argv[0]))[0] os.chdir(path) --- 42,46 ---- #get us to the correct directory ! import os path = os.path.split(os.path.abspath(sys.argv[0]))[0] os.chdir(path) *************** *** 123,127 **** print "=========== Installation Ok ================" ! print "\nThe GmailAgent executable is installed in\n %s" % os.path.dirname(execpath) print "You should read the README file that came with this package\nfor possible usage" --- 134,138 ---- print "=========== Installation Ok ================" ! print "\nThe GmailAgent executable is %s" % execpath print "You should read the README file that came with this package\nfor possible usage" Index: TODO =================================================================== RCS file: /cvsroot/gmailagent/GA-main/TODO,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** TODO 10 Jun 2005 09:22:07 -0000 1.13 --- TODO 14 Sep 2005 11:36:28 -0000 1.14 *************** *** 5,16 **** Perhaps copy the first message and add 'part #' to the subject line ? ! Make sure we remove old addressbook files when installing ! new vesrions. ! ! New addressbook ! Add button callbacks ! Check if the logic is sound and we don't loose contacts ! ! Contacts stuff still sucks (local) Make sure any progressdialogs are closed when a cancel button is pressed. --- 5,9 ---- Perhaps copy the first message and add 'part #' to the subject line ? ! Check if the logic is sound and we don't loose contacts Make sure any progressdialogs are closed when a cancel button is pressed. |
From: Stas Z. <sta...@us...> - 2005-08-11 13:48:47
|
Update of /cvsroot/gmailagent/GA-main In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26994 Removed Files: AddressBook.py Log Message: removed obsolete file --- AddressBook.py DELETED --- |
From: Stas Z. <sta...@us...> - 2005-08-11 13:22:41
|
Update of /cvsroot/gmailagent/GA-Qgcm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21992 Modified Files: Qgcm.e3p filelist Added Files: setup.py Removed Files: INSTALL.sh Log Message: Changed the install to the gailagent kind of install --- NEW FILE: setup.py --- #!/usr/bin/env python # # This is the distutils setup script for GmailAgent. # Based on the pygame setup scripts. # Change this to the location where the help files, manpage and docs should be located. # A special file will be created and placed inside the GmailAgent directory # pointing to this location. basepath = '/usr/local/share' execpath = '/usr/local/bin/gcm-qt' import version DESCRIPTION = """gcm-qt is a frontend to the libgmail contacts support using the QT widget set. It's part of the GmailAgent project.""" METADATA = { "name": "gcm-qt", "version": version.VERSION, "license": "GPL", "url": "http://gmailagent.sf.net", "author": "Stas Zytkiewicz", "author_email": "gma...@us...", "description": "QT GUI frontend to the libgmail contacts support.", "long_description": DESCRIPTION, } try: import distutils except ImportError: raise SystemExit, "gcm-qt requires distutils (Python-dev) to build and install." #get us to the correct directory import os, sys path = os.path.split(os.path.abspath(sys.argv[0]))[0] os.chdir(path) import os.path, glob import distutils.sysconfig from distutils.core import setup from distutils.command.install_data import install_data #extra files to install data_files = [] sys.argv.append('install') #add non .py files in directory for f in glob.glob('*'): if not f[-3:] =='.py' and os.path.isfile(f): data_files.append(f) #data installer with improved intelligence over distutils #data files are copied into the project directory instead #of willy-nilly class smart_install_data(install_data): def run(self): #need to change self.install_dir to the actual library dir install_cmd = self.get_finalized_command('install') self.install_dir = getattr(install_cmd, 'install_lib') return install_data.run(self) #finally, #call distutils with all needed info PACKAGEDATA = { "cmdclass": {'install_data': smart_install_data}, "packages": ['GCM-qt'], "package_dir": {'GCM-qt':''}, "data_files": [['GCM-qt', data_files]], } PACKAGEDATA.update(METADATA) apply(setup, [], PACKAGEDATA) destdir = os.path.join(distutils.sysconfig.get_python_lib(),'GCM-qt') print "destdir",destdir try: f = open(execpath,'w') f.write("#!/bin/sh\n") f.write("exec python %s $*\n" % os.path.join(destdir,'Qgcm.py')) f.close() cmd = 'chmod +x %s' % execpath os.system(cmd) except Exception,info: print info print "Failed to install the executable" print "Please contact gma...@us..." sys.exit(1) ## From here gcm is installed and there's a shell starter installed. ## Now we going to install the help files and some docs. docbasepath = os.path.join(basepath,'doc','GCM-qt') helppath = os.path.join(docbasepath,'help') docpath = os.path.join(docbasepath,'doc') manpath = os.path.join(basepath,'man','man1') ##try: ## os.makedirs(helppath) ##except: ## pass try: os.makedirs(docpath) except: pass ##try: ## os.makedirs(manpath) ##except: ## pass print "copying the docs to %s" % docbasepath try: os.system('cp -rf docs/* %s' % docpath) ##print "copying the manpage to %s" % manpath ##os.system('mv %s %s' % (os.path.join(docpath,'gmailagent.1.gz'),manpath)) print "Moving README to %s" % docpath os.system('mv %s %s' % (os.path.join(destdir,'README'),docpath)) ##os.system('mv %s %s' % (os.path.join(destdir,'INSTALL'),docpath)) except Exception,info: print info print "Failed to install the docs" print "=========== Installation Ok ================" print "\nThe gcm-qt executable is installed in\n %s" % os.path.dirname(execpath) print "You should read the README file that came with this package\nfor possible usage" print "Enjoy" --- INSTALL.sh DELETED --- Index: Qgcm.e3p =================================================================== RCS file: /cvsroot/gmailagent/GA-Qgcm/Qgcm.e3p,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Qgcm.e3p 7 Aug 2005 19:08:46 -0000 1.1.1.1 --- Qgcm.e3p 11 Aug 2005 13:22:33 -0000 1.2 *************** *** 2,6 **** <!DOCTYPE Project SYSTEM "Project-3.5.dtd"> <!-- Project file for project Qgcm --> ! <!-- Saved: 2005-08-06, 21:21:26 --> <!-- Copyright (C) 2005 , --> <Project version="3.5"> --- 2,6 ---- <!DOCTYPE Project SYSTEM "Project-3.5.dtd"> <!-- Project file for project Qgcm --> ! <!-- Saved: 2005-08-10, 16:44:28 --> <!-- Copyright (C) 2005 , --> <Project version="3.5"> *************** *** 26,32 **** </Source> <Source> - <Name>testContrgcm.py</Name> - </Source> - <Source> <Name>QgcmDialogs.py</Name> </Source> --- 26,29 ---- Index: filelist =================================================================== RCS file: /cvsroot/gmailagent/GA-Qgcm/filelist,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** filelist 10 Aug 2005 14:42:47 -0000 1.1 --- filelist 11 Aug 2005 13:22:33 -0000 1.2 *************** *** 10,12 **** version.py README ! INSTALL.sh --- 10,12 ---- version.py README ! setup.py |
From: Stas Z. <sta...@us...> - 2005-08-10 14:44:05
|
Update of /cvsroot/gmailagent/GA-Qgcm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25073 Added Files: INSTALL.sh Log Message: Added install script --- NEW FILE: INSTALL.sh --- #!/bin/bash PREFIX=/usr/local ################################################################# # DON'T EDIT BEHIND THIS POINT ################################################################# if [ $* ] then PREFIX=$* fi echo "PREFIX=$PREFIX" PYTHON=`which python` BINDIR=$PREFIX/bin LOCALEDIR=$PREFIX/share/locale DOCDIR=$PREFIX/share/doc/gcm-qt MANDIR=$PREFIX/man/man6 SHAREDIR=$PREFIX/share/gcm-qt echo "Making directorys" mkdir -vp $BINDIR mkdir -vp $DOCDIR mkdir -vp $LOCALEDIR mkdir -vp $MANDIR mkdir -vp $SHAREDIR set -e CWD=`pwd` USERID=`id | sed -e 's/).*//; s/^.*(//;'` if [ "$USERID" != "root" ]; then echo " You must be root to install the plugins" echo " exit" exit 1 fi echo -e "\n>>>>>>>>>>> Install gcm-qt >>>>>>>>>>>>>>>>>>>>" echo " Installing in $PREFIX" ## Begin install cp -f $CWD/*.py $SHAREDIR/ ### Placeholder for future install stuff ###### #cp -rf $CWD/Data/icons $SHAREDATADIR/ #echo " Copy locale files" #cp -rf $CWD/locale/* $LOCALEDIR/ #echo " Copy manpage" #cp -f $CWD/man/* $MANDIR/ ############################################## echo " Copy docs" cp -rf $CWD/docs/* $DOCDIR/ echo " Copy executable and setting permissions." echo "#!/bin/sh" > $CWD/gcm-qt.sh echo "$PYTHON $SHAREDIR/Qgcm.py $* &" >> $CWD/gcm-qt.sh cp -f $CWD/gcm-qt.sh $BINDIR/gcm-qt chmod +x $BINDIR/gcm-qt echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" echo "" echo " Instalation of gcm complete" echo " The gcm executable is $BINDIR/gcm-qt" echo "" echo " Enjoy." echo "" |
From: Stas Z. <sta...@us...> - 2005-08-10 14:42:56
|
Update of /cvsroot/gmailagent/GA-Qgcm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24607 Modified Files: Contrgcm.py Added Files: MakeTarBall.py README filelist folderlist version.py Log Message: Added files needed to create a release. --- NEW FILE: version.py --- # used by the maketarball script and the about dialog VERSION='0.2' Index: Contrgcm.py =================================================================== RCS file: /cvsroot/gmailagent/GA-Qgcm/Contrgcm.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Contrgcm.py 7 Aug 2005 19:08:46 -0000 1.1.1.1 --- Contrgcm.py 10 Aug 2005 14:42:47 -0000 1.2 *************** *** 73,82 **** class GC: ! def __init__(self,name,pas): """Create a object to control the access to Gmail contacts. @name and @pas are the account and password. A NoDBaseError is raised when the local database can't be created. """ ! self.ga = libgmail.GmailAccount(name,pas) try: self._DBase = self.setup_database(name) --- 73,89 ---- class GC: ! def __init__(self,name,pas,ga=None): """Create a object to control the access to Gmail contacts. @name and @pas are the account and password. + @ga is a libgmail.GmailAccount object. It's assumed that the login method + is called. @ga should only be used if this class is used by another + program. This program should get it's own login object and then pass it + to us. A NoDBaseError is raised when the local database can't be created. """ ! if ga: ! self.ga = ga ! else: ! self.ga = libgmail.GmailAccount(name,pas) try: self._DBase = self.setup_database(name) --- NEW FILE: MakeTarBall.py --- #!/usr/bin/env python # make tarball! from version import VERSION import os def cleanup(*args): """Used by os.path.walk to traverse the tree and remove CVS dirs""" if os.path.split(args[1])[1] == "CVS": print "Remove ",args[1] os.system('rm -r %s' % args[1]) filelist = open('filelist', 'r') folderlist = open('folderlist', 'r') myFiles = filelist.readlines() myFolders = folderlist.readlines() os.system('mkdir gcm-qt_%s' % VERSION) for file in myFiles: os.system('cp %s gcm-qt_%s' % (file[:-1], VERSION)) for folder in myFolders: os.system('mkdir gcm-qt_%s/%s' % (VERSION, folder[:-1])) os.system('cp -r %s gcm-qt_%s' % (folder[:-1], VERSION)) # removing the CVS stuff os.path.walk('gcm-qt_%s' % VERSION,cleanup,None) print "\nCreate a GNU/Linux tarball..." try: execString = 'tar -czf gcm-qt_%s.tgz gcm-qt_%s/' % (VERSION, VERSION) print execString os.system(execString) except Exception,info: print info,"\nYou must have the tar package installed" else: print "Done.\n" print "Create a Windows compatible zipfile..." try: execString = 'zip -rq gcm-qt_%s.zip ./gcm-qt_%s' % (VERSION, VERSION) print execString os.system(execString) except Exception,info: print info,"\nYou must have the zip package installed." else: print "Done\n" os.system('rm -rf gcm-qt_%s' % VERSION) --- NEW FILE: filelist --- AddressEditDialog_forms.py Contrgcm.py GuiQTgcm.py LoginDialog_forms.py MainWinContacts_forms.py ModalPopUpDialog_forms.py Observers.py QgcmDialogs.py Qgcm.py version.py README INSTALL.sh --- NEW FILE: folderlist --- docs --- NEW FILE: README --- gcm-qt is a GUI to manage Gmail contacts and is part of the gmailagent project. It uses the QT widgetset and libgmail, you must make sure you have installed libgmail and pyqt before using gcm. gmailagent: http://gmailagent.sf.net libgmail: http://libgmail.sf.net pyqt: http://www.riverbankcomputing.co.uk/pyqt To install gcm-qt do as root: ./INSTALL.sh [Enter] This will install gcm-qt in /usr/local/... You can change the installation path by editing the INSTALL.sh file. gcm-qt is licensed under the GPL. See the file named COPYING for more information. You can reach the author here: st...@li... |
From: Stas Z. <sta...@us...> - 2005-08-10 14:42:55
|
Update of /cvsroot/gmailagent/GA-Qgcm/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24607/docs Added Files: COPYING Log Message: Added files needed to create a release. --- NEW FILE: COPYING --- GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> 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 Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. |
From: Stas Z. <sta...@us...> - 2005-08-10 14:41:46
|
Update of /cvsroot/gmailagent/GA-Qgcm/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24258/docs Log Message: Directory /cvsroot/gmailagent/GA-Qgcm/docs added to the repository |