GTG

Merge lp://staging/~bryce/gtg/code-cleanup into lp://staging/~gtg/gtg/old-trunk

Proposed by Bryce Harrington
Status: Merged
Merge reported by: Luca Invernizzi
Merged at revision: not available
Proposed branch: lp://staging/~bryce/gtg/code-cleanup
Merge into: lp://staging/~gtg/gtg/old-trunk
Diff against target: 211 lines (+26/-27)
4 files modified
GTG/core/requester.py (+1/-0)
GTG/taskeditor/editor.py (+13/-14)
GTG/taskeditor/taskview.py (+9/-10)
GTG/taskeditor/taskviewserial.py (+3/-3)
To merge this branch: bzr merge lp://staging/~bryce/gtg/code-cleanup
Reviewer Review Type Date Requested Status
Luca Invernizzi (community) Approve
Review via email: mp+19068@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Bryce Harrington (bryce) wrote :

Spelling fixes and a couple code cleanup type things

Revision history for this message
Luca Invernizzi (invernizzi) :
review: Approve
lp://staging/~bryce/gtg/code-cleanup updated
589. By Luca Invernizzi

Bryce's code cleanup

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'GTG/core/requester.py'
2--- GTG/core/requester.py 2009-12-26 20:57:17 +0000
3+++ GTG/core/requester.py 2010-02-11 01:59:13 +0000
4@@ -83,6 +83,7 @@
5 task will have no tags.
6 @param newtask: C{True} if this is creating a new task that never
7 existed, C{False} if importing an existing task from a backend.
8+ @return: A task.
9 """
10 task = self.ds.new_task(pid=pid, newtask=newtask)
11 if tags:
12
13=== modified file 'GTG/taskeditor/editor.py'
14--- GTG/taskeditor/editor.py 2010-01-21 17:34:00 +0000
15+++ GTG/taskeditor/editor.py 2010-02-11 01:59:13 +0000
16@@ -19,9 +19,9 @@
17
18 #This is the TaskEditor
19 #
20-#It's the window you see when you double-clic on a Task
21+#It's the window you see when you double-click on a Task
22 #The main text widget is a home-made TextView called TaskView (see taskview.py)
23-#The rest are the logic of the widget : date changing widgets, buttons, ...
24+#The rest is the logic of the widget : date changing widgets, buttons, ...
25 import sys
26 import time
27
28@@ -50,7 +50,7 @@
29 #delete_callback is the function called on deletion
30 #close_callback is the function called on close
31 #opentask_callback is the function to open a new editor
32- #tasktitle_callbakc is called when title change
33+ #tasktitle_callback is called when title changes
34 #notes is experimental (bool)
35 #taskconfig is a ConfigObj dic to save infos about tasks
36 #thisisnew is True when a new task is created and opened
37@@ -69,10 +69,10 @@
38 self.dismissbutton = self.builder.get_object("dismiss_editor")
39 self.deletebutton = self.builder.get_object("delete_editor")
40 self.deletebutton.set_tooltip_text(GnomeConfig.DELETE_TOOLTIP)
41- self.deletebutton = self.builder.get_object("insert_subtask")
42- self.deletebutton.set_tooltip_text(GnomeConfig.SUBTASK_TOOLTIP)
43- self.deletebutton = self.builder.get_object("inserttag")
44- self.deletebutton.set_tooltip_text(GnomeConfig.TAG_TOOLTIP)
45+ self.subtask_button = self.builder.get_object("insert_subtask")
46+ self.subtask_button.set_tooltip_text(GnomeConfig.SUBTASK_TOOLTIP)
47+ self.inserttag_button = self.builder.get_object("inserttag")
48+ self.inserttag_button.set_tooltip_text(GnomeConfig.TAG_TOOLTIP)
49 #Create our dictionary and connect it
50 dic = {
51 "mark_as_done_clicked" : self.change_status,
52@@ -122,7 +122,6 @@
53 self.duedate_widget = self.builder.get_object("duedate_entry")
54 self.startdate_widget = self.builder.get_object("startdate_entry")
55 self.dayleft_label = self.builder.get_object("dayleft")
56- self.inserttag_button = self.builder.get_object("inserttag")
57 self.tasksidebar = self.builder.get_object("tasksidebar")
58 self.keepnote_button = self.builder.get_object("keepnote")
59 if not notes :
60@@ -249,11 +248,11 @@
61 dismiss_editor.add_accelerator('clicked', agr, key, mod, gtk.ACCEL_VISIBLE)
62
63
64- #Can be called at any time to reflect the status of the Task
65- #Refresh should never interfer with the TaskView
66+ #Can be called at any time to reflect the status of the Task.
67+ #Refresh should never interfere with the TaskView.
68 #If a title is passed as a parameter, it will become
69- #The new window title. If not, we will look for the task title
70- #Refreshtext is wheter or not we should refresh the TaskView
71+ #the new window title. If not, we will look for the task title.
72+ #Refreshtext is whether or not we should refresh the TaskView
73 #(doing it all the time is dangerous if the task is empty)
74 def refresh_editor(self, title=None, refreshtext=False):
75 to_save = False
76@@ -399,7 +398,7 @@
77 self.calendar.grab_add()
78 #We grab the pointer in the calendar
79 gdk.pointer_grab(self.calendar.window, True,gdk.BUTTON1_MASK|gdk.MOD2_MASK)
80- #we will close the calendar if the user clic outside
81+ #we will close the calendar if the user clicks outside
82
83 if not isinstance(toset, dates.FuzzyDate):
84 if not toset:
85@@ -598,7 +597,7 @@
86
87
88 def __focus_out(self,w=None,e=None) : #pylint: disable-msg=W0613
89- #We should only close if the pointer clic is out of the calendar !
90+ #We should only close if the pointer click is out of the calendar !
91 p = self.calendar.window.get_pointer()
92 s = self.calendar.get_size()
93 if not(0 <= p[0] <= s[0] and 0 <= p[1] <= s[1]) :
94
95=== modified file 'GTG/taskeditor/taskview.py'
96--- GTG/taskeditor/taskview.py 2010-01-10 11:45:45 +0000
97+++ GTG/taskeditor/taskview.py 2010-02-11 01:59:13 +0000
98@@ -20,9 +20,9 @@
99
100 #This is a class taken originally from
101 #http://trac.atzm.org/index.cgi/wiki/PyGTK
102-#It was in Japanese and I didn't understood anything but the code.
103+#It was in Japanese and I didn't understand anything but the code.
104
105-#This class implement a gtk.TextView but with many other features
106+#This class implements a gtk.TextView but with many other features
107 #like hyperlink and others stuffs special for GTG
108 #
109 #For your information, a gtkTextView always contains a gtk.TextBuffer which
110@@ -538,7 +538,6 @@
111 #Detect URL in the tasks
112 #It's ugly...
113 def _detect_url(self,buff,start,end) :
114- #firtst, we remove the old tags :
115 #subt_list = self.get_subtasks()
116 #First, we remove the olds tags
117 tag_list = []
118@@ -587,7 +586,7 @@
119
120
121
122- #Detect tags in buff in the regio between start iter and end iter
123+ #Detect tags in buff in the region between start iter and end iter
124 def _detect_tag(self,buff,start,end) :
125 # Removing already existing tag in the current selection
126 # out of the tag table
127@@ -596,7 +595,7 @@
128 old_tags = []
129 new_tags = []
130 #We must be strictly < than the end_offset. If not, we might
131- #found the beginning of a tag on the nextline
132+ #find the beginning of a tag on the nextline
133 while (it.get_offset() < end.get_offset()) and (it.get_char() != '\0'):
134 if it.begins_tag() :
135 tags = it.get_toggled_tags(True)
136@@ -687,7 +686,7 @@
137 to_return = True
138 return to_return
139
140- #When the user remove a selection, we remove subtasks and @tags
141+ #When the user removes a selection, we remove subtasks and @tags
142 #from this selection
143 def _delete_range(self,buff,start,end) :
144 # #If we are at the beginning of a mark, put this mark at the end
145@@ -914,7 +913,7 @@
146 itera = buff.get_iter_at_mark(temp_mark)
147 buff.move_mark_by_name("/%s"%subtid,itera)
148 buff.delete_mark(temp_mark)
149- #The mark has right gravity but because we putted it on the left
150+ #The mark has right gravity but because we put it on the left
151 #of the newly inserted \n, it will not move anymore.
152
153 itera = buff.get_iter_at_mark(end)
154@@ -1017,7 +1016,7 @@
155 #we keep the normal pasting by not interupting the signal
156 self.clipboard.clear()
157
158- #Function called each time the user input a letter
159+ #Function called each time the user inputs a letter
160 def _insert_at_cursor(self, tv, itera, tex, leng) :
161 #We don't paste the bullet
162 if tex.strip() != self.bullet1 :
163@@ -1214,7 +1213,7 @@
164 self.buff.disconnect(self.insert_sigid)
165 insert_mark = self.buff.get_insert()
166 insert_iter = self.buff.get_iter_at_mark(insert_mark)
167- #All that craps to find if we are at the end of an indent tag
168+ #All this crap to find if we are at the end of an indent tag
169 if insert_iter.ends_tag() :
170 for t in insert_iter.get_toggled_tags(False) :
171 if t.get_data('is_indent') :
172@@ -1226,7 +1225,7 @@
173 self.insert_sigid = self.buff.connect('insert-text', \
174 self._insert_at_cursor)
175
176- #The mouse is moving. We must change it to a hand when hovering a link
177+ #The mouse is moving. We must change it to a hand when hovering over a link
178 def _motion(self, view, ev):
179 window = ev.window
180 x, y, _ = window.get_pointer()
181
182=== modified file 'GTG/taskeditor/taskviewserial.py'
183--- GTG/taskeditor/taskviewserial.py 2010-01-07 16:30:30 +0000
184+++ GTG/taskeditor/taskviewserial.py 2010-02-11 01:59:13 +0000
185@@ -72,7 +72,7 @@
186 while not buffer_end:
187 if tag is None:
188 # We are not in a tag context
189- # Get list of know tags witch begin here
190+ # Get list of know tags which begin here
191 # and are not already process
192 tags = []
193 for ta in it.get_tags():
194@@ -135,7 +135,7 @@
195 if last_val and last_val.nodeType == 3 and \
196 last_val.nodeValue[-1] != '\n':
197 parent.appendChild(doc.createTextNode('\n'))
198- #This function concatenate all the adjacent text node of the XML
199+ #This function concatenates all the adjacent text node of the XML
200 parent.normalize()
201 return parent
202
203@@ -163,7 +163,7 @@
204
205 #Insert a list of subtasks at the end of the buffer
206 def insert_subtasks(self, buff, st_list):
207- #It the lastline of the buffer is not empty, we add an extra \n
208+ #If the lastline of the buffer is not empty, we add an extra \n
209 end_end = buff.get_end_iter()
210 end_line = end_end.get_line()
211 start_end = buff.get_iter_at_line(end_line)

Subscribers

People subscribed via source and target branches

to status/vote changes: