• R/O
  • SSH
  • HTTPS

twitturn: Commit


Commit MetaInfo

Revision76 (tree)
Zeit2009-09-26 13:30:17
Autoryoucharmanums

Log Message

* Protected, location and source columns added. (Ticket #18884)

Ändern Zusammenfassung

Diff

--- trunk/twitturnTimeLineWidget.py (revision 75)
+++ trunk/twitturnTimeLineWidget.py (revision 76)
@@ -9,6 +9,7 @@
99 self.parentTabWidget = args[0]
1010 self.closable = False
1111
12+
1213 self.setupUi(self)
1314 self.treeWidget.setAttribute(
1415 QtCore.Qt.WA_InputMethodEnabled, False)
@@ -77,7 +78,7 @@
7778
7879 def loadSettings(self):
7980 self.treeWidget.header().restoreState(
80- self.settings.value("GUI/treeWidget/header").toByteArray())
81+ self.settings.value("GUI/treeWidget/header2").toByteArray())
8182
8283 def saveSettings(self):
8384 pass
--- trunk/twitturn.py (revision 75)
+++ trunk/twitturn.py (revision 76)
@@ -355,6 +355,18 @@
355355 self.restoreGUISettings()
356356 self.applySettings()
357357
358+ def importSettingValueFromSettingFile(
359+ self,
360+ fileName,
361+ key,
362+ ):
363+ fromSettings = QtCore.QSettings(
364+ fileName, QtCore.QSettings.IniFormat, self)
365+ toSettings = self.settings
366+ if fromSettings.contains(key):
367+ toSettings.setValue(key, fromSettings.value(key))
368+ toSettings.sync()
369+
358370 def exportSettings(self):
359371 fileName = QtGui.QFileDialog.getSaveFileName(
360372 self,
@@ -738,10 +750,10 @@
738750 self.enterFetchingMode()
739751 post.setText(9, "")
740752 def toggleSpam(self, post):
741- if post.text(10) == "True":
742- post.setText(10, "False")
753+ if post.text(10) == "":
754+ post.setText(10, "S")
743755 else:
744- post.setText(10, "True")
756+ post.setText(10, "")
745757 def openWeb(self):
746758 post = self.treeWidget.currentItem()
747759 if not post.text(6) == "":
@@ -802,12 +814,27 @@
802814
803815 def importDefaultSettings(self):
804816 self.importSettingFile( "TwitturnDefaultSettings.ini")
817+ def importSettingValueFromDefaultSettingFile(
818+ self,
819+ key,
820+ ):
821+ self.importSettingValueFromSettingFile(
822+ "TwitturnDefaultSettings.ini",
823+ key,
824+ )
805825
806826 def restoreGUISettings(self):
807827
808828 self.settings.beginGroup("GUI")
829+
830+ if not self.settings.contains("treeWidget/header2"):
831+ self.settings.endGroup()
832+ self.importSettingValueFromDefaultSettingFile(
833+ "GUI/treeWidget/header2")
834+ self.settings.beginGroup("GUI")
809835 self.treeWidget.header().restoreState(
810- self.settings.value("treeWidget/header").toByteArray())
836+ self.settings.value("treeWidget/header2").toByteArray())
837+
811838 self.restoreGeometry(
812839 self.settings.value("mainwindow/geometory").toByteArray())
813840 self.setVisible(
@@ -819,7 +846,7 @@
819846 # self.generateDefaultSettingFile()
820847
821848 self.settings.beginGroup("GUI")
822- self.settings.setValue("treeWidget/header",
849+ self.settings.setValue("treeWidget/header2",
823850 QtCore.QVariant(self.treeWidget.header().saveState()))
824851 self.settings.setValue("mainwindow/geometory",
825852 QtCore.QVariant(self.saveGeometry()))
--- trunk/twitturnCore.py (revision 75)
+++ trunk/twitturnCore.py (revision 76)
@@ -165,16 +165,26 @@
165165 timestamp = elm.findtext("created_at")
166166 statusId = elm.findtext("id")
167167 status = elm.findtext("text")
168+ source = elm.findtext("source")
169+ favorited = elm.findtext("favorited")
170+ replyToStatusId = elm.findtext("in_reply_to_status_id")
168171 sub = elm.find("user")
169- replyToStatusId = elm.findtext("in_reply_to_status_id")
172+ name = sub.findtext("name")
170173 nick = sub.findtext("screen_name")
171- name = sub.findtext("name")
174+ location = sub.findtext("location")
172175 icon = sub.findtext("profile_image_url")
173176 web = sub.findtext("url")
177+ protected = sub.findtext("protected")
174178 type = "stat"
175179 self.statuses.insert(
176180 0,
177- ( icon, nick, status, timestamp, statusId, name, web, type, replyToStatusId))
181+ ( icon, nick, status, timestamp,
182+ statusId, name, web, type, replyToStatusId,
183+ boolStrToFavStr(favorited),
184+ source, location,
185+ boolStrToProtectedStr(protected),
186+ ),
187+ )
178188 def parseAsDirectMessages(self, str):
179189 self.statuses = []
180190 if str == "":
@@ -212,17 +222,37 @@
212222 timestamp = elm.findtext("created_at")
213223 statusId = elm.findtext("id")
214224 status = elm.findtext("text")
225+ source = elm.findtext("source")
226+ favorited = elm.findtext("favorited")
227+ replyToStatusId = elm.findtext("in_reply_to_status_id")
215228 sub = elm.find("user")
216- replyToStatusId = elm.findtext("in_reply_to_status_id")
229+ name = sub.findtext("name")
217230 nick = sub.findtext("screen_name")
218- name = sub.findtext("name")
231+ location = sub.findtext("location")
219232 icon = sub.findtext("profile_image_url")
220233 web = sub.findtext("url")
234+ protected = sub.findtext("protected")
221235 type = "stat"
222236 self.statuses.insert(
223237 0,
224- ( icon, nick, status, timestamp, statusId, name, web, type, replyToStatusId))
238+ ( icon, nick, status, timestamp,
239+ statusId, name, web, type, replyToStatusId,
240+ boolStrToFavStr(favorited),
241+ source, location,
242+ boolStrToProtectedStr(protected),
243+ ),
244+ )
225245
246+def boolStrToFavStr(val):
247+ if val == "true":
248+ return "F"
249+ else:
250+ return ""
251+def boolStrToProtectedStr(val):
252+ if val == "true":
253+ return "P"
254+ else:
255+ return ""
226256 def parseAsApiLimitStatus(str):
227257 if str == "":
228258 return None
--- trunk/TwitturnDefaultSettings.ini (revision 75)
+++ trunk/TwitturnDefaultSettings.ini (revision 76)
@@ -1,2 +1,2 @@
11 [GUI]
2-treeWidget\header=@ByteArray(\0\0\0\xff\0\0\0\0\0\0\0\x1\0\0\0\x1\0\0\0\0\0\0\0\0\v\0\0\0\0\0\0\0\x1\0\0\0\x3\0\0\0\x6\0\0\0\x5\0\0\0\a\0\0\0\b\0\0\0\t\0\0\0\x4\0\0\0\x2\0\0\0\n\0\0\0\v\0\0\0\0\0\0\0\x1\0\0\0\t\0\0\0\x2\0\0\0\b\0\0\0\x4\0\0\0\x3\0\0\0\x5\0\0\0\x6\0\0\0\a\0\0\0\n\0\0\0\0\0\0\0\0\0\0\n\x94\0\0\0\v\x1\0\0\x1\0\0\0\0\0\0\0\0\0\0\0\0\x64\xff\xff\xff\xff\0\0\0\x81\0\0\0\0\0\0\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