Merge lp://staging/~dpaleino/wicd/code-separation into lp://staging/wicd/1.6

Proposed by David Paleino
Status: Merged
Merged at revision: not available
Proposed branch: lp://staging/~dpaleino/wicd/code-separation
Merge into: lp://staging/wicd/1.6
Diff against target: 290 lines (+65/-34)
13 files modified
gtk/gui.py (+6/-6)
gtk/guiutil.py (+1/-1)
gtk/netentry.py (+7/-7)
gtk/prefs.py (+1/-1)
gtk/wicd-client.py (+2/-2)
in/scripts=wicd-cli.in (+1/-1)
in/scripts=wicd-client.in (+1/-1)
in/scripts=wicd-curses.in (+1/-1)
in/scripts=wicd-gtk.in (+15/-0)
in/scripts=wicd.in (+4/-1)
in/wicd=wpath.py.in (+4/-0)
setup.py (+21/-12)
wicd/wicd-daemon.py (+1/-1)
To merge this branch: bzr merge lp://staging/~dpaleino/wicd/code-separation
Reviewer Review Type Date Requested Status
Wicd-devel Pending
Review via email: mp+16728@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
David Paleino (dpaleino) wrote :

This is what I'm doing in Debian, plus some others changes, like moving files from wicd/ to the newly created gtk/. Also, I added a "wicd-gtk" script.

This branch should work fine, even though I haven't tested the wicd-gtk script installation, nor if moving things from wicd/ to gtk/ broke something (yes, I updated setup.py for both cases). In Debian, I've reached this with Debian-specific packaging files (for Adam: debian/foo.install, and wicd-gtk is itself in debian/)

It would be extra cool if you merged this in time for 1.7.0 :)

Thank you,
David

505. By Adam Blackburn

merged David Paleino's split file installation branch

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'gtk'
2=== renamed file 'wicd/configscript.py' => 'gtk/configscript.py'
3=== renamed file 'wicd/gui.py' => 'gtk/gui.py'
4--- wicd/gui.py 2009-12-30 21:06:27 +0000
5+++ gtk/gui.py 2010-01-02 11:36:15 +0000
6@@ -36,12 +36,12 @@
7 from wicd import misc
8 from wicd import wpath
9 from wicd import dbusmanager
10-from wicd import prefs
11-from wicd import netentry
12 from wicd.misc import noneToString
13-from wicd.netentry import WiredNetworkEntry, WirelessNetworkEntry
14-from wicd.prefs import PreferencesDialog
15-from wicd.guiutil import error, LabelEntry
16+import prefs
17+from prefs import PreferencesDialog
18+import netentry
19+from netentry import WiredNetworkEntry, WirelessNetworkEntry
20+from guiutil import error, LabelEntry
21 from wicd.translations import language
22
23 if __name__ == '__main__':
24@@ -148,7 +148,7 @@
25
26 self.tray = tray
27
28- gladefile = os.path.join(wpath.share, "wicd.glade")
29+ gladefile = os.path.join(wpath.gtk, "wicd.glade")
30 self.wTree = gtk.glade.XML(gladefile)
31 self.window = self.wTree.get_widget("window1")
32 self.window.set_icon_name("wicd-client")
33
34=== renamed file 'wicd/guiutil.py' => 'gtk/guiutil.py'
35--- wicd/guiutil.py 2009-11-27 03:42:39 +0000
36+++ gtk/guiutil.py 2010-01-02 11:36:15 +0000
37@@ -19,7 +19,7 @@
38 import gtk
39 import os.path
40
41-import wpath
42+import wicd.wpath as wpath
43
44 HAS_NOTIFY = True
45 try:
46
47=== renamed file 'wicd/netentry.py' => 'gtk/netentry.py'
48--- wicd/netentry.py 2009-12-30 18:29:22 +0000
49+++ gtk/netentry.py 2010-01-02 11:36:15 +0000
50@@ -26,13 +26,13 @@
51 import gtk
52 import os
53
54-import misc
55-import wpath
56-import dbusmanager
57-from misc import noneToString, stringToNone, noneToBlankString, to_bool
58+import wicd.misc as misc
59+import wicd.wpath as wpath
60+import wicd.dbusmanager as dbusmanager
61+from wicd.misc import noneToString, stringToNone, noneToBlankString, to_bool
62 from guiutil import error, LabelEntry, GreyLabel, LeftAlignedLabel, string_input
63
64-from translations import language
65+from wicd.translations import language
66
67 # These get set when a NetworkEntry is instantiated.
68 daemon = None
69@@ -303,7 +303,7 @@
70 def edit_scripts(self, widget=None, event=None):
71 """ Launch the script editting dialog. """
72 profile = self.prof_name
73- cmdend = [os.path.join(wpath.lib, "configscript.py"), profile, "wired"]
74+ cmdend = [os.path.join(wpath.gtk, "configscript.py"), profile, "wired"]
75 if os.getuid() != 0:
76 cmdbase = misc.get_sudo_cmd(language['scripts_need_pass'],
77 prog_num=daemon.GetSudoApp())
78@@ -408,7 +408,7 @@
79
80 def edit_scripts(self, widget=None, event=None):
81 """ Launch the script editting dialog. """
82- cmdend = [os.path.join(wpath.lib, "configscript.py"),
83+ cmdend = [os.path.join(wpath.gtk, "configscript.py"),
84 str(self.networkID), "wireless"]
85 if os.getuid() != 0:
86 cmdbase = misc.get_sudo_cmd(language['scripts_need_pass'],
87
88=== renamed file 'wicd/prefs.py' => 'gtk/prefs.py'
89--- wicd/prefs.py 2009-11-24 05:27:41 +0000
90+++ gtk/prefs.py 2010-01-02 11:36:15 +0000
91@@ -39,7 +39,7 @@
92 wireless = None
93 wired = None
94
95-from translations import language
96+from wicd.translations import language
97
98 USER_SETTINGS_DIR = os.path.expanduser('~/.wicd/')
99
100
101=== renamed file 'wicd/wicd-client.py' => 'gtk/wicd-client.py'
102--- wicd/wicd-client.py 2009-12-30 21:29:59 +0000
103+++ gtk/wicd-client.py 2010-01-02 11:36:15 +0000
104@@ -60,9 +60,9 @@
105 # Wicd specific imports
106 from wicd import wpath
107 from wicd import misc
108-from wicd import gui
109 from wicd import dbusmanager
110-from wicd.guiutil import error, can_use_notify
111+import gui
112+from guiutil import error, can_use_notify
113
114 from wicd.translations import language
115
116
117=== modified file 'in/scripts=wicd-cli.in'
118--- in/scripts=wicd-cli.in 2009-12-28 03:22:09 +0000
119+++ in/scripts=wicd-cli.in 2010-01-02 11:36:15 +0000
120@@ -1,2 +1,2 @@
121 #!/bin/bash
122-exec %PYTHON% -O %LIB%wicd-cli.py $@
123+exec %PYTHON% -O %LIB%cli/wicd-cli.py $@
124
125=== modified file 'in/scripts=wicd-client.in'
126--- in/scripts=wicd-client.in 2009-12-28 03:22:09 +0000
127+++ in/scripts=wicd-client.in 2010-01-02 11:36:15 +0000
128@@ -41,5 +41,5 @@
129
130 fi
131 else
132- exec %PYTHON% -O %LIB%wicd-client.py $@
133+ exec %BIN%wicd-gtk
134 fi
135
136=== modified file 'in/scripts=wicd-curses.in'
137--- in/scripts=wicd-curses.in 2009-12-28 03:22:09 +0000
138+++ in/scripts=wicd-curses.in 2010-01-02 11:36:15 +0000
139@@ -6,4 +6,4 @@
140 ln -s "%VARLIB%WHEREAREMYFILES" "$HOME/.wicd/WHEREAREMYFILES"
141 fi
142
143-exec %PYTHON% -O %LIB%wicd-curses.py $@
144+exec %PYTHON% -O %LIB%curses/wicd-curses.py $@
145
146=== added file 'in/scripts=wicd-gtk.in'
147--- in/scripts=wicd-gtk.in 1970-01-01 00:00:00 +0000
148+++ in/scripts=wicd-gtk.in 2010-01-02 11:36:15 +0000
149@@ -0,0 +1,15 @@
150+#!/bin/sh
151+
152+# check_firstrun()
153+if [ ! -d "$HOME/.wicd" ]; then
154+ mkdir -p "$HOME/.wicd"
155+fi
156+# Make sure the user knows WHEREAREMYFILES ;-)
157+if [ -e "/var/lib/wicd/WHEREAREMYFILES" ] && [ ! -L "$HOME/.wicd/WHEREAREMYFILES" ]; then
158+ ln -s "/var/lib/wicd/WHEREAREMYFILES" "$HOME/.wicd/WHEREAREMYFILES"
159+fi
160+
161+PYTHONPATH=%LIB%
162+export PYTHONPATH
163+
164+exec %PYTHON% -O %LIB%gtk/wicd-client.py $@
165
166=== modified file 'in/scripts=wicd.in'
167--- in/scripts=wicd.in 2009-12-28 03:22:09 +0000
168+++ in/scripts=wicd.in 2010-01-02 11:36:15 +0000
169@@ -1,3 +1,6 @@
170 #!/bin/bash
171
172-exec %PYTHON% -O %LIB%wicd-daemon.py $@
173+PYTHONPATH=%LIB%
174+export PYTHONPATH
175+
176+exec %PYTHON% -O %LIB%daemon/wicd-daemon.py $@
177
178=== modified file 'in/wicd=wpath.py.in'
179--- in/wicd=wpath.py.in 2009-11-21 18:06:46 +0000
180+++ in/wicd=wpath.py.in 2010-01-02 11:36:15 +0000
181@@ -44,6 +44,10 @@
182 dbus = '%DBUS%'
183 desktop = '%DESKTOP%'
184 backends= '%BACKENDS%'
185+daemon = '%DAEMON%'
186+curses = '%CURSES%'
187+gtk = '%GTK%'
188+cli = '%CLI%'
189 translations = '%TRANSLATIONS%'
190 icons = '%ICONS%'
191 autostart = '%AUTOSTART%'
192
193=== modified file 'setup.py'
194--- setup.py 2010-01-02 07:44:48 +0000
195+++ setup.py 2010-01-02 11:36:15 +0000
196@@ -61,6 +61,10 @@
197 ('bin=', None, 'set the bin directory'),
198 ('sbin=', None, 'set the sbin directory'),
199 ('backends=', None, 'set the backend storage directory'),
200+ ('daemon=', None, 'set the daemon directory'),
201+ ('curses=', None, 'set the curses UI directory'),
202+ ('gtk=', None, 'set the GTK UI directory'),
203+ ('cli=', None, 'set the CLI directory'),
204 ('networks=', None, 'set the encryption configuration directory'),
205 ('log=', None, 'set the log directory'),
206 ('resume=', None, 'set the directory the resume from suspend script is stored in'),
207@@ -113,7 +117,11 @@
208 self.encryption = self.etc + 'encryption/templates/'
209 self.bin = '/usr/bin/'
210 self.sbin = '/usr/sbin/'
211- self.backends = self.lib + 'backends'
212+ self.daemon = self.share + 'daemon'
213+ self.backends = self.share + 'backends'
214+ self.curses = self.share + 'curses'
215+ self.gtk = self.share + 'gtk'
216+ self.cli = self.share + 'cli'
217 self.varlib = '/var/lib/wicd/'
218 self.networks = self.varlib + 'configurations/'
219 self.log = '/var/log/wicd/'
220@@ -464,7 +472,7 @@
221
222 data = []
223 py_modules=['wicd.networking','wicd.misc','wicd.wnettools',
224- 'wicd.wpath','wicd.prefs','wicd.netentry','wicd.dbusmanager',
225+ 'wicd.wpath','wicd.dbusmanager',
226 'wicd.logfile','wicd.backend','wicd.configmanager',
227 'wicd.translations']
228
229@@ -478,7 +486,7 @@
230 os.listdir('encryption/templates') if not b.startswith('.')]),
231 (wpath.networks, []),
232 (wpath.sbin, ['scripts/wicd']),
233- (wpath.lib, ['wicd/monitor.py', 'wicd/wicd-daemon.py', 'wicd/configscript.py',
234+ (wpath.daemon, ['wicd/monitor.py', 'wicd/wicd-daemon.py',
235 'wicd/suspend.py', 'wicd/autoconnect.py']),
236 (wpath.backends, ['wicd/backends/be-external.py', 'wicd/backends/be-ioctl.py']),
237 (wpath.scripts, []),
238@@ -488,11 +496,12 @@
239 (wpath.postconnectscripts, []),
240 ]
241 if not wpath.no_install_gtk:
242- py_modules.extend(['wicd.gui', 'wicd.guiutil'])
243 data.append((wpath.desktop, ['other/wicd.desktop']))
244 data.append((wpath.bin, ['scripts/wicd-client']))
245- data.append((wpath.share, ['data/wicd.glade']))
246- data.append((wpath.lib, ['wicd/wicd-client.py']))
247+ data.append((wpath.bin, ['scripts/wicd-gtk']))
248+ data.append((wpath.gtk, ['gtk/wicd-client.py', 'gtk/netentry.py', 'gtk/prefs.py',
249+ 'gtk/gui.py', 'gtk/guiutil.py', 'data/wicd.glade',
250+ 'gtk/configscript.py']))
251 data.append((wpath.autostart, ['other/wicd-tray.desktop']))
252 if not wpath.no_install_man:
253 data.append((wpath.mandir + 'man1/', [ 'man/wicd-client.1' ]))
254@@ -510,18 +519,18 @@
255 data.append((wpath.icons + '16x16/apps/', ['icons/16px/wicd-client.png']))
256 data.append((wpath.images, [('images/' + b) for b in os.listdir('images') if not b.startswith('.')]))
257 if not wpath.no_install_ncurses:
258- data.append((wpath.lib, ['curses/curses_misc.py']))
259- data.append((wpath.lib, ['curses/prefs_curses.py']))
260- data.append((wpath.lib, ['curses/wicd-curses.py']))
261- data.append((wpath.lib, ['curses/netentry_curses.py']))
262- data.append((wpath.lib, ['curses/configscript_curses.py']))
263+ data.append((wpath.curses, ['curses/curses_misc.py']))
264+ data.append((wpath.curses, ['curses/prefs_curses.py']))
265+ data.append((wpath.curses, ['curses/wicd-curses.py']))
266+ data.append((wpath.curses, ['curses/netentry_curses.py']))
267+ data.append((wpath.curses, ['curses/configscript_curses.py']))
268 data.append((wpath.bin, ['scripts/wicd-curses']))
269 if not wpath.no_install_man:
270 data.append(( wpath.mandir + 'man8/', ['man/wicd-curses.8']))
271 if not wpath.no_install_docs:
272 data.append(( wpath.docdir, ['curses/README.curses']))
273 if not wpath.no_install_cli:
274- data.append((wpath.lib, ['cli/wicd-cli.py']))
275+ data.append((wpath.cli, ['cli/wicd-cli.py']))
276 data.append((wpath.bin, ['scripts/wicd-cli']))
277 if not wpath.no_install_man:
278 data.append(( wpath.mandir + 'man8/', ['man/wicd-cli.8']))
279
280=== modified file 'wicd/wicd-daemon.py'
281--- wicd/wicd-daemon.py 2009-12-30 02:22:23 +0000
282+++ wicd/wicd-daemon.py 2010-01-02 11:36:15 +0000
283@@ -1790,7 +1790,7 @@
284 daemon = WicdDaemon(wicd_bus, auto_connect=auto_connect)
285 if not no_poll:
286 child_pid = Popen([misc.find_path("python"), "-O",
287- os.path.join(wpath.lib, "monitor.py")],
288+ os.path.join(wpath.lib, "daemon", "monitor.py")],
289 shell=False, close_fds=True).pid
290 atexit.register(on_exit, child_pid)
291

Subscribers

People subscribed via source and target branches

to status/vote changes: