Merge lp:~sinzui/ubuntu/quantal/gedit-developer-plugins/0.5.15 into lp:ubuntu/quantal/gedit-developer-plugins

Proposed by Curtis Hovey
Status: Merged
Merged at revision: 14
Proposed branch: lp:~sinzui/ubuntu/quantal/gedit-developer-plugins/0.5.15
Merge into: lp:ubuntu/quantal/gedit-developer-plugins
Diff against target: 864 lines (+339/-225)
11 files modified
ChangeLog (+39/-0)
configure (+10/-10)
configure.ac (+1/-1)
debian/changelog (+6/-0)
plugins/gdp/__init__.py (+7/-1)
plugins/gdp/find.py (+35/-1)
plugins/gdp/find.ui (+76/-209)
plugins/gdp/tests/test_find.py (+100/-1)
plugins/gdp/tests/test_gdp.py (+62/-0)
testing/__init__.py (+2/-2)
testing/testrunner.py (+1/-0)
To merge this branch: bzr merge lp:~sinzui/ubuntu/quantal/gedit-developer-plugins/0.5.15
Reviewer Review Type Date Requested Status
Martin Pitt Approve
Review via email: mp+110820@code.launchpad.net

Description of the change

Update the package to the current release of 0.5.15. The release Fixes a few bugs in the the find panel and introduces a new UI for the find panel.

To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

Thanks! Merged with fixing LP: # syntax in debian/changelog.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ChangeLog'
--- ChangeLog 2012-03-30 14:24:59 +0000
+++ ChangeLog 2012-06-18 13:32:54 +0000
@@ -1,5 +1,44 @@
1<Generated by bzr log --log-format=gnu>1<Generated by bzr log --log-format=gnu>
22
32012-06-16 Curtis Hovey <sinzui.is@verizon.net>
4
5 [579] Increment version.
6
72012-04-28 Curtis Hovey <sinzui.is@verizon.net>
8
9 [578] Show relative path in find results.
10
112012-04-28 Curtis Hovey <sinzui.is@verizon.net>
12
13 [577] Do not mutate gsettings.
14
152012-04-28 Curtis Hovey <sinzui.is@verizon.net>
16
17 [576] Use the FileChooserDialog to set the directory to find in.
18
192012-04-28 Curtis Hovey <sinzui.is@verizon.net>
20
21 [575] Extend object.
22
232012-04-28 Curtis Hovey <sinzui.is@verizon.net>
24
25 [574] Warn when the directory path does not exist. Convert the path
26 from a uri to a directory path.
27
282012-04-28 Curtis Hovey <sinzui.is@verizon.net>
29
30 [573] Added on_replace_in_files_icon_press for substituion entry.
31
322012-04-28 Curtis Hovey <sinzui.is@verizon.net>
33
34 [572] Introduce on_find_in_files_icon_press to handle the icon-press
35 event from the entry.
36
372012-04-10 Curtis Hovey <sinzui.is@verizon.net>
38
39 [571] Quick glade hack to make the panel use less space by using
40 secondary icons instead buttons.
41
32012-03-29 Curtis Hovey <sinzui.is@verizon.net>422012-03-29 Curtis Hovey <sinzui.is@verizon.net>
443
5 [570] Do not look for missing in a branch without a parent.44 [570] Do not look for missing in a branch without a parent.
645
=== modified file 'configure'
--- configure 2012-03-30 14:24:59 +0000
+++ configure 2012-06-18 13:32:54 +0000
@@ -1,6 +1,6 @@
1#! /bin/sh1#! /bin/sh
2# Guess values for system-dependent variables and create Makefiles.2# Guess values for system-dependent variables and create Makefiles.
3# Generated by GNU Autoconf 2.68 for gedit-developer-plugins 0.5.14.3# Generated by GNU Autoconf 2.68 for gedit-developer-plugins 0.5.15.
4#4#
5# Report bugs to <sinzui.is@verizon.net>.5# Report bugs to <sinzui.is@verizon.net>.
6#6#
@@ -560,8 +560,8 @@
560# Identity of this package.560# Identity of this package.
561PACKAGE_NAME='gedit-developer-plugins'561PACKAGE_NAME='gedit-developer-plugins'
562PACKAGE_TARNAME='gedit-developer-plugins'562PACKAGE_TARNAME='gedit-developer-plugins'
563PACKAGE_VERSION='0.5.14'563PACKAGE_VERSION='0.5.15'
564PACKAGE_STRING='gedit-developer-plugins 0.5.14'564PACKAGE_STRING='gedit-developer-plugins 0.5.15'
565PACKAGE_BUGREPORT='sinzui.is@verizon.net'565PACKAGE_BUGREPORT='sinzui.is@verizon.net'
566PACKAGE_URL=''566PACKAGE_URL=''
567567
@@ -1319,7 +1319,7 @@
1319 # Omit some internal or obsolete options to make the list less imposing.1319 # Omit some internal or obsolete options to make the list less imposing.
1320 # This message is too long to be a string in the A/UX 3.1 sh.1320 # This message is too long to be a string in the A/UX 3.1 sh.
1321 cat <<_ACEOF1321 cat <<_ACEOF
1322\`configure' configures gedit-developer-plugins 0.5.14 to adapt to many kinds of systems.1322\`configure' configures gedit-developer-plugins 0.5.15 to adapt to many kinds of systems.
13231323
1324Usage: $0 [OPTION]... [VAR=VALUE]...1324Usage: $0 [OPTION]... [VAR=VALUE]...
13251325
@@ -1386,7 +1386,7 @@
13861386
1387if test -n "$ac_init_help"; then1387if test -n "$ac_init_help"; then
1388 case $ac_init_help in1388 case $ac_init_help in
1389 short | recursive ) echo "Configuration of gedit-developer-plugins 0.5.14:";;1389 short | recursive ) echo "Configuration of gedit-developer-plugins 0.5.15:";;
1390 esac1390 esac
1391 cat <<\_ACEOF1391 cat <<\_ACEOF
13921392
@@ -1491,7 +1491,7 @@
1491test -n "$ac_init_help" && exit $ac_status1491test -n "$ac_init_help" && exit $ac_status
1492if $ac_init_version; then1492if $ac_init_version; then
1493 cat <<\_ACEOF1493 cat <<\_ACEOF
1494gedit-developer-plugins configure 0.5.141494gedit-developer-plugins configure 0.5.15
1495generated by GNU Autoconf 2.681495generated by GNU Autoconf 2.68
14961496
1497Copyright (C) 2010 Free Software Foundation, Inc.1497Copyright (C) 2010 Free Software Foundation, Inc.
@@ -1860,7 +1860,7 @@
1860This file contains any messages produced by compilers while1860This file contains any messages produced by compilers while
1861running configure, to aid debugging if configure makes a mistake.1861running configure, to aid debugging if configure makes a mistake.
18621862
1863It was created by gedit-developer-plugins $as_me 0.5.14, which was1863It was created by gedit-developer-plugins $as_me 0.5.15, which was
1864generated by GNU Autoconf 2.68. Invocation command line was1864generated by GNU Autoconf 2.68. Invocation command line was
18651865
1866 $ $0 $@1866 $ $0 $@
@@ -2675,7 +2675,7 @@
26752675
2676# Define the identity of the package.2676# Define the identity of the package.
2677 PACKAGE='gedit-developer-plugins'2677 PACKAGE='gedit-developer-plugins'
2678 VERSION='0.5.14'2678 VERSION='0.5.15'
26792679
26802680
2681cat >>confdefs.h <<_ACEOF2681cat >>confdefs.h <<_ACEOF
@@ -6525,7 +6525,7 @@
6525# report actual input values of CONFIG_FILES etc. instead of their6525# report actual input values of CONFIG_FILES etc. instead of their
6526# values after options handling.6526# values after options handling.
6527ac_log="6527ac_log="
6528This file was extended by gedit-developer-plugins $as_me 0.5.14, which was6528This file was extended by gedit-developer-plugins $as_me 0.5.15, which was
6529generated by GNU Autoconf 2.68. Invocation command line was6529generated by GNU Autoconf 2.68. Invocation command line was
65306530
6531 CONFIG_FILES = $CONFIG_FILES6531 CONFIG_FILES = $CONFIG_FILES
@@ -6582,7 +6582,7 @@
6582cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=16582cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
6583ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"6583ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
6584ac_cs_version="\\6584ac_cs_version="\\
6585gedit-developer-plugins config.status 0.5.146585gedit-developer-plugins config.status 0.5.15
6586configured by $0, generated by GNU Autoconf 2.68,6586configured by $0, generated by GNU Autoconf 2.68,
6587 with options \\"\$ac_cs_config\\"6587 with options \\"\$ac_cs_config\\"
65886588
65896589
=== modified file 'configure.ac'
--- configure.ac 2012-03-30 14:24:59 +0000
+++ configure.ac 2012-06-18 13:32:54 +0000
@@ -4,7 +4,7 @@
44
5m4_define(gdp_major_version, 0)5m4_define(gdp_major_version, 0)
6m4_define(gdp_minor_version, 5)6m4_define(gdp_minor_version, 5)
7m4_define(gdp_micro_version, 14)7m4_define(gdp_micro_version, 15)
8m4_define(gdp_version, gdp_major_version.gdp_minor_version.gdp_micro_version)8m4_define(gdp_version, gdp_major_version.gdp_minor_version.gdp_micro_version)
99
10AC_INIT(gedit-developer-plugins, gdp_version, sinzui.is@verizon.net)10AC_INIT(gedit-developer-plugins, gdp_version, sinzui.is@verizon.net)
1111
=== modified file 'debian/changelog'
--- debian/changelog 2012-03-30 14:30:40 +0000
+++ debian/changelog 2012-06-18 13:32:54 +0000
@@ -1,3 +1,9 @@
1gedit-developer-plugins (0.5.15-0ubuntu1) quantal; urgency=low
2
3 * New upstream release. Fixes LP:#990561, LP:#990585, LP:#990688
4
5 -- Curtis C. Hovey <sinzui.is@verizon.net> Mon, 18 Jun 2012 09:25:07 -0400
6
1gedit-developer-plugins (0.5.14-0ubuntu1) precise; urgency=low7gedit-developer-plugins (0.5.14-0ubuntu1) precise; urgency=low
28
3 * New upstream bug-fix release.9 * New upstream bug-fix release.
410
=== modified file 'plugins/gdp/__init__.py'
--- plugins/gdp/__init__.py 2012-03-12 13:04:13 +0000
+++ plugins/gdp/__init__.py 2012-06-18 13:32:54 +0000
@@ -147,7 +147,13 @@
147 text = model.get_value(piter, 3)147 text = model.get_value(piter, 3)
148 if text is None:148 if text is None:
149 if cell_type == 'text':149 if cell_type == 'text':
150 cell.props.text = file_path150 relative_file_path = file_path
151 base_dir = model.get_value(piter, 4)
152 if base_dir:
153 if base_dir[-1] != '/':
154 base_dir = '%s/' % base_dir
155 relative_file_path = file_path.replace(base_dir, './')
156 cell.props.text = relative_file_path
151 else:157 else:
152 # cell_type == 'line_no'158 # cell_type == 'line_no'
153 cell.props.text = ''159 cell.props.text = ''
154160
=== modified file 'plugins/gdp/find.py'
--- plugins/gdp/find.py 2012-03-12 13:04:13 +0000
+++ plugins/gdp/find.py 2012-06-18 13:32:54 +0000
@@ -247,8 +247,13 @@
247 def ui_callbacks(self):247 def ui_callbacks(self):
248 """The dict of callbacks for the ui widgets."""248 """The dict of callbacks for the ui widgets."""
249 return {249 return {
250 'on_choose_directory_icon_press':
251 self.on_choose_directory_icon_press,
250 'on_find_in_files': self.on_find_in_files,252 'on_find_in_files': self.on_find_in_files,
253 'on_find_in_files_icon_press': self.on_find_in_files_icon_press,
251 'on_replace_in_files': self.on_replace_in_files,254 'on_replace_in_files': self.on_replace_in_files,
255 'on_replace_in_files_icon_press':
256 self.on_replace_in_files_icon_press,
252 'on_save_results': self.on_save_results,257 'on_save_results': self.on_save_results,
253 }258 }
254259
@@ -272,7 +277,8 @@
272 path_ = '.'277 path_ = '.'
273 elif path_ == self.CURRENT_FILE:278 elif path_ == self.CURRENT_FILE:
274 document = self.active_document279 document = self.active_document
275 path_ = os.path.dirname(document.get_uri_for_display())280 path_ = document.get_uri_for_display().replace('file://', '')
281 path_ = os.path.dirname(path_)
276 return path_282 return path_
277283
278 @property284 @property
@@ -323,11 +329,31 @@
323 self.widgets.get_object('match_case_checkbox').get_active(),329 self.widgets.get_object('match_case_checkbox').get_active(),
324 self.file_pattern)330 self.file_pattern)
325331
332 def on_choose_directory_icon_press(self, widget, position, event):
333 """Choose a directory using a dialog."""
334 dialog = Gtk.FileChooserDialog(
335 title="Choose a directory to find in", parent=self.window,
336 action=Gtk.FileChooserAction.SELECT_FOLDER,
337 buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
338 Gtk.STOCK_OPEN, Gtk.ResponseType.ACCEPT))
339 dialog.set_current_folder(os.getcwd())
340 if dialog.run() == Gtk.ResponseType.ACCEPT:
341 path = dialog.get_filename()
342 if path:
343 self.path_comboentry.get_child().set_text(path)
344 dialog.destroy()
345
326 def on_find_in_files(self, widget=None, substitution=None):346 def on_find_in_files(self, widget=None, substitution=None):
327 """Find and present the matches."""347 """Find and present the matches."""
328 treestore = self.file_lines_view.get_model()348 treestore = self.file_lines_view.get_model()
329 treestore.clear()349 treestore.clear()
330 find_params = self.get_find_params()350 find_params = self.get_find_params()
351 if (find_params.path != self.CURRENT_FILE
352 and not os.path.exists(find_params.path)):
353 message = 'The directory path does not exist!'
354 self.file_lines_view.get_model().append(
355 None, (message, 'stock_dialog-info', 0, None, None))
356 return
331 self.last_find = find_params357 self.last_find = find_params
332 pattern = find_params.pattern358 pattern = find_params.pattern
333 self.save_find_data()359 self.save_find_data()
@@ -339,6 +365,10 @@
339 # of this method.365 # of this method.
340 GObject.idle_add(find_worker.start)366 GObject.idle_add(find_worker.start)
341367
368 def on_find_in_files_icon_press(self, widget, position, event):
369 """Handle find pattern entry icon-press event."""
370 self.on_find_in_files()
371
342 def on_find_complete(self):372 def on_find_complete(self):
343 if self.path_comboentry.get_active_text() == self.CURRENT_FILE:373 if self.path_comboentry.get_active_text() == self.CURRENT_FILE:
344 self.file_lines_view.expand_all()374 self.file_lines_view.expand_all()
@@ -394,6 +424,10 @@
394 elif response == Gtk.ResponseType.ACCEPT:424 elif response == Gtk.ResponseType.ACCEPT:
395 self.on_find_in_files(substitution=substitution)425 self.on_find_in_files(substitution=substitution)
396426
427 def on_replace_in_files_icon_press(self, widget, position, event):
428 """Handle replace pattern entry icon-press event."""
429 self.on_replace_in_files()
430
397 def on_save_results(self, widget=None):431 def on_save_results(self, widget=None):
398 """Save the search results to a file."""432 """Save the search results to a file."""
399 dialog = Gtk.FileChooserDialog(433 dialog = Gtk.FileChooserDialog(
400434
=== modified file 'plugins/gdp/find.ui'
--- plugins/gdp/find.ui 2012-03-12 13:04:13 +0000
+++ plugins/gdp/find.ui 2012-06-18 13:32:54 +0000
@@ -13,128 +13,24 @@
13 <property name="orientation">vertical</property>13 <property name="orientation">vertical</property>
14 <property name="spacing">2</property>14 <property name="spacing">2</property>
15 <child>15 <child>
16 <object class="GtkGrid" id="find_controls">16 <object class="GtkComboBoxText" id="path_comboentry">
17 <property name="visible">True</property>17 <property name="visible">True</property>
18 <property name="can_focus">False</property>18 <property name="can_focus">False</property>
19 <property name="row_spacing">6</property>19 <property name="has_tooltip">True</property>
20 <property name="column_spacing">6</property>20 <property name="tooltip_markup" translatable="yes">The directory to start searching in.</property>
21 <child>21 <property name="tooltip_text" translatable="yes">The directory to start searching in.</property>
22 <object class="GtkLabel" id="path_label">22 <property name="hexpand">True</property>
23 <property name="visible">True</property>23 <property name="has_entry">True</property>
24 <property name="can_focus">False</property>24 <child internal-child="entry">
25 <property name="xalign">0</property>25 <object class="GtkEntry" id="comboboxtext-entry4">
26 <property name="ypad">5</property>26 <property name="can_focus">True</property>
27 <property name="label" translatable="yes">Look in: </property>27 <property name="invisible_char">•</property>
28 </object>28 <property name="primary_icon_stock">gtk-directory</property>
29 <packing>29 <property name="secondary_icon_activatable">False</property>
30 <property name="left_attach">0</property>30 <property name="secondary_icon_sensitive">False</property>
31 <property name="top_attach">0</property>31 <signal name="activate" handler="on_find_in_files" swapped="no"/>
32 <property name="width">1</property>32 <signal name="icon-press" handler="on_choose_directory_icon_press" swapped="no"/>
33 <property name="height">1</property>33 </object>
34 </packing>
35 </child>
36 <child>
37 <object class="GtkLabel" id="match_label">
38 <property name="visible">True</property>
39 <property name="can_focus">False</property>
40 <property name="label" translatable="yes">Search for:</property>
41 </object>
42 <packing>
43 <property name="left_attach">0</property>
44 <property name="top_attach">1</property>
45 <property name="width">1</property>
46 <property name="height">1</property>
47 </packing>
48 </child>
49 <child>
50 <object class="GtkBox" id="hbox1">
51 <property name="visible">True</property>
52 <property name="can_focus">False</property>
53 <property name="spacing">6</property>
54 <child>
55 <object class="GtkComboBoxText" id="pattern_comboentry">
56 <property name="visible">True</property>
57 <property name="can_focus">False</property>
58 <property name="has_tooltip">True</property>
59 <property name="tooltip_markup" translatable="yes">The plain text or Python regular expression to find in files.</property>
60 <property name="tooltip_text" translatable="yes">The plain text or Python regular expression to find in files.</property>
61 <property name="has_entry">True</property>
62 <child internal-child="entry">
63 <object class="GtkEntry" id="comboboxtext-entry3">
64 <property name="can_focus">True</property>
65 <property name="invisible_char">•</property>
66 <signal name="activate" handler="on_find_in_files" swapped="no"/>
67 </object>
68 </child>
69 </object>
70 <packing>
71 <property name="expand">True</property>
72 <property name="fill">True</property>
73 <property name="position">0</property>
74 </packing>
75 </child>
76 <child>
77 <object class="GtkButton" id="find_in_files_button">
78 <property name="label" translatable="yes"> Find </property>
79 <property name="use_action_appearance">False</property>
80 <property name="visible">True</property>
81 <property name="can_focus">True</property>
82 <property name="receives_default">True</property>
83 <property name="use_action_appearance">False</property>
84 <signal name="clicked" handler="on_find_in_files" swapped="no"/>
85 </object>
86 <packing>
87 <property name="expand">False</property>
88 <property name="fill">True</property>
89 <property name="position">1</property>
90 </packing>
91 </child>
92 </object>
93 <packing>
94 <property name="left_attach">1</property>
95 <property name="top_attach">1</property>
96 <property name="width">1</property>
97 <property name="height">1</property>
98 </packing>
99 </child>
100 <child>
101 <object class="GtkComboBoxText" id="path_comboentry">
102 <property name="visible">True</property>
103 <property name="can_focus">False</property>
104 <property name="has_tooltip">True</property>
105 <property name="tooltip_markup" translatable="yes">The directory to start searching in.</property>
106 <property name="tooltip_text" translatable="yes">The directory to start searching in.</property>
107 <property name="hexpand">True</property>
108 <property name="has_entry">True</property>
109 <child internal-child="entry">
110 <object class="GtkEntry" id="comboboxtext-entry4">
111 <property name="can_focus">True</property>
112 <property name="invisible_char">•</property>
113 <signal name="activate" handler="on_find_in_files" swapped="no"/>
114 </object>
115 </child>
116 </object>
117 <packing>
118 <property name="left_attach">1</property>
119 <property name="top_attach">0</property>
120 <property name="width">1</property>
121 <property name="height">1</property>
122 </packing>
123 </child>
124 <child>
125 <placeholder/>
126 </child>
127 <child>
128 <placeholder/>
129 </child>
130 <child>
131 <placeholder/>
132 </child>
133 <child>
134 <placeholder/>
135 </child>
136 <child>
137 <placeholder/>
138 </child>34 </child>
139 </object>35 </object>
140 <packing>36 <packing>
@@ -144,6 +40,35 @@
144 </packing>40 </packing>
145 </child>41 </child>
146 <child>42 <child>
43 <object class="GtkComboBoxText" id="pattern_comboentry">
44 <property name="visible">True</property>
45 <property name="can_focus">False</property>
46 <property name="has_tooltip">True</property>
47 <property name="tooltip_markup" translatable="yes">The plain text or Python regular expression to find in files.</property>
48 <property name="tooltip_text" translatable="yes">The plain text or Python regular expression to find in files.</property>
49 <property name="has_entry">True</property>
50 <property name="entry_text_column">0</property>
51 <property name="id_column">1</property>
52 <child internal-child="entry">
53 <object class="GtkEntry" id="comboboxtext-entry">
54 <property name="can_focus">True</property>
55 <property name="invisible_char">•</property>
56 <property name="primary_icon_stock">gtk-find</property>
57 <property name="secondary_icon_stock">gtk-refresh</property>
58 <property name="primary_icon_activatable">False</property>
59 <property name="placeholder_text">Matching text</property>
60 <signal name="activate" handler="on_find_in_files" swapped="no"/>
61 <signal name="icon-press" handler="on_find_in_files_icon_press" swapped="no"/>
62 </object>
63 </child>
64 </object>
65 <packing>
66 <property name="expand">False</property>
67 <property name="fill">True</property>
68 <property name="position">1</property>
69 </packing>
70 </child>
71 <child>
147 <object class="GtkExpander" id="options">72 <object class="GtkExpander" id="options">
148 <property name="visible">True</property>73 <property name="visible">True</property>
149 <property name="can_focus">True</property>74 <property name="can_focus">True</property>
@@ -193,42 +118,22 @@
193 </packing>118 </packing>
194 </child>119 </child>
195 <child>120 <child>
196 <object class="GtkBox" id="hbox4">121 <object class="GtkComboBoxText" id="file_comboentry">
197 <property name="visible">True</property>122 <property name="visible">True</property>
198 <property name="can_focus">False</property>123 <property name="can_focus">False</property>
199 <property name="spacing">6</property>124 <property name="has_entry">True</property>
200 <child>125 <child internal-child="entry">
201 <object class="GtkLabel" id="file_name_label">126 <object class="GtkEntry" id="comboboxtext-entry25">
202 <property name="visible">True</property>127 <property name="can_focus">True</property>
203 <property name="can_focus">False</property>128 <property name="tooltip_text" translatable="yes">A regular expression pattern used to match the directory or file name.
204 <property name="label" translatable="yes">File name pattern:</property>
205 </object>
206 <packing>
207 <property name="expand">False</property>
208 <property name="fill">True</property>
209 <property name="position">0</property>
210 </packing>
211 </child>
212 <child>
213 <object class="GtkComboBoxText" id="file_comboentry">
214 <property name="visible">True</property>
215 <property name="can_focus">False</property>
216 <property name="has_entry">True</property>
217 <child internal-child="entry">
218 <object class="GtkEntry" id="comboboxtext-entry25">
219 <property name="can_focus">True</property>
220 <property name="tooltip_text" translatable="yes">A regular expression pattern used to match the directory or file name.
221eg. py or tests/ or \.(py|html)$</property>129eg. py or tests/ or \.(py|html)$</property>
222 <property name="invisible_char">•</property>130 <property name="invisible_char">•</property>
223 <signal name="activate" handler="on_find_in_files" swapped="no"/>131 <property name="primary_icon_stock">gtk-file</property>
224 </object>132 <property name="secondary_icon_activatable">False</property>
225 </child>133 <property name="secondary_icon_sensitive">False</property>
134 <property name="placeholder_text">File name pattern</property>
135 <signal name="activate" handler="on_find_in_files" swapped="no"/>
226 </object>136 </object>
227 <packing>
228 <property name="expand">True</property>
229 <property name="fill">True</property>
230 <property name="position">1</property>
231 </packing>
232 </child>137 </child>
233 </object>138 </object>
234 <packing>139 <packing>
@@ -250,7 +155,7 @@
250 <packing>155 <packing>
251 <property name="expand">False</property>156 <property name="expand">False</property>
252 <property name="fill">True</property>157 <property name="fill">True</property>
253 <property name="position">1</property>158 <property name="position">2</property>
254 </packing>159 </packing>
255 </child>160 </child>
256 <child>161 <child>
@@ -274,7 +179,7 @@
274 <packing>179 <packing>
275 <property name="expand">True</property>180 <property name="expand">True</property>
276 <property name="fill">True</property>181 <property name="fill">True</property>
277 <property name="position">2</property>182 <property name="position">3</property>
278 </packing>183 </packing>
279 </child>184 </child>
280 <child>185 <child>
@@ -288,64 +193,26 @@
288 <property name="orientation">vertical</property>193 <property name="orientation">vertical</property>
289 <property name="spacing">6</property>194 <property name="spacing">6</property>
290 <child>195 <child>
291 <object class="GtkBox" id="hbox5">196 <object class="GtkComboBoxText" id="substitution_comboentry">
292 <property name="visible">True</property>197 <property name="visible">True</property>
293 <property name="can_focus">False</property>198 <property name="can_focus">False</property>
294 <property name="spacing">6</property>199 <property name="has_tooltip">True</property>
295 <child>200 <property name="tooltip_markup" translatable="yes">The text to replace each found match with.
296 <object class="GtkLabel" id="label2">201The replacement may use backslash escapes to access groups in match expression</property>
297 <property name="visible">True</property>202 <property name="tooltip_text" translatable="yes">The text to replace each found match with.
298 <property name="can_focus">False</property>203The replacement may use backslash escapes to access groups in match expression</property>
299 <property name="label" translatable="yes">Replace with:</property>204 <property name="has_entry">True</property>
300 </object>205 <child internal-child="entry">
301 <packing>206 <object class="GtkEntry" id="comboboxtext-entry23">
302 <property name="expand">False</property>
303 <property name="fill">False</property>
304 <property name="position">0</property>
305 </packing>
306 </child>
307 <child>
308 <object class="GtkComboBoxText" id="substitution_comboentry">
309 <property name="visible">True</property>
310 <property name="can_focus">False</property>
311 <property name="has_tooltip">True</property>
312 <property name="tooltip_markup" translatable="yes">The text to replace each found match with.
313The replacement may use backslash escapes to access groups in match expression</property>
314 <property name="tooltip_text" translatable="yes">The text to replace each found match with.
315The replacement may use backslash escapes to access groups in match expression</property>
316 <property name="has_entry">True</property>
317 <child internal-child="entry">
318 <object class="GtkEntry" id="comboboxtext-entry23">
319 <property name="can_focus">True</property>
320 <property name="invisible_char">•</property>
321 </object>
322 </child>
323 </object>
324 <packing>
325 <property name="expand">True</property>
326 <property name="fill">True</property>
327 <property name="position">1</property>
328 </packing>
329 </child>
330 <child>
331 <object class="GtkButton" id="replace_in_files_button">
332 <property name="label" translatable="yes">Replace</property>
333 <property name="use_action_appearance">False</property>
334 <property name="visible">True</property>
335 <property name="can_focus">True</property>207 <property name="can_focus">True</property>
336 <property name="receives_default">True</property>208 <property name="invisible_char">•</property>
337 <property name="has_tooltip">True</property>209 <property name="primary_icon_stock">gtk-find-and-replace</property>
338 <property name="tooltip_markup" translatable="yes">Replace the matched text.</property>210 <property name="secondary_icon_stock">gtk-refresh</property>
339 <property name="tooltip_text" translatable="yes">Replace the matched text.</property>211 <property name="primary_icon_activatable">False</property>
340 <property name="use_action_appearance">False</property>212 <property name="placeholder_text">Replacement text</property>
341 <signal name="clicked" handler="on_replace_in_files" swapped="no"/>213 <signal name="activate" handler="on_replace_in_files" swapped="no"/>
214 <signal name="icon-press" handler="on_replace_in_files_icon_press" swapped="no"/>
342 </object>215 </object>
343 <packing>
344 <property name="expand">False</property>
345 <property name="fill">False</property>
346 <property name="pack_type">end</property>
347 <property name="position">2</property>
348 </packing>
349 </child>216 </child>
350 </object>217 </object>
351 <packing>218 <packing>
@@ -400,7 +267,7 @@
400 <property name="expand">False</property>267 <property name="expand">False</property>
401 <property name="fill">True</property>268 <property name="fill">True</property>
402 <property name="padding">6</property>269 <property name="padding">6</property>
403 <property name="position">3</property>270 <property name="position">4</property>
404 </packing>271 </packing>
405 </child>272 </child>
406 </object>273 </object>
407274
=== modified file 'plugins/gdp/tests/test_find.py'
--- plugins/gdp/tests/test_find.py 2012-03-12 13:04:13 +0000
+++ plugins/gdp/tests/test_find.py 2012-06-18 13:32:54 +0000
@@ -13,7 +13,10 @@
13 Finder,13 Finder,
14 FinderWorker,14 FinderWorker,
15 )15 )
16from testing import GeditTestCase16from testing import (
17 GeditTestCase,
18 MockMethod,
19 )
1720
1821
19class TestCallback:22class TestCallback:
@@ -182,6 +185,39 @@
182 self.assertEqual(['one', 'three', 'two'], words)185 self.assertEqual(['one', 'three', 'two'], words)
183 self.assertEqual('two', comboentry.get_active_text())186 self.assertEqual('two', comboentry.get_active_text())
184187
188 def test_path(self):
189 self.make_config(find, Config)
190 window, view, document = self.make_gedit(
191 'plugins/gdp/data/snark12.txt')
192 finder = Finder(window)
193 finder.update_comboentry(
194 finder.path_comboentry, '/fnord/pting', True)
195 self.assertEqual('/fnord/pting', finder.path)
196 finder.update_comboentry(
197 finder.path_comboentry, '<Working Directory>', True)
198 self.assertEqual('.', finder.path)
199 finder.update_comboentry(
200 finder.path_comboentry, '<Current File>', True)
201 self.assertIs(False, finder.path.startswith('file://'))
202 self.assertIs(True, finder.path.endswith('plugins/gdp/data'))
203
204 def test_file_pattern(self):
205 self.make_config(find, Config)
206 window, view, document = self.make_gedit(
207 'plugins/gdp/data/snark12.txt')
208 finder = Finder(window)
209 finder.update_comboentry(
210 finder.file_comboentry, 'txt', True)
211 self.assertEqual('txt', finder.file_pattern)
212 finder.update_comboentry(
213 finder.file_comboentry, '<Any Text File>', True)
214 self.assertEqual('.', finder.file_pattern)
215 finder.update_comboentry(
216 finder.path_comboentry, '<Current File>', True)
217 finder.update_comboentry(
218 finder.file_comboentry, 'ignored', True)
219 self.assertEqual('snark12.txt', finder.file_pattern)
220
185 def test_save_find_data(self):221 def test_save_find_data(self):
186 # Setup a test config so that the singleton is not mutated.222 # Setup a test config so that the singleton is not mutated.
187 file_ = self.make_config(find, Config)223 file_ = self.make_config(find, Config)
@@ -210,6 +246,23 @@
210 self.assertIn('matches = eleven\n', config_data)246 self.assertIn('matches = eleven\n', config_data)
211 self.assertNotIn('\t.\n', config_data)247 self.assertNotIn('\t.\n', config_data)
212248
249 def test_on_choose_directory_icon_press(self):
250 # Setup a test config so that the singleton is not mutated.
251 self.make_config(find, Config)
252 window, view, document = self.make_gedit(
253 'plugins/gdp/data/snark12.txt')
254 finder = Finder(window)
255 expected_path = os.path.abspath('plugins/gdp/data/snark12.txt')
256 MockMethod.bind(
257 self, Gtk.FileChooserDialog, 'run', Gtk.ResponseType.ACCEPT)
258 MockMethod.bind(
259 self, Gtk.FileChooserDialog, 'get_filename', expected_path)
260 finder.on_choose_directory_icon_press(
261 finder.path_comboentry, Gtk.EntryIconPosition.SECONDARY, None)
262 self.assertIs(True, Gtk.FileChooserDialog.run.called)
263 self.assertEqual(
264 expected_path, finder.path_comboentry.get_active_text())
265
213 def test_on_find_in_files(self):266 def test_on_find_in_files(self):
214 # Setup a test config so that the singleton is not mutated.267 # Setup a test config so that the singleton is not mutated.
215 file_ = self.make_config(find, Config)268 file_ = self.make_config(find, Config)
@@ -226,6 +279,37 @@
226 finder.file_lines_view.get_column(0).props.title)279 finder.file_lines_view.get_column(0).props.title)
227 self.assertIn('matches = snark\n', file_.read())280 self.assertIn('matches = snark\n', file_.read())
228281
282 def test_on_find_in_files_icon_press(self):
283 # Setup a test config so that the singleton is not mutated.
284 self.make_config(find, Config)
285 window, view, document = self.make_gedit(
286 'plugins/gdp/data/snark12.txt')
287 finder = Finder(window)
288 finder.update_comboentry(finder.pattern_comboentry, 'snark', True)
289 finder.update_comboentry(
290 finder.path_comboentry, '<Current File>', True)
291 MockMethod.bind(self, finder, 'on_find_in_files')
292 finder.on_find_in_files_icon_press(
293 finder.pattern_comboentry, Gtk.EntryIconPosition.SECONDARY, None)
294 self.assertTrue(finder.on_find_in_files.called)
295
296 def test_on_find_in_files_nonexistant_path(self):
297 # Setup a test config so that the singleton is not mutated.
298 self.make_config(find, Config)
299 window, view, document = self.make_gedit(
300 'plugins/gdp/data/snark12.txt')
301 finder = Finder(window)
302 finder.update_comboentry(finder.pattern_comboentry, 'snark', True)
303 finder.update_comboentry(
304 finder.path_comboentry, '/fnord/pting/snarf', True)
305 MockMethod.bind(self, find, 'FinderWorker')
306 finder.on_find_in_files()
307 self.assertIs(False, find.FinderWorker.called)
308 self.assertIs(None, finder.last_find)
309 self.assertEqual(
310 'The directory path does not exist!',
311 finder.file_lines_view.get_model()[0][0])
312
229 def test_show_replace(self):313 def test_show_replace(self):
230 window, view, document = self.make_gedit(314 window, view, document = self.make_gedit(
231 'plugins/gdp/data/snark12.txt')315 'plugins/gdp/data/snark12.txt')
@@ -235,6 +319,21 @@
235 finder.show_replace(None)319 finder.show_replace(None)
236 self.assertTrue(panel.props.visible)320 self.assertTrue(panel.props.visible)
237321
322 def test_on_replace_in_files_icon_press(self):
323 # Setup a test config so that the singleton is not mutated.
324 self.make_config(find, Config)
325 window, view, document = self.make_gedit(
326 'plugins/gdp/data/snark12.txt')
327 finder = Finder(window)
328 finder.update_comboentry(finder.pattern_comboentry, 'snark', True)
329 finder.update_comboentry(
330 finder.path_comboentry, '<Current File>', True)
331 MockMethod.bind(self, finder, 'on_replace_in_files')
332 finder.on_replace_in_files_icon_press(
333 finder.substitution_comboentry,
334 Gtk.EntryIconPosition.SECONDARY, None)
335 self.assertTrue(finder.on_replace_in_files.called)
336
238 def test_get_untested_replacement_dialog(self):337 def test_get_untested_replacement_dialog(self):
239 # If the plugin's last_find is not equal to the current find,338 # If the plugin's last_find is not equal to the current find,
240 # a window is presented to confirm the replace.339 # a window is presented to confirm the replace.
241340
=== modified file 'plugins/gdp/tests/test_gdp.py'
--- plugins/gdp/tests/test_gdp.py 2012-02-07 12:20:48 +0000
+++ plugins/gdp/tests/test_gdp.py 2012-06-18 13:32:54 +0000
@@ -6,12 +6,74 @@
66
7from xdg import BaseDirectory7from xdg import BaseDirectory
88
9from gi.repository import (
10 GObject,
11 Gtk,
12 )
13
9from gdp import (14from gdp import (
10 Config,15 Config,
16 set_file_line,
11 )17 )
12from testing import GeditTestCase18from testing import GeditTestCase
1319
1420
21class FileLinesViewTestCase(GeditTestCase):
22
23 def makeTreeStore(self):
24 return Gtk.TreeStore(
25 GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_INT,
26 GObject.TYPE_STRING, GObject.TYPE_STRING)
27
28 def test_set_file_type_line_no_and_message(self):
29 model = self.makeTreeStore()
30 piter = model.append(
31 None, ('/fnord/pting', 'some-icon', 5, 'message', '/fnord'))
32 cell = Gtk.CellRendererText()
33 set_file_line(None, cell, model, piter, 'line_no')
34 self.assertEqual('5', cell.props.text)
35
36 def test_set_file_type_line_no_without_message(self):
37 model = self.makeTreeStore()
38 piter = model.append(
39 None, ('/fnord/pting', 'some-icon', 5, None, '/fnord'))
40 cell = Gtk.CellRendererText()
41 set_file_line(None, cell, model, piter, 'line_no')
42 self.assertEqual('', cell.props.text)
43
44 def test_set_file_type_text_and_message(self):
45 model = self.makeTreeStore()
46 piter = model.append(
47 None, ('/fnord/pting', 'some-icon', 5, 'message', '/fnord'))
48 cell = Gtk.CellRendererText()
49 set_file_line(None, cell, model, piter, 'text')
50 self.assertEqual('message', cell.props.text)
51
52 def test_set_file_type_text_without_message(self):
53 model = self.makeTreeStore()
54 piter = model.append(
55 None, ('/fnord/pting', 'some-icon', 5, None, '/fnord'))
56 cell = Gtk.CellRendererText()
57 set_file_line(None, cell, model, piter, 'text')
58 self.assertEqual('./pting', cell.props.text)
59
60 def test_set_file_type_text_without_message_with_trailing_slash(self):
61 model = self.makeTreeStore()
62 piter = model.append(
63 None, ('/fnord/pting', 'some-icon', 5, None, '/fnord/'))
64 cell = Gtk.CellRendererText()
65 set_file_line(None, cell, model, piter, 'text')
66 self.assertEqual('./pting', cell.props.text)
67
68 def test_set_file_type_text_without_message_or_base_dir(self):
69 model = self.makeTreeStore()
70 piter = model.append(
71 None, ('/fnord/pting', 'some-icon', 5, None, None))
72 cell = Gtk.CellRendererText()
73 set_file_line(None, cell, model, piter, 'text')
74 self.assertEqual('/fnord/pting', cell.props.text)
75
76
15class ConfigTestCase(GeditTestCase):77class ConfigTestCase(GeditTestCase):
1678
17 def make_config(self, text=''):79 def make_config(self, text=''):
1880
=== modified file 'testing/__init__.py'
--- testing/__init__.py 2012-03-12 13:04:13 +0000
+++ testing/__init__.py 2012-06-18 13:32:54 +0000
@@ -50,8 +50,8 @@
50 self.addCleanup(50 self.addCleanup(
51 os.environ.update, {'GSETTINGS_BACKEND': old_backend})51 os.environ.update, {'GSETTINGS_BACKEND': old_backend})
52 else:52 else:
53 os.environ['GSETTINGS_BACKEND'] = 'memory'
54 self.addCleanup(os.environ.__delitem__, 'GSETTINGS_BACKEND')53 self.addCleanup(os.environ.__delitem__, 'GSETTINGS_BACKEND')
54 os.environ['GSETTINGS_BACKEND'] = 'memory'
55 settings = Gio.Settings.new('org.gnome.gedit.plugins')55 settings = Gio.Settings.new('org.gnome.gedit.plugins')
56 return settings56 return settings
5757
@@ -74,7 +74,7 @@
74 return text_file74 return text_file
7575
7676
77class MockMethod:77class MockMethod(object):
7878
79 @classmethod79 @classmethod
80 def bind(klass, test_instance, obj, method_name,80 def bind(klass, test_instance, obj, method_name,
8181
=== modified file 'testing/testrunner.py'
--- testing/testrunner.py 2012-03-12 13:04:13 +0000
+++ testing/testrunner.py 2012-06-18 13:32:54 +0000
@@ -196,6 +196,7 @@
196 setup_env(params)196 setup_env(params)
197 os.chdir(project_dir())197 os.chdir(project_dir())
198 os.environ['use_fake_gedit'] = 'true'198 os.environ['use_fake_gedit'] = 'true'
199 os.environ['GSETTINGS_BACKEND'] = 'memory'
199 # Format the output.200 # Format the output.
200 unittest.runner._WritelnDecorator = Env.write_decorator201 unittest.runner._WritelnDecorator = Env.write_decorator
201 suite = unittest.TestSuite()202 suite = unittest.TestSuite()

Subscribers

People subscribed via source and target branches

to all changes: