Status: | Needs review |
---|---|
Proposed branch: | lp:~noskcaj/testdrive/pep8 |
Merge into: | lp:testdrive |
Diff against target: |
3322 lines (+922/-571) 17 files modified
bin/testdrive (+106/-51) bin/testdrive-gtk (+250/-152) debian/changelog (+4/-6) debian/control (+2/-1) debian/copyright (+5/-0) debian/release.sh (+1/-1) po/testdrive.pot (+177/-132) setup.py (+30/-28) testdrive/testdrive.py (+75/-36) testdrive/virt/kvm.py (+22/-8) testdrive/virt/parallels.py (+18/-7) testdrive/virt/virtualbox.py (+55/-25) testdrivegtk/AboutTestdrivegtkDialog.py (+20/-17) testdrivegtk/AddOtherTestdrivegtkDialog.py (+31/-19) testdrivegtk/PreferencesTestdrivegtkDialog.py (+101/-65) testdrivegtk/helpers.py (+13/-12) testdrivegtk/testdrivegtkconfig.py (+12/-11) |
To merge this branch: | bzr merge lp:~noskcaj/testdrive/pep8 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Andres Rodriguez | Needs Fixing | ||
Review via email: mp+189491@code.launchpad.net |
Commit message
Description of the change
makes the program pep8 compliant and adds some minor fixes.
- 434. By Jackson Doak
-
prevent testdrive from importing gettext twice
- 435. By Jackson Doak
-
Comment out unused imports
- 436. By Jackson Doak
-
Fix minor text bugs i made.
Jackson Doak (noskcaj) wrote : | # |
first, thanks for having time to review.
second, I'll re-do this in separate branches one the PyGI (and maybe
python3) port is over. Is there any chance you could help with either,
since glade keep breaking for me and dan hasn't got the time.
On Sun, Oct 27, 2013 at 5:24 AM, Andres Rodriguez
<email address hidden>wrote:
> Review: Needs Fixing
>
> Hi Jackson!
>
> I like this fixes for sure.. however, it is way too big to review.. is
> there anyway you can split this in smaller branches? (Say one branch per
> binary, so that it is easier to test and review).
>
> thank you! this is awesome!
> --
> https:/
> You are the owner of lp:~noskcaj/testdrive/pep8.
>
Unmerged revisions
- 436. By Jackson Doak
-
Fix minor text bugs i made.
- 435. By Jackson Doak
-
Comment out unused imports
- 434. By Jackson Doak
-
prevent testdrive from importing gettext twice
- 433. By Jackson Doak
-
* debian/control: Add working VCS fields
* debian/release.sh: Update current ubuntu release - 432. By Jackson Doak
-
Add copyright entry for testdrivegtk/
AddOtherTestdri vegtkDialog. py - 431. By Jackson Doak
-
Finish pep8 changes
- 430. By Jackson Doak
-
Make testdrive pep8 compliant
Preview Diff
1 | === modified file 'bin/testdrive' | |||
2 | --- bin/testdrive 2013-08-10 20:52:38 +0000 | |||
3 | +++ bin/testdrive 2013-10-06 20:59:44 +0000 | |||
4 | @@ -19,11 +19,21 @@ | |||
5 | 19 | # You should have received a copy of the GNU General Public License | 19 | # You should have received a copy of the GNU General Public License |
6 | 20 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 20 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
7 | 21 | 21 | ||
9 | 22 | import commands, hashlib, os, string, sys, tempfile, time, platform, subprocess, tarfile, logging | 22 | import commands |
10 | 23 | #import hashlib | ||
11 | 24 | import os | ||
12 | 25 | import string | ||
13 | 26 | import sys | ||
14 | 27 | #import tempfile | ||
15 | 28 | import time | ||
16 | 29 | #import platform | ||
17 | 30 | import subprocess | ||
18 | 31 | import tarfile | ||
19 | 32 | import logging | ||
20 | 23 | from optparse import OptionParser | 33 | from optparse import OptionParser |
21 | 24 | 34 | ||
22 | 25 | import gettext | 35 | import gettext |
24 | 26 | from gettext import gettext as _ | 36 | _ = gettext.gettext |
25 | 27 | gettext.textdomain('testdrive') | 37 | gettext.textdomain('testdrive') |
26 | 28 | 38 | ||
27 | 29 | from testdrive import testdrive | 39 | from testdrive import testdrive |
28 | @@ -57,9 +67,12 @@ | |||
29 | 57 | filename = os.path.basename(iso["url"]) | 67 | filename = os.path.basename(iso["url"]) |
30 | 58 | path = "%s/%s_%s" % (td.CACHE_ISO, iso["category"], filename) | 68 | path = "%s/%s_%s" % (td.CACHE_ISO, iso["category"], filename) |
31 | 59 | if os.path.exists(path): | 69 | if os.path.exists(path): |
35 | 60 | print(_(" +-cache--> [%s] %s") % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(os.path.getmtime(path))), filename)) | 70 | print(_(" +-cache--> [%s] %s") % (time.strftime( |
36 | 61 | i=i+1 | 71 | "%Y-%m-%d %H:%M:%S", time.localtime( |
37 | 62 | menu.append({"id":i, "url":iso["url"], "cat": iso["category"]}) | 72 | os.path.getmtime(path))), filename)) |
38 | 73 | i += 1 | ||
39 | 74 | menu.append({"id": i, "url": iso["url"], | ||
40 | 75 | "cat": iso["category"]}) | ||
41 | 63 | print(_(" %d. Other (prompt for ISO URL)") % i) | 76 | print(_(" %d. Other (prompt for ISO URL)") % i) |
42 | 64 | try: | 77 | try: |
43 | 65 | input = raw_input(_("\nSelect an image to testdrive [1]: ")) | 78 | input = raw_input(_("\nSelect an image to testdrive [1]: ")) |
44 | @@ -84,38 +97,46 @@ | |||
45 | 84 | logger.error(_("\nERROR: Invalid selection\n")) | 97 | logger.error(_("\nERROR: Invalid selection\n")) |
46 | 85 | return(url) | 98 | return(url) |
47 | 86 | 99 | ||
48 | 100 | |||
49 | 87 | def error(str): | 101 | def error(str): |
50 | 88 | logger.error(_("\n%s\n") % str) | 102 | logger.error(_("\n%s\n") % str) |
51 | 89 | sys.exit(1) | 103 | sys.exit(1) |
52 | 90 | 104 | ||
53 | 105 | |||
54 | 91 | def is_iso(file): | 106 | def is_iso(file): |
55 | 92 | # If it's a URL, assume it's good | 107 | # If it's a URL, assume it's good |
56 | 93 | for i in ("http", "ftp", "rsync", "file", "zsync"): | 108 | for i in ("http", "ftp", "rsync", "file", "zsync"): |
57 | 94 | if string.find(file, "%s://" % i) == 0: | 109 | if string.find(file, "%s://" % i) == 0: |
58 | 95 | return(file) | 110 | return(file) |
59 | 96 | # If it's a local path, test it for viability | 111 | # If it's a local path, test it for viability |
61 | 97 | if commands.getstatusoutput("file \"%s\" | grep -qs \"ISO 9660\"" % file)[0] == 0: | 112 | if commands.getstatusoutput("file \"%s\" | grep -qs \"ISO 9660\"" |
62 | 113 | % file)[0] == 0: | ||
63 | 98 | return("file://%s" % file) | 114 | return("file://%s" % file) |
64 | 99 | elif tarfile.is_tarfile(file): | 115 | elif tarfile.is_tarfile(file): |
65 | 100 | return("file://%s" % file) | 116 | return("file://%s" % file) |
66 | 101 | else: | 117 | else: |
67 | 102 | error(_("Invalid ISO URL [%s]") % file) | 118 | error(_("Invalid ISO URL [%s]") % file) |
68 | 103 | 119 | ||
69 | 120 | |||
70 | 104 | def is_disk_img(file): | 121 | def is_disk_img(file): |
80 | 105 | (status, output) = commands.getstatusoutput("file %s | grep -qs 'Qemu Image'" % file) | 122 | (status, output) = commands.getstatusoutput( |
81 | 106 | if status == 0: | 123 | "file %s | grep -qs 'Qemu Image'" % file) |
82 | 107 | # qemu/kvm qcow2 image | 124 | if status == 0: |
83 | 108 | return True | 125 | # qemu/kvm qcow2 image |
84 | 109 | (status, output) = commands.getstatusoutput("file %s | grep -qs 'QEMU QCOW Image'" % file) | 126 | return True |
85 | 110 | if status == 0: | 127 | (status, output) = commands.getstatusoutput( |
86 | 111 | # qemu/kvm qcow2 image | 128 | "file %s | grep -qs 'QEMU QCOW Image'" % file) |
87 | 112 | return True | 129 | if status == 0: |
88 | 113 | (status, output) = commands.getstatusoutput("file %s | grep -qs '.img: data$'" % file) | 130 | # qemu/kvm qcow2 image |
89 | 131 | return True | ||
90 | 132 | (status, output) = commands.getstatusoutput( | ||
91 | 133 | "file %s | grep -qs '.img: data$'" % file) | ||
92 | 114 | if status == 0: | 134 | if status == 0: |
93 | 115 | # probably a virtual box image | 135 | # probably a virtual box image |
94 | 116 | return True | 136 | return True |
95 | 117 | return False | 137 | return False |
96 | 118 | 138 | ||
97 | 139 | |||
98 | 119 | def is_cloud_img(file): | 140 | def is_cloud_img(file): |
99 | 120 | img = False | 141 | img = False |
100 | 121 | floppy = False | 142 | floppy = False |
101 | @@ -136,19 +157,23 @@ | |||
102 | 136 | else: | 157 | else: |
103 | 137 | return False | 158 | return False |
104 | 138 | 159 | ||
105 | 160 | |||
106 | 139 | def run(cmd): | 161 | def run(cmd): |
107 | 140 | return(os.system(cmd)) | 162 | return(os.system(cmd)) |
108 | 141 | 163 | ||
109 | 164 | |||
110 | 142 | def run_or_die(cmd): | 165 | def run_or_die(cmd): |
111 | 143 | if run(cmd) != 0: | 166 | if run(cmd) != 0: |
112 | 144 | error(_("Command failed\n `%s`") % cmd) | 167 | error(_("Command failed\n `%s`") % cmd) |
113 | 145 | 168 | ||
114 | 169 | |||
115 | 146 | def run_vm(cmd, td, curses): | 170 | def run_vm(cmd, td, curses): |
116 | 147 | if not curses: | 171 | if not curses: |
117 | 148 | p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) | 172 | p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) |
118 | 149 | if td.VIRT == 'kvm': | 173 | if td.VIRT == 'kvm': |
119 | 150 | if curses: | 174 | if curses: |
121 | 151 | logger.info(_("Launching Virtual Machine using CURSES as screen mode")) | 175 | logger.info(_( |
122 | 176 | "Launching Virtual Machine using CURSES as screen mode")) | ||
123 | 152 | run_or_die(cmd) | 177 | run_or_die(cmd) |
124 | 153 | else: | 178 | else: |
125 | 154 | p.wait() | 179 | p.wait() |
126 | @@ -156,15 +181,20 @@ | |||
127 | 156 | # Give this VM a few seconds to start up | 181 | # Give this VM a few seconds to start up |
128 | 157 | time.sleep(5) | 182 | time.sleep(5) |
129 | 158 | # Loop as long as this VM is running | 183 | # Loop as long as this VM is running |
131 | 159 | while commands.getstatusoutput("VBoxManage list runningvms | grep -qs %s" % td.VBOX_NAME)[0] == 0: | 184 | while commands.getstatusoutput( |
132 | 185 | "VBoxManage list runningvms | grep -qs %s" % td.VBOX_NAME | ||
133 | 186 | )[0] == 0: | ||
134 | 160 | time.sleep(2) | 187 | time.sleep(2) |
135 | 161 | elif td.VIRT == 'parallels': | 188 | elif td.VIRT == 'parallels': |
136 | 162 | # Loop as long as this VM is running | 189 | # Loop as long as this VM is running |
138 | 163 | while commands.getstatusoutput("prlctl list %s | grep -qs stopped" % td.VBOX_NAME)[0] != 0: | 190 | while commands.getstatusoutput( |
139 | 191 | "prlctl list %s | grep -qs stopped" % td.VBOX_NAME)[0] != 0: | ||
140 | 164 | time.sleep(2) | 192 | time.sleep(2) |
141 | 165 | 193 | ||
142 | 194 | |||
143 | 166 | def main(): | 195 | def main(): |
145 | 167 | # Initialize Testdrive Class, sending section used to retrieve settings from config file | 196 | # Initialize Testdrive Class, |
146 | 197 | # sending section used to retrieve settings from config file | ||
147 | 168 | td = testdrive.Testdrive('testdrive') | 198 | td = testdrive.Testdrive('testdrive') |
148 | 169 | 199 | ||
149 | 170 | # Local UI | 200 | # Local UI |
150 | @@ -190,36 +220,48 @@ | |||
151 | 190 | Users wanting to change the behavior default configuration can make a\n\ | 220 | Users wanting to change the behavior default configuration can make a\n\ |
152 | 191 | copy of /etc/%progrc, and pass this as a parameter to %prog.\n" | 221 | copy of /etc/%progrc, and pass this as a parameter to %prog.\n" |
153 | 192 | 222 | ||
154 | 193 | |||
155 | 194 | parser = OptionParser(usage) | 223 | parser = OptionParser(usage) |
157 | 195 | parser.add_option('-f', '--config', action='store', type='string', dest='config', | 224 | parser.add_option( |
158 | 225 | '-f', '--config', action='store', type='string', dest='config', | ||
159 | 196 | help=_('user configuration file (overriding default values')) | 226 | help=_('user configuration file (overriding default values')) |
161 | 197 | parser.add_option('-v', '--version', action='store_true', dest='version', default=False, | 227 | parser.add_option( |
162 | 228 | '-v', '--version', action='store_true', dest='version', default=False, | ||
163 | 198 | help=_('print version and system data, and exit')) | 229 | help=_('print version and system data, and exit')) |
165 | 199 | parser.add_option('-u', '--url', action='store', type='string', dest='url', | 230 | parser.add_option( |
166 | 231 | '-u', '--url', action='store', type='string', dest='url', | ||
167 | 200 | help=_('get ISO image from this URL location')) | 232 | help=_('get ISO image from this URL location')) |
169 | 201 | parser.add_option('-d', '--desktop', action='store_true', dest='desktop', default=False, | 233 | parser.add_option( |
170 | 234 | '-d', '--desktop', action='store_true', dest='desktop', default=False, | ||
171 | 202 | help=_('try to launch usb-creator for further testing')) | 235 | help=_('try to launch usb-creator for further testing')) |
173 | 203 | parser.add_option('-r', '--release', action='store', type='string', dest='release', | 236 | parser.add_option( |
174 | 237 | '-r', '--release', action='store', type='string', dest='release', | ||
175 | 204 | help=_('hardcode Ubuntu RELEASE codename')) | 238 | help=_('hardcode Ubuntu RELEASE codename')) |
177 | 205 | parser.add_option('-l', '--flavor', action='store', type='string', dest='flavor', | 239 | parser.add_option( |
178 | 240 | '-l', '--flavor', action='store', type='string', dest='flavor', | ||
179 | 206 | help=_('hardcode Ubuntu flavor. Available Flavors:\n\ | 241 | help=_('hardcode Ubuntu flavor. Available Flavors:\n\ |
182 | 207 | ubuntu/kubuntu/xubuntu/edubuntu/mythbuntu/ubuntustudio/lubuntu/ubuntukylin')) | 242 | ubuntu/kubuntu/xubuntu/edubuntu/mythbuntu/' |
183 | 208 | parser.add_option('-p', '--repo', action='store', type='string', dest='repository', | 243 | 'ubuntustudio/lubuntu/ubuntukylin')) |
184 | 244 | parser.add_option( | ||
185 | 245 | '-p', '--repo', action='store', type='string', dest='repository', | ||
186 | 209 | help=_('hardcode Ubuntu repository from where to obtain ISOs:\n\ | 246 | help=_('hardcode Ubuntu repository from where to obtain ISOs:\n\ |
187 | 210 | releases/cdimage/cloud-daily/cloud-releases')) | 247 | releases/cdimage/cloud-daily/cloud-releases')) |
191 | 211 | parser.add_option('-c', '--curses', action='store_true', default=False, dest='curses', | 248 | parser.add_option( |
192 | 212 | help=_('displays the Virtual Machine in the shell. Only valid for Cloud images.')) | 249 | '-c', '--curses', action='store_true', default=False, dest='curses', |
193 | 213 | #parser.add_option('-v', '--verbose', action='store_true', default=False, dest='verbose', | 250 | help=_('displays the Virtual Machine in the shell. ' |
194 | 251 | 'Only valid for Cloud images.')) | ||
195 | 252 | #parser.add_option( | ||
196 | 253 | # '-v', '--verbose', action='store_true', default=False, dest='verbose', | ||
197 | 214 | # help=_('show debug messages')) | 254 | # help=_('show debug messages')) |
198 | 215 | 255 | ||
199 | 216 | (opt, args) = parser.parse_args() | 256 | (opt, args) = parser.parse_args() |
200 | 217 | logger.info(_("version passed: %s") % opt.version) | 257 | logger.info(_("version passed: %s") % opt.version) |
201 | 218 | if opt.version: | 258 | if opt.version: |
202 | 219 | hasOptions = True | 259 | hasOptions = True |
204 | 220 | version = commands.getstatusoutput("dpkg -l testdrive-cli | tail -n1 | awk '{print $3}'") | 260 | version = commands.getstatusoutput( |
205 | 261 | "dpkg -l testdrive-cli | tail -n1 | awk '{print $3}'") | ||
206 | 221 | logger.info(_("testdrive %s") % version[1]) | 262 | logger.info(_("testdrive %s") % version[1]) |
208 | 222 | #TODO: Why is get_virt() here? Disable until is determined if we really need it or not. If yes, we'll have to add same code as below, | 263 | #TODO: Why is get_virt() here? Disable until is determined if we really |
209 | 264 | # need it or not. If yes, we'll have to add same code as below, | ||
210 | 223 | # for same function | 265 | # for same function |
211 | 224 | td.get_virt() | 266 | td.get_virt() |
212 | 225 | sys.exit(0) | 267 | sys.exit(0) |
213 | @@ -229,8 +271,9 @@ | |||
214 | 229 | ############################## | 271 | ############################## |
215 | 230 | 272 | ||
216 | 231 | # prime configuration with defaults | 273 | # prime configuration with defaults |
219 | 232 | config_files = ["/etc/%s" % td.PKGRC, "%s/.%s" % (td.HOME, td.PKGRC), "%s/.config/%s/%s" % (td.HOME, td.PKG, td.PKGRC) ] | 274 | config_files = ["/etc/%s" % td.PKGRC, "%s/.%s" % (td.HOME, td.PKGRC), |
220 | 233 | logger.info(_("config passed: %s") %opt.config) | 275 | "%s/.config/%s/%s" % (td.HOME, td.PKG, td.PKGRC)] |
221 | 276 | logger.info(_("config passed: %s") % opt.config) | ||
222 | 234 | if opt.config: | 277 | if opt.config: |
223 | 235 | hasOptions = True | 278 | hasOptions = True |
224 | 236 | if opt.config[0] != '/': | 279 | if opt.config[0] != '/': |
225 | @@ -257,21 +300,23 @@ | |||
226 | 257 | error(_("Your CPU supports KVM acceleration; please install KVM:\n\ | 300 | error(_("Your CPU supports KVM acceleration; please install KVM:\n\ |
227 | 258 | sudo apt-get install qemu-kvm")) | 301 | sudo apt-get install qemu-kvm")) |
228 | 259 | elif td.VIRT == 0: | 302 | elif td.VIRT == 0: |
230 | 260 | error(_("Your CPU does not support acceleration; run kvm-ok for more information; then please install VirtualBox:\n\ | 303 | error(_("Your CPU does not support acceleration; run kvm-ok for more " |
231 | 304 | "information; then please install VirtualBox:\n\ | ||
232 | 261 | kvm-ok\n\ | 305 | kvm-ok\n\ |
233 | 262 | sudo apt-get install virtualbox")) | 306 | sudo apt-get install virtualbox")) |
234 | 263 | elif td.VIRT == "kvm": | 307 | elif td.VIRT == "kvm": |
236 | 264 | logger.info(_("Using KVM for virtual machine hosting...")); | 308 | logger.info(_("Using KVM for virtual machine hosting.")) |
237 | 265 | elif td.VIRT == "virtualbox": | 309 | elif td.VIRT == "virtualbox": |
239 | 266 | logger.info(_("Using VirtualBox for virtual machine hosting...")) | 310 | logger.info(_("Using VirtualBox for virtual machine hosting.")) |
240 | 267 | elif td.VIRT == "paralels": | 311 | elif td.VIRT == "paralels": |
242 | 268 | logger.info(_("Using Parallels Desktop for virtual machine hosting...")) | 312 | logger.info(_("Using Parallels Desktop for virtual machine hosting.")) |
243 | 269 | 313 | ||
244 | 270 | ########################################## | 314 | ########################################## |
245 | 271 | ## UI Options needed after config files ## | 315 | ## UI Options needed after config files ## |
246 | 272 | ########################################## | 316 | ########################################## |
247 | 273 | 317 | ||
249 | 274 | # TODO: is_iso function is locally used to see if the url is indeed one or not. Could be used by the front-end | 318 | # TODO: is_iso function is locally used to see if the url is indeed one |
250 | 319 | # or not. Could be used by the front-end | ||
251 | 275 | # Process the rest of the options | 320 | # Process the rest of the options |
252 | 276 | if opt.url: | 321 | if opt.url: |
253 | 277 | hasOptions = True | 322 | hasOptions = True |
254 | @@ -281,7 +326,8 @@ | |||
255 | 281 | td.ISO_URL = "file:///dev/null" | 326 | td.ISO_URL = "file:///dev/null" |
256 | 282 | elif is_cloud_img(opt.url): | 327 | elif is_cloud_img(opt.url): |
257 | 283 | if td.VIRT != 'kvm': | 328 | if td.VIRT != 'kvm': |
259 | 284 | error(_("Launching Cloud images only works with KVM. Please switch your virtualization method...")) | 329 | error(_("Launching Cloud images only works with KVM. Please " |
260 | 330 | "switch your virtualization method...")) | ||
261 | 285 | td.p = 'cloud-daily' | 331 | td.p = 'cloud-daily' |
262 | 286 | if opt.curses: | 332 | if opt.curses: |
263 | 287 | td.KVM_ARGS = td.KVM_ARGS + ' -curses' | 333 | td.KVM_ARGS = td.KVM_ARGS + ' -curses' |
264 | @@ -297,7 +343,7 @@ | |||
265 | 297 | else: | 343 | else: |
266 | 298 | DESKTOP = 0 | 344 | DESKTOP = 0 |
267 | 299 | 345 | ||
269 | 300 | # Hardcoded release codename from executable. Overrides value in config file | 346 | # Hardcoded release codename from executable. Override value in config file |
270 | 301 | if opt.release: | 347 | if opt.release: |
271 | 302 | hasOptions = True | 348 | hasOptions = True |
272 | 303 | td.r = opt.release | 349 | td.r = opt.release |
273 | @@ -323,20 +369,24 @@ | |||
274 | 323 | ## Obtain Release Codename from ISO cache ## | 369 | ## Obtain Release Codename from ISO cache ## |
275 | 324 | ################################################# | 370 | ################################################# |
276 | 325 | 371 | ||
278 | 326 | # Verify if the ISO list is cached, if not, set variable to update/create it. | 372 | # Verify if the ISO list is cached, if not, |
279 | 373 | # set variable to update/create it | ||
280 | 327 | if td.is_iso_list_cached() is False: | 374 | if td.is_iso_list_cached() is False: |
281 | 328 | update_cache = 1 | 375 | update_cache = 1 |
283 | 329 | # If ISO list is cached, verify if it is expired. If it is, set variable to update it. | 376 | # If ISO list is cached, verify if it is expired. |
284 | 377 | # If it is, set variable to update it. | ||
285 | 330 | elif td.is_iso_list_cache_expired() is True: | 378 | elif td.is_iso_list_cache_expired() is True: |
286 | 331 | update_cache = 1 | 379 | update_cache = 1 |
287 | 332 | 380 | ||
289 | 333 | # If variable set to update, obtain the ISO list from the Ubuntu CD Image repository. | 381 | # If variable set to update, obtain the ISO list |
290 | 382 | # from the Ubuntu CD Image repository. | ||
291 | 334 | if update_cache == 1: | 383 | if update_cache == 1: |
292 | 335 | logger.info(_("Obtaining Ubuntu ISO list from %s...") % td.u) | 384 | logger.info(_("Obtaining Ubuntu ISO list from %s...") % td.u) |
293 | 336 | try: | 385 | try: |
294 | 337 | cdimage = td.obtain_ubuntu_iso_list_from_repo() | 386 | cdimage = td.obtain_ubuntu_iso_list_from_repo() |
295 | 338 | except: | 387 | except: |
297 | 339 | error(_("ERROR: Could not obtain the Ubuntu ISO list from %s...") % td.u) | 388 | error(_("ERROR: Could not obtain the Ubuntu ISO list from %s..." |
298 | 389 | ) % td.u) | ||
299 | 340 | # If the ISO List was obtained, update the cache fle | 390 | # If the ISO List was obtained, update the cache fle |
300 | 341 | if cdimage: | 391 | if cdimage: |
301 | 342 | try: | 392 | try: |
302 | @@ -374,12 +424,14 @@ | |||
303 | 374 | if cmd == 1: | 424 | if cmd == 1: |
304 | 375 | error(_("Unsupported protocol [%s]") % td.PROTO) | 425 | error(_("Unsupported protocol [%s]") % td.PROTO) |
305 | 376 | if td.PROTO != 'file' and td.PROTO != 'rsync': | 426 | if td.PROTO != 'file' and td.PROTO != 'rsync': |
307 | 377 | if run("wget --spider -S %s 2>&1 | grep 'HTTP/1.. 200 OK'" % td.ISO_URL) != 0: | 427 | if run("wget --spider -S %s 2>&1 | grep 'HTTP/1.. 200 OK'" |
308 | 428 | % td.ISO_URL) != 0: | ||
309 | 378 | error(_("ISO not found at [%s]") % td.ISO_URL) | 429 | error(_("ISO not found at [%s]") % td.ISO_URL) |
310 | 379 | if cmd != 0: | 430 | if cmd != 0: |
311 | 380 | run_or_die(cmd) | 431 | run_or_die(cmd) |
312 | 381 | if td.p == 'cloud-daily' or td.p == 'cloud-releases': | 432 | if td.p == 'cloud-daily' or td.p == 'cloud-releases': |
314 | 382 | logger.info("Preparing Cloud image [%s]" % os.path.basename(td.PATH_TO_ISO).split("_")[-1]) | 433 | logger.info("Preparing Cloud image [%s]" % os.path.basename( |
315 | 434 | td.PATH_TO_ISO).split("_")[-1]) | ||
316 | 383 | td.prepare_cloud_img_tarball() | 435 | td.prepare_cloud_img_tarball() |
317 | 384 | 436 | ||
318 | 385 | ########################## | 437 | ########################## |
319 | @@ -428,12 +480,15 @@ | |||
320 | 428 | logger.info(_("You may wish to clean up the cache directory...")) | 480 | logger.info(_("You may wish to clean up the cache directory...")) |
321 | 429 | print(_(" %s and %s") % (td.CACHE_ISO, td.CACHE_IMG)) | 481 | print(_(" %s and %s") % (td.CACHE_ISO, td.CACHE_IMG)) |
322 | 430 | #run("ls -HhalF %s %s" % (CACHE_ISO, CACHE_IMG)) | 482 | #run("ls -HhalF %s %s" % (CACHE_ISO, CACHE_IMG)) |
324 | 431 | #run("du -sh --apparent-size %s %s 2>/dev/null || du -sh %s %s" % (CACHE_ISO, CACHE_IMG)) | 483 | #run("du -sh --apparent-size %s %s 2>/dev/null || \ |
325 | 484 | #du -sh %s %s" % (CACHE_ISO, CACHE_IMG)) | ||
326 | 432 | 485 | ||
327 | 433 | # Launch Desktop | 486 | # Launch Desktop |
328 | 434 | if DESKTOP == 1: | 487 | if DESKTOP == 1: |
331 | 435 | if os.path.exists("/usr/bin/usb-creator-gtk") or os.path.exists("/usr/bin/usb-creator-kde"): | 488 | if os.path.exists("/usr/bin/usb-creator-gtk") or \ |
332 | 436 | input = raw_input(_("\nLaunch USB Startup Disk Creator for further testing of this ISO? [y/N] ")) | 489 | os.path.exists("/usr/bin/usb-creator-kde"): |
333 | 490 | input = raw_input(_("\nLaunch USB Startup Disk Creator for " | ||
334 | 491 | "further testing of this ISO? [y/N] ")) | ||
335 | 437 | if input == "y" or input == "Y": | 492 | if input == "y" or input == "Y": |
336 | 438 | td.launch_usb_creator() | 493 | td.launch_usb_creator() |
337 | 439 | else: | 494 | else: |
338 | 440 | 495 | ||
339 | === modified file 'bin/testdrive-gtk' | |||
340 | --- bin/testdrive-gtk 2013-08-10 20:52:38 +0000 | |||
341 | +++ bin/testdrive-gtk 2013-10-06 20:59:44 +0000 | |||
342 | @@ -2,20 +2,20 @@ | |||
343 | 2 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | 2 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
344 | 3 | ### BEGIN LICENSE | 3 | ### BEGIN LICENSE |
345 | 4 | # Copyright (C) 2010 Canonical Ltd. | 4 | # Copyright (C) 2010 Canonical Ltd. |
347 | 5 | # | 5 | # |
348 | 6 | # Authors: | 6 | # Authors: |
349 | 7 | # Andres Rodriguez <andreserl@ubuntu.com> | 7 | # Andres Rodriguez <andreserl@ubuntu.com> |
353 | 8 | # | 8 | # |
354 | 9 | # This program is free software: you can redistribute it and/or modify it | 9 | # This program is free software: you can redistribute it and/or modify it |
355 | 10 | # under the terms of the GNU General Public License version 3, as published | 10 | # under the terms of the GNU General Public License version 3, as published |
356 | 11 | # by the Free Software Foundation. | 11 | # by the Free Software Foundation. |
361 | 12 | # | 12 | # |
362 | 13 | # This program is distributed in the hope that it will be useful, but | 13 | # This program is distributed in the hope that it will be useful, but |
363 | 14 | # WITHOUT ANY WARRANTY; without even the implied warranties of | 14 | # WITHOUT ANY WARRANTY; without even the implied warranties of |
364 | 15 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | 15 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
365 | 16 | # PURPOSE. See the GNU General Public License for more details. | 16 | # PURPOSE. See the GNU General Public License for more details. |
368 | 17 | # | 17 | # |
369 | 18 | # You should have received a copy of the GNU General Public License along | 18 | # You should have received a copy of the GNU General Public License along |
370 | 19 | # with this program. If not, see <http://www.gnu.org/licenses/>. | 19 | # with this program. If not, see <http://www.gnu.org/licenses/>. |
371 | 20 | ### END LICENSE | 20 | ### END LICENSE |
372 | 21 | 21 | ||
373 | @@ -25,28 +25,30 @@ | |||
374 | 25 | import time | 25 | import time |
375 | 26 | 26 | ||
376 | 27 | import gettext | 27 | import gettext |
378 | 28 | from gettext import gettext as _ | 28 | _ = gettext.gettext |
379 | 29 | gettext.textdomain('testdrive') | 29 | gettext.textdomain('testdrive') |
380 | 30 | 30 | ||
381 | 31 | from testdrive import testdrive | 31 | from testdrive import testdrive |
382 | 32 | from testdrive.virt import kvm, parallels, virtualbox | 32 | from testdrive.virt import kvm, parallels, virtualbox |
385 | 33 | import threading, subprocess, commands | 33 | import threading |
386 | 34 | import random | 34 | import subprocess |
387 | 35 | import commands | ||
388 | 36 | #import random | ||
389 | 35 | import re | 37 | import re |
390 | 36 | 38 | ||
391 | 37 | gtk.gdk.threads_init() | 39 | gtk.gdk.threads_init() |
392 | 38 | 40 | ||
393 | 39 | TAB_LABEL = [] | 41 | TAB_LABEL = [] |
404 | 40 | TAB_LABEL.append({"dist":"ubuntu", "label":"Ubuntu"}) | 42 | TAB_LABEL.append({"dist": "ubuntu", "label": "Ubuntu"}) |
405 | 41 | TAB_LABEL.append({"dist":"kubuntu", "label":"Kubuntu"}) | 43 | TAB_LABEL.append({"dist": "kubuntu", "label": "Kubuntu"}) |
406 | 42 | TAB_LABEL.append({"dist":"xubuntu", "label":"Xubuntu"}) | 44 | TAB_LABEL.append({"dist": "xubuntu", "label": "Xubuntu"}) |
407 | 43 | TAB_LABEL.append({"dist":"ubuntu-server", "label":"Server"}) | 45 | TAB_LABEL.append({"dist": "ubuntu-server", "label": "Server"}) |
408 | 44 | TAB_LABEL.append({"dist":"edubuntu", "label":"Edubuntu"}) | 46 | TAB_LABEL.append({"dist": "edubuntu", "label": "Edubuntu"}) |
409 | 45 | TAB_LABEL.append({"dist":"mythbuntu", "label":"Mythbuntu"}) | 47 | TAB_LABEL.append({"dist": "mythbuntu", "label": "Mythbuntu"}) |
410 | 46 | TAB_LABEL.append({"dist":"ubuntustudio", "label":"Ubuntu Studio"}) | 48 | TAB_LABEL.append({"dist": "ubuntustudio", "label": "Ubuntu Studio"}) |
411 | 47 | TAB_LABEL.append({"dist":"lubuntu", "label":"Lubuntu"}) | 49 | TAB_LABEL.append({"dist": "lubuntu", "label": "Lubuntu"}) |
412 | 48 | TAB_LABEL.append({"dist":"ubuntukylin", "label":"UbuntuKylin"}) | 50 | TAB_LABEL.append({"dist": "ubuntukylin", "label": "UbuntuKylin"}) |
413 | 49 | TAB_LABEL.append({"dist":"other", "label":_("Other")}) | 51 | TAB_LABEL.append({"dist": "other", "label": _("Other")}) |
414 | 50 | 52 | ||
415 | 51 | global ISOLIST | 53 | global ISOLIST |
416 | 52 | 54 | ||
417 | @@ -57,9 +59,9 @@ | |||
418 | 57 | os.path.dirname(os.path.dirname(os.path.realpath(sys.argv[0])))) | 59 | os.path.dirname(os.path.dirname(os.path.realpath(sys.argv[0])))) |
419 | 58 | 60 | ||
420 | 59 | if (os.path.exists(os.path.join(PROJECT_ROOT_DIRECTORY, 'testdrivegtk')) | 61 | if (os.path.exists(os.path.join(PROJECT_ROOT_DIRECTORY, 'testdrivegtk')) |
422 | 60 | and PROJECT_ROOT_DIRECTORY not in sys.path): | 62 | and PROJECT_ROOT_DIRECTORY not in sys.path): |
423 | 61 | sys.path.insert(0, PROJECT_ROOT_DIRECTORY) | 63 | sys.path.insert(0, PROJECT_ROOT_DIRECTORY) |
425 | 62 | os.putenv('PYTHONPATH', PROJECT_ROOT_DIRECTORY) # for subprocesses | 64 | os.putenv('PYTHONPATH', PROJECT_ROOT_DIRECTORY) # for subprocesses |
426 | 63 | 65 | ||
427 | 64 | try: | 66 | try: |
428 | 65 | import pynotify | 67 | import pynotify |
429 | @@ -70,7 +72,8 @@ | |||
430 | 70 | notifications_available = False | 72 | notifications_available = False |
431 | 71 | 73 | ||
432 | 72 | from testdrivegtk import ( | 74 | from testdrivegtk import ( |
434 | 73 | AboutTestdrivegtkDialog, PreferencesTestdrivegtkDialog, AddOtherTestdrivegtkDialog) | 75 | AboutTestdrivegtkDialog, PreferencesTestdrivegtkDialog, |
435 | 76 | AddOtherTestdrivegtkDialog) | ||
436 | 74 | from testdrivegtk.helpers import get_builder | 77 | from testdrivegtk.helpers import get_builder |
437 | 75 | 78 | ||
438 | 76 | try: | 79 | try: |
439 | @@ -93,7 +96,7 @@ | |||
440 | 93 | class TestdrivegtkWindow(gtk.Window): | 96 | class TestdrivegtkWindow(gtk.Window): |
441 | 94 | __gtype_name__ = "TestdrivegtkWindow" | 97 | __gtype_name__ = "TestdrivegtkWindow" |
442 | 95 | 98 | ||
444 | 96 | # To construct a new instance of this method, the following notable | 99 | # To construct a new instance of this method, the following notable |
445 | 97 | # methods are called in this order: | 100 | # methods are called in this order: |
446 | 98 | # __new__(cls) | 101 | # __new__(cls) |
447 | 99 | # __init__(self) | 102 | # __init__(self) |
448 | @@ -104,7 +107,7 @@ | |||
449 | 104 | # your inialization code in finish_intializing | 107 | # your inialization code in finish_intializing |
450 | 105 | 108 | ||
451 | 106 | def __new__(cls): | 109 | def __new__(cls): |
453 | 107 | """Special static method that's automatically called by Python when | 110 | """Special static method that's automatically called by Python when |
454 | 108 | constructing a new instance of this class. | 111 | constructing a new instance of this class. |
455 | 109 | 112 | ||
456 | 110 | Returns a fully instantiated TestdrivegtkWindow object. | 113 | Returns a fully instantiated TestdrivegtkWindow object. |
457 | @@ -166,8 +169,10 @@ | |||
458 | 166 | self.application_indicator_menu() | 169 | self.application_indicator_menu() |
459 | 167 | 170 | ||
460 | 168 | def application_indicator_menu(self): | 171 | def application_indicator_menu(self): |
463 | 169 | self.appindicator = appindicator.Indicator ("testdrive", "indicator-messages", appindicator.CATEGORY_APPLICATION_STATUS) | 172 | self.appindicator = appindicator.Indicator( |
464 | 170 | self.appindicator.set_status (appindicator.STATUS_PASSIVE) | 173 | "testdrive", "indicator-messages", |
465 | 174 | appindicator.CATEGORY_APPLICATION_STATUS) | ||
466 | 175 | self.appindicator.set_status(appindicator.STATUS_PASSIVE) | ||
467 | 171 | #self.appindicator.set_icon("testdrive-indicator") | 176 | #self.appindicator.set_icon("testdrive-indicator") |
468 | 172 | self.appindicator.set_icon("testdrive-attention") | 177 | self.appindicator.set_icon("testdrive-attention") |
469 | 173 | #self.appindicator.set_attention_icon("distributor-logo") | 178 | #self.appindicator.set_attention_icon("distributor-logo") |
470 | @@ -175,7 +180,8 @@ | |||
471 | 175 | # create a menu | 180 | # create a menu |
472 | 176 | self.app_indicator_menu = gtk.Menu() | 181 | self.app_indicator_menu = gtk.Menu() |
473 | 177 | 182 | ||
475 | 178 | # create items for the menu - labels, checkboxes, radio buttons and images are supported: | 183 | # create items for the menu - labels, checkboxes, |
476 | 184 | # radio buttons and images are supported: | ||
477 | 179 | item = gtk.MenuItem("Pre-release available for testing!") | 185 | item = gtk.MenuItem("Pre-release available for testing!") |
478 | 180 | item.connect("activate", self.on_indicator_message_clicked, item) | 186 | item.connect("activate", self.on_indicator_message_clicked, item) |
479 | 181 | item.show() | 187 | item.show() |
480 | @@ -189,8 +195,10 @@ | |||
481 | 189 | self.app_indicator_menu.show() | 195 | self.app_indicator_menu.show() |
482 | 190 | self.appindicator.set_menu(self.app_indicator_menu) | 196 | self.appindicator.set_menu(self.app_indicator_menu) |
483 | 191 | 197 | ||
486 | 192 | gobject.timeout_add_seconds(self.timea, self.on_check_qa_releases_available, self.timea) | 198 | gobject.timeout_add_seconds( |
487 | 193 | gobject.timeout_add_seconds(self.timeb, self.on_check_qa_releases_available, self.timeb) | 199 | self.timea, self.on_check_qa_releases_available, self.timea) |
488 | 200 | gobject.timeout_add_seconds( | ||
489 | 201 | self.timeb, self.on_check_qa_releases_available, self.timeb) | ||
490 | 194 | 202 | ||
491 | 195 | # Initializes the indicator | 203 | # Initializes the indicator |
492 | 196 | def messaging_indicator_menu(self): | 204 | def messaging_indicator_menu(self): |
493 | @@ -204,25 +212,34 @@ | |||
494 | 204 | 212 | ||
495 | 205 | # Initializes the Indicator | 213 | # Initializes the Indicator |
496 | 206 | self.indicator = indicate.Indicator() | 214 | self.indicator = indicate.Indicator() |
498 | 207 | self.indicator.set_property("name", "Pre-release available for testing!") | 215 | self.indicator.set_property( |
499 | 216 | "name", "Pre-release available for testing!") | ||
500 | 208 | self.indicator.set_property_time("time", time.time()) | 217 | self.indicator.set_property_time("time", time.time()) |
501 | 209 | #indicator.show() | 218 | #indicator.show() |
502 | 210 | 219 | ||
504 | 211 | self.indicator.connect("user-display", self.on_indicator_message_clicked) | 220 | self.indicator.connect( |
505 | 221 | "user-display", self.on_indicator_message_clicked) | ||
506 | 212 | 222 | ||
507 | 213 | # Checks every 3600 seconds - hour - (If TestDrive is open that long) | 223 | # Checks every 3600 seconds - hour - (If TestDrive is open that long) |
510 | 214 | gobject.timeout_add_seconds(self.timea, self.on_check_qa_releases_available, self.timea) | 224 | gobject.timeout_add_seconds( |
511 | 215 | gobject.timeout_add_seconds(self.timeb, self.on_check_qa_releases_available, self.timeb) | 225 | self.timea, self.on_check_qa_releases_available, self.timea) |
512 | 226 | gobject.timeout_add_seconds( | ||
513 | 227 | self.timeb, self.on_check_qa_releases_available, self.timeb) | ||
514 | 216 | 228 | ||
516 | 217 | # Checks for the availability of ISOs at iso.qa.ubuntu.com and displays notification if so. | 229 | # Checks for the availability of ISOs at iso.qa.ubuntu.com |
517 | 230 | # and displays notification if so. | ||
518 | 218 | def on_check_qa_releases_available(self, time): | 231 | def on_check_qa_releases_available(self, time): |
519 | 219 | output = "" | 232 | output = "" |
520 | 220 | if self.notified is True: | 233 | if self.notified is True: |
521 | 221 | return False | 234 | return False |
523 | 222 | logging.info(_("Checking available ISOs at the ISO tracker [http://iso.qa.ubuntu.com] every %s seconds") % time) | 235 | logging.info(_("Checking available ISOs at the ISO tracker " |
524 | 236 | "[http://iso.qa.ubuntu.com] every %s seconds") % time) | ||
525 | 223 | try: | 237 | try: |
528 | 224 | #(status, output) = commands.getstatusoutput("wget -q -O- http://iso.qa.ubuntu.com/qatracker/dllist") | 238 | #(status, output) = commands.getstatusoutput( |
529 | 225 | (status, output) = commands.getstatusoutput("wget -q -O- http://iso.qa.ubuntu.com/qatracker | egrep 'iso.qa.ubuntu.com/qatracker/test'") | 239 | # "wget -q -O- http://iso.qa.ubuntu.com/qatracker/dllist") |
530 | 240 | (status, output) = commands.getstatusoutput( | ||
531 | 241 | "wget -q -O- http://iso.qa.ubuntu.com/qatracker | egrep " | ||
532 | 242 | "'iso.qa.ubuntu.com/qatracker/test'") | ||
533 | 226 | except: | 243 | except: |
534 | 227 | logging.error(_("Unable to check the ISO tracker")) | 244 | logging.error(_("Unable to check the ISO tracker")) |
535 | 228 | 245 | ||
536 | @@ -231,7 +248,9 @@ | |||
537 | 231 | global notifications_available | 248 | global notifications_available |
538 | 232 | if notifications_available: | 249 | if notifications_available: |
539 | 233 | # Notification | 250 | # Notification |
541 | 234 | self.notification = pynotify.Notification("TestDrive an Ubuntu ISO!", "Pre-release available for testing!", imageURI) | 251 | self.notification = pynotify.Notification( |
542 | 252 | "TestDrive an Ubuntu ISO!", | ||
543 | 253 | "Pre-release available for testing!", imageURI) | ||
544 | 235 | self.notification.show() | 254 | self.notification.show() |
545 | 236 | global message_indicator | 255 | global message_indicator |
546 | 237 | if message_indicator: | 256 | if message_indicator: |
547 | @@ -248,7 +267,8 @@ | |||
548 | 248 | 267 | ||
549 | 249 | return True | 268 | return True |
550 | 250 | 269 | ||
552 | 251 | # Click event for Indicator: Opens website when the notification is being clicked. | 270 | # Click event for Indicator: |
553 | 271 | # Opens website when the notification is being clicked. | ||
554 | 252 | def on_indicator_message_clicked(self, indicator, timestamp): | 272 | def on_indicator_message_clicked(self, indicator, timestamp): |
555 | 253 | webbrowser.open("http://iso.qa.ubuntu.com/") | 273 | webbrowser.open("http://iso.qa.ubuntu.com/") |
556 | 254 | if message_indicator: | 274 | if message_indicator: |
557 | @@ -287,8 +307,10 @@ | |||
558 | 287 | 307 | ||
559 | 288 | # Obtain preferences | 308 | # Obtain preferences |
560 | 289 | td = prefs.get_preferences() | 309 | td = prefs.get_preferences() |
563 | 290 | # If Repo (p), Release, Arch (m), Flavor, or ISO CACHE are different, then, regenerate the UI | 310 | # If Repo (p), Release, Arch (m), Flavor, or ISO CACHE are |
564 | 291 | if self.td.p != td.p or self.td.r != td.r or self.td.m != td.m or self.td.f != td.f or self.td.CACHE_ISO != td.CACHE_ISO: | 311 | # different, then, regenerate the UI |
565 | 312 | if self.td.p != td.p or self.td.r != td.r or self.td.m != td.m or \ | ||
566 | 313 | self.td.f != td.f or self.td.CACHE_ISO != td.CACHE_ISO: | ||
567 | 292 | ui_recreate = True | 314 | ui_recreate = True |
568 | 293 | # Update preferences | 315 | # Update preferences |
569 | 294 | self.td = td | 316 | self.td = td |
570 | @@ -302,7 +324,8 @@ | |||
571 | 302 | 324 | ||
572 | 303 | def new_other_iso(self, widget, data=None): | 325 | def new_other_iso(self, widget, data=None): |
573 | 304 | """Display Add Other ISO dialog""" | 326 | """Display Add Other ISO dialog""" |
575 | 305 | other = AddOtherTestdrivegtkDialog.AddOtherTestdrivegtkDialog(self.td.CACHE) | 327 | other = AddOtherTestdrivegtkDialog.AddOtherTestdrivegtkDialog( |
576 | 328 | self.td.CACHE) | ||
577 | 306 | other.set_title(_("Add an ISO to TestDrive")) | 329 | other.set_title(_("Add an ISO to TestDrive")) |
578 | 307 | response = other.run() | 330 | response = other.run() |
579 | 308 | if response == gtk.RESPONSE_OK: | 331 | if response == gtk.RESPONSE_OK: |
580 | @@ -319,9 +342,10 @@ | |||
581 | 319 | ################################################################### | 342 | ################################################################### |
582 | 320 | 343 | ||
583 | 321 | if commands.getstatusoutput("which testdrive")[0] != 0: | 344 | if commands.getstatusoutput("which testdrive")[0] != 0: |
587 | 322 | self.on_error_dialog( _("Unable to open because 'testdrive' is not installed.\n" | 345 | self.on_error_dialog(_("Unable to open because 'testdrive' " |
588 | 323 | "Please install testdrive: \n\n" | 346 | "is not installed.\n" |
589 | 324 | "sudo apt-get install testdrive-cli")) | 347 | "Please install testdrive: \n\n" |
590 | 348 | "sudo apt-get install testdrive-cli")) | ||
591 | 325 | return | 349 | return |
592 | 326 | title = _("TestDrive an ISO or Disk Image") | 350 | title = _("TestDrive an ISO or Disk Image") |
593 | 327 | filename = None | 351 | filename = None |
594 | @@ -329,15 +353,19 @@ | |||
595 | 329 | testdrives.add_pattern("*.iso") | 353 | testdrives.add_pattern("*.iso") |
596 | 330 | testdrives.add_pattern("*.img") | 354 | testdrives.add_pattern("*.img") |
597 | 331 | 355 | ||
600 | 332 | chooser = gtk.FileChooserDialog(title,action=gtk.FILE_CHOOSER_ACTION_SAVE, | 356 | chooser = gtk.FileChooserDialog( |
601 | 333 | buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN,gtk.RESPONSE_OK)) | 357 | title, action=gtk.FILE_CHOOSER_ACTION_SAVE, |
602 | 358 | buttons=( | ||
603 | 359 | gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, | ||
604 | 360 | gtk.STOCK_OPEN, gtk.RESPONSE_OK)) | ||
605 | 334 | chooser.add_filter(testdrives) | 361 | chooser.add_filter(testdrives) |
606 | 335 | # Run Chooser Dialog | 362 | # Run Chooser Dialog |
607 | 336 | response = chooser.run() | 363 | response = chooser.run() |
608 | 337 | 364 | ||
609 | 338 | if response == gtk.RESPONSE_OK: | 365 | if response == gtk.RESPONSE_OK: |
610 | 339 | filename = chooser.get_filename() | 366 | filename = chooser.get_filename() |
612 | 340 | subprocess.Popen(['testdrive', '-u', filename], stdout=subprocess.PIPE) | 367 | subprocess.Popen([ |
613 | 368 | 'testdrive', '-u', filename], stdout=subprocess.PIPE) | ||
614 | 341 | pass | 369 | pass |
615 | 342 | chooser.destroy() | 370 | chooser.destroy() |
616 | 343 | 371 | ||
617 | @@ -350,31 +378,31 @@ | |||
618 | 350 | # Clean up code for saving application state should be added here. | 378 | # Clean up code for saving application state should be added here. |
619 | 351 | # Stop all the syncs and launched ISOs | 379 | # Stop all the syncs and launched ISOs |
620 | 352 | for t in self.isos_to_run: | 380 | for t in self.isos_to_run: |
622 | 353 | if t[0] != None: | 381 | if t[0] is not None: |
623 | 354 | t[0].stop() | 382 | t[0].stop() |
625 | 355 | if t[1] != None: | 383 | if t[1] is not None: |
626 | 356 | t[1].stop() | 384 | t[1].stop() |
627 | 357 | # Class function to cleanup the IMG Cache | 385 | # Class function to cleanup the IMG Cache |
628 | 358 | self.cleanup_img_cache() | 386 | self.cleanup_img_cache() |
629 | 359 | gtk.main_quit() | 387 | gtk.main_quit() |
630 | 360 | 388 | ||
631 | 361 | def on_warn_dialog(self, data=None): | 389 | def on_warn_dialog(self, data=None): |
634 | 362 | warnbox = gtk.MessageDialog(self, | 390 | warnbox = gtk.MessageDialog( |
635 | 363 | gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_WARNING, | 391 | self, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_WARNING, |
636 | 364 | gtk.BUTTONS_CLOSE, data) | 392 | gtk.BUTTONS_CLOSE, data) |
637 | 365 | warnbox.run() | 393 | warnbox.run() |
638 | 366 | warnbox.destroy() | 394 | warnbox.destroy() |
639 | 367 | 395 | ||
640 | 368 | def on_error_dialog(self, data=None): | 396 | def on_error_dialog(self, data=None): |
643 | 369 | errorbox = gtk.MessageDialog(self, | 397 | errorbox = gtk.MessageDialog( |
644 | 370 | gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_ERROR, | 398 | self, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_ERROR, |
645 | 371 | gtk.BUTTONS_CLOSE, data) | 399 | gtk.BUTTONS_CLOSE, data) |
646 | 372 | errorbox.run() | 400 | errorbox.run() |
647 | 373 | errorbox.destroy() | 401 | errorbox.destroy() |
648 | 374 | 402 | ||
649 | 375 | def on_info_dialog(self, data=None): | 403 | def on_info_dialog(self, data=None): |
652 | 376 | infobox = gtk.MessageDialog(self, | 404 | infobox = gtk.MessageDialog( |
653 | 377 | gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO, | 405 | self, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO, |
654 | 378 | gtk.BUTTONS_CLOSE, data) | 406 | gtk.BUTTONS_CLOSE, data) |
655 | 379 | infobox.run() | 407 | infobox.run() |
656 | 380 | infobox.destroy() | 408 | infobox.destroy() |
657 | @@ -387,7 +415,8 @@ | |||
658 | 387 | imagelist = os.listdir(self.td.CACHE_IMG) | 415 | imagelist = os.listdir(self.td.CACHE_IMG) |
659 | 388 | for disk in imagelist: | 416 | for disk in imagelist: |
660 | 389 | path = "%s/%s" % (self.td.CACHE_IMG, disk) | 417 | path = "%s/%s" % (self.td.CACHE_IMG, disk) |
662 | 390 | (status, output) = commands.getstatusoutput("file %s | grep -qs 'empty'" % path) | 418 | (status, output) = commands.getstatusoutput( |
663 | 419 | "file %s | grep -qs 'empty'" % path) | ||
664 | 391 | if status == 0: | 420 | if status == 0: |
665 | 392 | os.unlink(path) | 421 | os.unlink(path) |
666 | 393 | for disk in self.isos_to_run: | 422 | for disk in self.isos_to_run: |
667 | @@ -401,7 +430,8 @@ | |||
668 | 401 | logging.info(_("Obtaining the sync protocol for the specified ISO...")) | 430 | logging.info(_("Obtaining the sync protocol for the specified ISO...")) |
669 | 402 | cmd = self.td.get_proto() | 431 | cmd = self.td.get_proto() |
670 | 403 | if cmd == 1: | 432 | if cmd == 1: |
672 | 404 | self.on_error_dialog(_("Unsupported protocol [%s]") % self.td.PROTO) | 433 | self.on_error_dialog(_( |
673 | 434 | "Unsupported protocol [%s]") % self.td.PROTO) | ||
674 | 405 | if cmd != 0: | 435 | if cmd != 0: |
675 | 406 | return cmd | 436 | return cmd |
676 | 407 | return False | 437 | return False |
677 | @@ -416,18 +446,22 @@ | |||
678 | 416 | if not self.td.VIRT: | 446 | if not self.td.VIRT: |
679 | 417 | self.td.VIRT = self.td.get_virt() | 447 | self.td.VIRT = self.td.get_virt() |
680 | 418 | if self.td.VIRT == 1: | 448 | if self.td.VIRT == 1: |
685 | 419 | logging.error(_("Your CPU supports KVM acceleration; please install KVM")) | 449 | logging.error(_("Your CPU supports KVM acceleration; " |
686 | 420 | self.on_warn_dialog( _("Your CPU supports KVM acceleration; please install KVM:" | 450 | "please install KVM")) |
687 | 421 | "\n\n" | 451 | self.on_warn_dialog(_("Your CPU supports KVM acceleration; " |
688 | 422 | "sudo apt-get install qemu-kvm")) | 452 | "please install KVM:" |
689 | 453 | "\n\n" | ||
690 | 454 | "sudo apt-get install qemu-kvm")) | ||
691 | 423 | if self.td.VIRT == 0: | 455 | if self.td.VIRT == 0: |
699 | 424 | logging.error(_("Your CPU does not support acceleration; run kvm-ok for more information; then install VBox")) | 456 | logging.error(_("Your CPU does not support acceleration; " |
700 | 425 | self.on_warn_dialog( _("Your CPU does not support acceleration; run kvm-ok for more information;\n" | 457 | "run kvm-ok for more information; then install VBox")) |
701 | 426 | "then please install VirtualBox" | 458 | self.on_warn_dialog(_("Your CPU does not support acceleration; " |
702 | 427 | "\n\n" | 459 | "run kvm-ok for more information;\n" |
703 | 428 | "kvm-ok" | 460 | "then please install VirtualBox" |
704 | 429 | "\n" | 461 | "\n\n" |
705 | 430 | "sudo apt-get install virtualbox")) | 462 | "kvm-ok" |
706 | 463 | "\n" | ||
707 | 464 | "sudo apt-get install virtualbox")) | ||
708 | 431 | 465 | ||
709 | 432 | def obtain_isos_list(self): | 466 | def obtain_isos_list(self): |
710 | 433 | ################################################################### | 467 | ################################################################### |
711 | @@ -439,8 +473,10 @@ | |||
712 | 439 | try: | 473 | try: |
713 | 440 | isos = self.td.get_ubuntu_iso_list() | 474 | isos = self.td.get_ubuntu_iso_list() |
714 | 441 | except: | 475 | except: |
717 | 442 | logging.error(_("Unable to retrieve the Ubuntu ISO list from cache...")) | 476 | logging.error(_( |
718 | 443 | self.on_error_dialog(_("Unable to retrieve the Ubuntu ISO list from cache...")) | 477 | "Unable to retrieve the Ubuntu ISO list from cache...")) |
719 | 478 | self.on_error_dialog(_( | ||
720 | 479 | "Unable to retrieve the Ubuntu ISO list from cache...")) | ||
721 | 444 | return [] | 480 | return [] |
722 | 445 | return isos | 481 | return isos |
723 | 446 | 482 | ||
724 | @@ -461,12 +497,14 @@ | |||
725 | 461 | # Processing ISOS from file into ISO list | 497 | # Processing ISOS from file into ISO list |
726 | 462 | for iso in ISOS: | 498 | for iso in ISOS: |
727 | 463 | category = iso.split()[0] | 499 | category = iso.split()[0] |
729 | 464 | distro = iso.split()[1] #This will be the distro showed instead of arch | 500 | #This will be the distro showed instead of arch |
730 | 501 | distro = iso.split()[1] | ||
731 | 465 | url = iso.split()[2] | 502 | url = iso.split()[2] |
732 | 466 | if url.partition("://")[0] == "wget": | 503 | if url.partition("://")[0] == "wget": |
733 | 467 | url = url.replace('wget', 'http') | 504 | url = url.replace('wget', 'http') |
734 | 468 | name = iso.split()[3] | 505 | name = iso.split()[3] |
736 | 469 | ISO.append({"name":name, "url":url, "arch":distro, "category":category}) | 506 | ISO.append({"name": name, "url": url, |
737 | 507 | "arch": distro, "category": category}) | ||
738 | 470 | return ISO | 508 | return ISO |
739 | 471 | 509 | ||
740 | 472 | def on_distro_tab_change(self, widget, none=None, current_page=None): | 510 | def on_distro_tab_change(self, widget, none=None, current_page=None): |
741 | @@ -491,7 +529,7 @@ | |||
742 | 491 | self.create_iso_menu(ISO) | 529 | self.create_iso_menu(ISO) |
743 | 492 | self.update_status_bar() | 530 | self.update_status_bar() |
744 | 493 | 531 | ||
746 | 494 | def create_iso_menu(self, iso_list = None): | 532 | def create_iso_menu(self, iso_list=None): |
747 | 495 | ################################################################### | 533 | ################################################################### |
748 | 496 | ############ Creates all the Distro Tabs and the ISO's ############ | 534 | ############ Creates all the Distro Tabs and the ISO's ############ |
749 | 497 | ################################################################### | 535 | ################################################################### |
750 | @@ -542,7 +580,7 @@ | |||
751 | 542 | vbox = gtk.VBox() | 580 | vbox = gtk.VBox() |
752 | 543 | scroll.add_with_viewport(vbox) | 581 | scroll.add_with_viewport(vbox) |
753 | 544 | scroll.get_children()[0].set_shadow_type(gtk.SHADOW_NONE) | 582 | scroll.get_children()[0].set_shadow_type(gtk.SHADOW_NONE) |
755 | 545 | scroll.set_policy(gtk.POLICY_NEVER,gtk.POLICY_AUTOMATIC) | 583 | scroll.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) |
756 | 546 | scroll.show() | 584 | scroll.show() |
757 | 547 | for arch in self.td.m: | 585 | for arch in self.td.m: |
758 | 548 | c = 0 | 586 | c = 0 |
759 | @@ -555,30 +593,45 @@ | |||
760 | 555 | if iso['category'] == dist and iso['arch'] == arch: | 593 | if iso['category'] == dist and iso['arch'] == arch: |
761 | 556 | c = c + 1 | 594 | c = c + 1 |
762 | 557 | table = gtk.Table(2, 3, False) | 595 | table = gtk.Table(2, 3, False) |
764 | 558 | lb_iso_name = gtk.CheckButton("%s - (%s)" % (iso["name"], self.td.r)) | 596 | lb_iso_name = gtk.CheckButton("%s - (%s)" % ( |
765 | 597 | iso["name"], self.td.r)) | ||
766 | 559 | lb_iso_name.show() | 598 | lb_iso_name.show() |
767 | 560 | filename = os.path.basename(iso["url"]) | 599 | filename = os.path.basename(iso["url"]) |
769 | 561 | path = "%s/%s_%s" % (self.td.CACHE_ISO, iso["category"], filename) | 600 | path = "%s/%s_%s" % (self.td.CACHE_ISO, |
770 | 601 | iso["category"], filename) | ||
771 | 562 | if os.path.exists(path): | 602 | if os.path.exists(path): |
773 | 563 | lb_cache = gtk.Label(_("<i> CACHE: [%s]</i>") % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(os.path.getmtime(path))))) | 603 | lb_cache = gtk.Label(_( |
774 | 604 | "<i> CACHE: [%s]</i>") % (time.strftime( | ||
775 | 605 | "%Y-%m-%d %H:%M:%S", time.localtime( | ||
776 | 606 | os.path.getmtime(path))))) | ||
777 | 564 | else: | 607 | else: |
779 | 565 | lb_cache = gtk.Label(_("<i> CACHE: [empty]</i>")) | 608 | lb_cache = gtk.Label(_( |
780 | 609 | "<i> CACHE: [empty]</i>")) | ||
781 | 566 | lb_cache.set_use_markup(True) | 610 | lb_cache.set_use_markup(True) |
782 | 567 | # To align to righ otherwise it is centered | 611 | # To align to righ otherwise it is centered |
784 | 568 | lb_cache.set_alignment(0,0) | 612 | lb_cache.set_alignment(0, 0) |
785 | 569 | lb_cache.show() | 613 | lb_cache.show() |
786 | 570 | # Adding the Spiiner | 614 | # Adding the Spiiner |
787 | 571 | spin = gtk.Spinner() | 615 | spin = gtk.Spinner() |
789 | 572 | spin.set_size_request(18, -1); | 616 | spin.set_size_request(18, -1) |
790 | 573 | spin.hide() | 617 | spin.hide() |
794 | 574 | #lb_iso_name.connect("clicked", self.on_select_iso_clicked, spin, lb_cache, iso["url"], iso["category"], vm_id) | 618 | #lb_iso_name.connect( |
795 | 575 | lb_iso_name.connect("clicked", self.on_select_iso_clicked, vm_id) | 619 | # "clicked", self.on_select_iso_clicked, spin, |
796 | 576 | ISOLIST.append({"vm_id":vm_id, "url":iso["url"], "prefix":iso["category"], "spinner":spin, "lb_status":lb_cache}) | 620 | # lb_cache, iso["url"], iso["category"], vm_id) |
797 | 621 | lb_iso_name.connect( | ||
798 | 622 | "clicked", self.on_select_iso_clicked, vm_id) | ||
799 | 623 | ISOLIST.append({"vm_id": vm_id, "url": iso["url"], | ||
800 | 624 | "prefix": iso["category"], "spinner": | ||
801 | 625 | spin, "lb_status": lb_cache}) | ||
802 | 577 | vm_id += 1 | 626 | vm_id += 1 |
807 | 578 | table.attach(lb_iso_name, 0, 3, 0, 1, gtk.FILL | gtk.EXPAND, gtk.FILL | gtk.EXPAND) | 627 | table.attach(lb_iso_name, 0, 3, 0, 1, gtk.FILL | |
808 | 579 | table.attach(spin, 0, 1, 1, 2, gtk.FILL, gtk.FILL | gtk.EXPAND) | 628 | gtk.EXPAND, gtk.FILL | gtk.EXPAND) |
809 | 580 | table.attach(lb_cache, 1, 2, 1, 2, gtk.FILL | gtk.EXPAND, gtk.FILL | gtk.EXPAND, 0, 5) | 629 | table.attach(spin, 0, 1, 1, 2, gtk.FILL, |
810 | 581 | #table.attach(lb_progress, 2, 3, 1, 2, gtk.FILL | gtk.EXPAND, gtk.FILL | gtk.EXPAND) | 630 | gtk.FILL | gtk.EXPAND) |
811 | 631 | table.attach(lb_cache, 1, 2, 1, 2, gtk.FILL | | ||
812 | 632 | gtk.EXPAND, gtk.FILL | gtk.EXPAND, 0, 5) | ||
813 | 633 | #table.attach(lb_progress, 2, 3, 1, 2, gtk.FILL | | ||
814 | 634 | # gtk.EXPAND, gtk.FILL | gtk.EXPAND) | ||
815 | 582 | table.show() | 635 | table.show() |
816 | 583 | viewport = gtk.Viewport() | 636 | viewport = gtk.Viewport() |
817 | 584 | viewport.add(table) | 637 | viewport.add(table) |
818 | @@ -593,27 +646,42 @@ | |||
819 | 593 | lb_iso_name = gtk.CheckButton("%s" % iso["name"]) | 646 | lb_iso_name = gtk.CheckButton("%s" % iso["name"]) |
820 | 594 | lb_iso_name.show() | 647 | lb_iso_name.show() |
821 | 595 | filename = os.path.basename(iso["url"]) | 648 | filename = os.path.basename(iso["url"]) |
823 | 596 | path = "%s/%s_%s" % (self.td.CACHE_ISO, iso["category"], filename) | 649 | path = "%s/%s_%s" % (self.td.CACHE_ISO, |
824 | 650 | iso["category"], filename) | ||
825 | 597 | if os.path.exists(path): | 651 | if os.path.exists(path): |
827 | 598 | lb_cache = gtk.Label(_("<i> CACHE: [%s]</i>") % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(os.path.getmtime(path))))) | 652 | lb_cache = gtk.Label(_("<i> CACHE: [%s]</i>") |
828 | 653 | % (time.strftime("%Y-%m-%d %H" | ||
829 | 654 | ":%M:%S", time.localtime( | ||
830 | 655 | os.path.getmtime(path))))) | ||
831 | 599 | else: | 656 | else: |
833 | 600 | lb_cache = gtk.Label(_("<i> CACHE: [empty]</i>")) | 657 | lb_cache = gtk.Label(_( |
834 | 658 | "<i> CACHE: [empty]</i>")) | ||
835 | 601 | lb_cache.set_use_markup(True) | 659 | lb_cache.set_use_markup(True) |
838 | 602 | # To align to righ otherwise it is centered | 660 | # To align to right otherwise it is centered |
839 | 603 | lb_cache.set_alignment(0,0) | 661 | lb_cache.set_alignment(0, 0) |
840 | 604 | lb_cache.show() | 662 | lb_cache.show() |
841 | 605 | # Adding the Spiiner | 663 | # Adding the Spiiner |
842 | 606 | spin = gtk.Spinner() | 664 | spin = gtk.Spinner() |
844 | 607 | spin.set_size_request(18, -1); | 665 | spin.set_size_request(18, -1) |
845 | 608 | spin.hide() | 666 | spin.hide() |
849 | 609 | #lb_iso_name.connect("clicked", self.on_select_iso_clicked, spin, lb_cache, iso["url"], iso["category"], vm_id) | 667 | #lb_iso_name.connect("clicked", |
850 | 610 | lb_iso_name.connect("clicked", self.on_select_iso_clicked, vm_id) | 668 | # self.on_select_iso_clicked, spin, |
851 | 611 | ISOLIST.append({"vm_id":vm_id, "url":iso["url"], "prefix":iso["category"], "spinner":spin, "lb_status":lb_cache}) | 669 | # lb_cache, iso["url"], |
852 | 670 | # iso["category"], vm_id) | ||
853 | 671 | lb_iso_name.connect("clicked", | ||
854 | 672 | self.on_select_iso_clicked, vm_id) | ||
855 | 673 | ISOLIST.append({"vm_id": vm_id, "url": iso["url"], | ||
856 | 674 | "prefix": iso["category"], "spinner": | ||
857 | 675 | spin, "lb_status": lb_cache}) | ||
858 | 612 | vm_id += 1 | 676 | vm_id += 1 |
863 | 613 | table.attach(lb_iso_name, 0, 3, 0, 1, gtk.FILL | gtk.EXPAND, gtk.FILL | gtk.EXPAND) | 677 | table.attach(lb_iso_name, 0, 3, 0, 1, gtk.FILL | |
864 | 614 | table.attach(spin, 0, 1, 1, 2, gtk.FILL, gtk.FILL | gtk.EXPAND) | 678 | gtk.EXPAND, gtk.FILL | gtk.EXPAND) |
865 | 615 | table.attach(lb_cache, 1, 2, 1, 2, gtk.FILL | gtk.EXPAND, gtk.FILL | gtk.EXPAND, 0, 5) | 679 | table.attach(spin, 0, 1, 1, 2, gtk.FILL, |
866 | 616 | #table.attach(lb_progress, 2, 3, 1, 2, gtk.FILL | gtk.EXPAND, gtk.FILL | gtk.EXPAND) | 680 | gtk.FILL | gtk.EXPAND) |
867 | 681 | table.attach(lb_cache, 1, 2, 1, 2, gtk.FILL | | ||
868 | 682 | gtk.EXPAND, gtk.FILL | gtk.EXPAND, 0, 5) | ||
869 | 683 | #table.attach(lb_progress, 2, 3, 1, 2, gtk.FILL | | ||
870 | 684 | # gtk.EXPAND, gtk.FILL | gtk.EXPAND) | ||
871 | 617 | table.show() | 685 | table.show() |
872 | 618 | viewport = gtk.Viewport() | 686 | viewport = gtk.Viewport() |
873 | 619 | viewport.add(table) | 687 | viewport.add(table) |
874 | @@ -625,10 +693,12 @@ | |||
875 | 625 | if c == 0: | 693 | if c == 0: |
876 | 626 | if dist == 'other': | 694 | if dist == 'other': |
877 | 627 | no_isos_label = gtk.Label() | 695 | no_isos_label = gtk.Label() |
879 | 628 | no_isos_label.set_markup(_("<b><i>There are no Other ISOs yet...</i></b>")) | 696 | no_isos_label.set_markup(_("<b><i>There are no Other " |
880 | 697 | "ISOs yet...</i></b>")) | ||
881 | 629 | else: | 698 | else: |
882 | 630 | no_isos_label = gtk.Label() | 699 | no_isos_label = gtk.Label() |
884 | 631 | no_isos_label.set_markup(_("<b><i>There are no ISOs for this architecture yet...</i></b>")) | 700 | no_isos_label.set_markup(_("<b><i>There are no ISOs " |
885 | 701 | "for this architecture yet...</i></b>")) | ||
886 | 632 | no_isos_label.show() | 702 | no_isos_label.show() |
887 | 633 | vbox2.add(no_isos_label) | 703 | vbox2.add(no_isos_label) |
888 | 634 | 704 | ||
889 | @@ -637,7 +707,8 @@ | |||
890 | 637 | if dist != 'other': | 707 | if dist != 'other': |
891 | 638 | fr_arch.add(vbox2) | 708 | fr_arch.add(vbox2) |
892 | 639 | fr_arch.show() | 709 | fr_arch.show() |
894 | 640 | vbox.pack_start(fr_arch, expand=False, fill=False, padding=0) | 710 | vbox.pack_start( |
895 | 711 | fr_arch, expand=False, fill=False, padding=0) | ||
896 | 641 | vbox.show() | 712 | vbox.show() |
897 | 642 | else: | 713 | else: |
898 | 643 | vbox.pack_start(vbox2, expand=False, fill=False, padding=0) | 714 | vbox.pack_start(vbox2, expand=False, fill=False, padding=0) |
899 | @@ -647,7 +718,8 @@ | |||
900 | 647 | # Create Tabs | 718 | # Create Tabs |
901 | 648 | for lb_iso_name in TAB_LABEL: | 719 | for lb_iso_name in TAB_LABEL: |
902 | 649 | if dist == lb_iso_name["dist"]: | 720 | if dist == lb_iso_name["dist"]: |
904 | 650 | self.notebook.append_page(scroll, gtk.Label(lb_iso_name["label"])) | 721 | self.notebook.append_page( |
905 | 722 | scroll, gtk.Label(lb_iso_name["label"])) | ||
906 | 651 | break | 723 | break |
907 | 652 | self.notebook.show() | 724 | self.notebook.show() |
908 | 653 | 725 | ||
909 | @@ -670,7 +742,8 @@ | |||
910 | 670 | 742 | ||
911 | 671 | # Create Buttons | 743 | # Create Buttons |
912 | 672 | button = gtk.Button(_("Create USB Disk")) | 744 | button = gtk.Button(_("Create USB Disk")) |
914 | 673 | button.connect("clicked", self.on_create_iso_disk_clicked, 'Create Disk') | 745 | button.connect( |
915 | 746 | "clicked", self.on_create_iso_disk_clicked, 'Create Disk') | ||
916 | 674 | button.show() | 747 | button.show() |
917 | 675 | bbox.pack_start(button) | 748 | bbox.pack_start(button) |
918 | 676 | 749 | ||
919 | @@ -687,9 +760,12 @@ | |||
920 | 687 | 760 | ||
921 | 688 | vbox.pack_start(bbox, True, True) | 761 | vbox.pack_start(bbox, True, True) |
922 | 689 | 762 | ||
926 | 690 | #def on_select_iso_clicked(self, widget, spin, status_label, url=None, iso_path_header=None, vm_id=None): | 763 | #def on_select_iso_clicked(self, widget, spin, status_label, |
927 | 691 | #ISOLIST.append({"vm_id":vm_id, "url":iso["url"], "prefix":iso["category"], "spin":spin, "lb_status":lb_cache}) | 764 | #url=None, iso_path_header=None, vm_id=None): |
928 | 692 | #lb_iso_name.connect("clicked", self.on_select_iso_clicked, spin, lb_cache, iso["url"], iso["category"], vm_id) | 765 | #ISOLIST.append({"vm_id":vm_id, "url":iso["url"], |
929 | 766 | #"prefix":iso["category"], "spin":spin, "lb_status":lb_cache}) | ||
930 | 767 | #lb_iso_name.connect("clicked", self.on_select_iso_clicked, | ||
931 | 768 | # spin, lb_cache, iso["url"], iso["category"], vm_id) | ||
932 | 693 | def on_select_iso_clicked(self, widget, vm_id): | 769 | def on_select_iso_clicked(self, widget, vm_id): |
933 | 694 | ################################################################### | 770 | ################################################################### |
934 | 695 | # When ISO is clicked, does the setup to be ready to launch/sync ## | 771 | # When ISO is clicked, does the setup to be ready to launch/sync ## |
935 | @@ -704,7 +780,7 @@ | |||
936 | 704 | #ISOLIST[vm_id]["sync_cmd"] # Sync command used | 780 | #ISOLIST[vm_id]["sync_cmd"] # Sync command used |
937 | 705 | #ISOLIST[vm_id]["vbox_name"] # Name for VBOX/Parallels | 781 | #ISOLIST[vm_id]["vbox_name"] # Name for VBOX/Parallels |
938 | 706 | #ISOLIST[vm_id]["virt"] # Holds the Virt Object | 782 | #ISOLIST[vm_id]["virt"] # Holds the Virt Object |
940 | 707 | #ISOLIST[vm_id]["virt_type"] # Defines the type of virt (kvm, vbox, parallels) | 783 | #ISOLIST[vm_id]["virt_type"] # Defines kvm, vbox, or parallels |
941 | 708 | 784 | ||
942 | 709 | launch_cmd = None | 785 | launch_cmd = None |
943 | 710 | sync_cmd = None | 786 | sync_cmd = None |
944 | @@ -716,14 +792,15 @@ | |||
945 | 716 | self.td.set_launch_path() | 792 | self.td.set_launch_path() |
946 | 717 | 793 | ||
947 | 718 | ISOLIST[vm_id]["path_to_iso"] = self.td.PATH_TO_ISO | 794 | ISOLIST[vm_id]["path_to_iso"] = self.td.PATH_TO_ISO |
949 | 719 | # TODO - This is a workaround to issue of zsync command. See testdrive.py 'cd '%s' && zsync etc etc' | 795 | # TODO - This is a workaround to issue of zsync command. |
950 | 796 | # See testdrive.py 'cd '%s' && zsync etc etc' | ||
951 | 720 | cmd = self.obtain_sync_protocol_cmd() | 797 | cmd = self.obtain_sync_protocol_cmd() |
952 | 721 | if self.td.PROTO == "zsync": | 798 | if self.td.PROTO == "zsync": |
953 | 722 | ISOLIST[vm_id]["sync_cmd"] = cmd.split("&&")[1].strip() | 799 | ISOLIST[vm_id]["sync_cmd"] = cmd.split("&&")[1].strip() |
954 | 723 | else: | 800 | else: |
955 | 724 | ISOLIST[vm_id]["sync_cmd"] = cmd | 801 | ISOLIST[vm_id]["sync_cmd"] = cmd |
956 | 725 | 802 | ||
958 | 726 | if widget.get_active() == True: | 803 | if widget.get_active() is True: |
959 | 727 | self.td.DISK_FILE = self.td.create_disk_file() | 804 | self.td.DISK_FILE = self.td.create_disk_file() |
960 | 728 | self.td.VBOX_NAME = "%s-%s" % (self.td.PKG, vm_id) | 805 | self.td.VBOX_NAME = "%s-%s" % (self.td.PKG, vm_id) |
961 | 729 | ISOLIST[vm_id]["vbox_name"] = self.td.VBOX_NAME | 806 | ISOLIST[vm_id]["vbox_name"] = self.td.VBOX_NAME |
962 | @@ -733,13 +810,16 @@ | |||
963 | 733 | 810 | ||
964 | 734 | # Selecting virt method and Instancing VIRT object | 811 | # Selecting virt method and Instancing VIRT object |
965 | 735 | if self.td.VIRT == "kvm": | 812 | if self.td.VIRT == "kvm": |
967 | 736 | logging.info(_("Using KVM for virtual machine hosting...")) | 813 | logging.info(_( |
968 | 814 | "Using KVM for virtual machine hosting...")) | ||
969 | 737 | virt = kvm.KVM(self.td) | 815 | virt = kvm.KVM(self.td) |
970 | 738 | if self.td.VIRT == "virtualbox": | 816 | if self.td.VIRT == "virtualbox": |
972 | 739 | logging.info(_("Using VirtualBox for virtual machine hosting...")) | 817 | logging.info(_( |
973 | 818 | "Using VirtualBox for virtual machine hosting...")) | ||
974 | 740 | virt = virtualbox.VBox(self.td) | 819 | virt = virtualbox.VBox(self.td) |
975 | 741 | if self.td.VIRT == "paralels": | 820 | if self.td.VIRT == "paralels": |
977 | 742 | logging.info(_("Using Parallels Desktop for virtual machine hosting...")) | 821 | logging.info(_( |
978 | 822 | "Using Parallels Desktop for virtual machine hosting...")) | ||
979 | 743 | virt = parallels.Parallels(self.td) | 823 | virt = parallels.Parallels(self.td) |
980 | 744 | 824 | ||
981 | 745 | # Passing VIRT object to ISOLIST | 825 | # Passing VIRT object to ISOLIST |
982 | @@ -749,9 +829,10 @@ | |||
983 | 749 | # Instancing Launch Thread | 829 | # Instancing Launch Thread |
984 | 750 | launch_thread = LaunchThread(vm_id) | 830 | launch_thread = LaunchThread(vm_id) |
985 | 751 | 831 | ||
987 | 752 | self.isos_to_run.append([sync_thread, launch_thread, self.td.DISK_FILE, status]) | 832 | self.isos_to_run.append([ |
988 | 833 | sync_thread, launch_thread, self.td.DISK_FILE, status]) | ||
989 | 753 | 834 | ||
991 | 754 | if widget.get_active() == False: | 835 | if not widget.get_active(): |
992 | 755 | for t in self.isos_to_run: | 836 | for t in self.isos_to_run: |
993 | 756 | if t[0].command == ISOLIST[vm_id]["sync_cmd"]: | 837 | if t[0].command == ISOLIST[vm_id]["sync_cmd"]: |
994 | 757 | t[0].stop() | 838 | t[0].stop() |
995 | @@ -760,8 +841,8 @@ | |||
996 | 760 | self.td.delete_image() | 841 | self.td.delete_image() |
997 | 761 | self.isos_to_run.remove(t) | 842 | self.isos_to_run.remove(t) |
998 | 762 | 843 | ||
1001 | 763 | ############################################################################### | 844 | ####################################################################### |
1002 | 764 | # TODO - TODO - TODO - Determine better method to stop des-selected ISO's | 845 | # TODO - Determine better method to stop des-selected ISO's |
1003 | 765 | """ | 846 | """ |
1004 | 766 | if widget.get_active() == False: | 847 | if widget.get_active() == False: |
1005 | 767 | for t in self.isos_to_run: | 848 | for t in self.isos_to_run: |
1006 | @@ -814,40 +895,44 @@ | |||
1007 | 814 | except: | 895 | except: |
1008 | 815 | pass | 896 | pass |
1009 | 816 | else: | 897 | else: |
1011 | 817 | logging.debug(_("launch_iso: Thread is executing or syncing...")) | 898 | logging.debug(_( |
1012 | 899 | "launch_iso: Thread is executing or syncing...")) | ||
1013 | 818 | 900 | ||
1014 | 819 | def on_create_iso_disk_clicked(self, widget, data=None): | 901 | def on_create_iso_disk_clicked(self, widget, data=None): |
1015 | 820 | ################################################################### | 902 | ################################################################### |
1016 | 821 | ############ Launches USB Creator for the selected ISO ############ | 903 | ############ Launches USB Creator for the selected ISO ############ |
1017 | 822 | ################################################################### | 904 | ################################################################### |
1018 | 823 | if not self.isos_to_run: | 905 | if not self.isos_to_run: |
1022 | 824 | self.on_error_dialog( _("No ISO has been selected." | 906 | self.on_error_dialog(_("No ISO has been selected." |
1023 | 825 | "\n\n" | 907 | "\n\n" |
1024 | 826 | "Please select an ISO to create an USB Startup Disk.")) | 908 | "Please select an ISO to create an " |
1025 | 909 | "USB Startup Disk.")) | ||
1026 | 827 | return | 910 | return |
1027 | 828 | if len(self.isos_to_run) > 1: | 911 | if len(self.isos_to_run) > 1: |
1031 | 829 | self.on_error_dialog( _("More than 1 ISO has been selected." | 912 | self.on_error_dialog(_("More than 1 ISO has been selected." |
1032 | 830 | "\n\n" | 913 | "\n\n" |
1033 | 831 | "Please select only 1 ISO to continue!")) | 914 | "Please select only 1 ISO to continue!")) |
1034 | 832 | return | 915 | return |
1035 | 833 | if not os.path.exists(self.td.PATH_TO_ISO): | 916 | if not os.path.exists(self.td.PATH_TO_ISO): |
1039 | 834 | self.on_error_dialog( _("The specified ISO does not exist!" | 917 | self.on_error_dialog(_("The specified ISO does not exist!" |
1040 | 835 | "\n\n" | 918 | "\n\n" |
1041 | 836 | "Please, synchronize the ISO to continue.")) | 919 | "Please synchronize the ISO to continue.")) |
1042 | 837 | return | 920 | return |
1043 | 838 | try: | 921 | try: |
1045 | 839 | self.p = subprocess.Popen(["usb-creator-gtk", "-i", self.td.PATH_TO_ISO]) | 922 | self.p = subprocess.Popen(["usb-creator-gtk", "-i", |
1046 | 923 | self.td.PATH_TO_ISO]) | ||
1047 | 840 | except: | 924 | except: |
1048 | 841 | self.on_error_dialog(_("Unable to launch USB Creator!")) | 925 | self.on_error_dialog(_("Unable to launch USB Creator!")) |
1049 | 842 | return | 926 | return |
1050 | 843 | 927 | ||
1051 | 928 | |||
1052 | 844 | ################################################################### | 929 | ################################################################### |
1053 | 845 | ########## Class that support threading for ISO Syncing ########### | 930 | ########## Class that support threading for ISO Syncing ########### |
1054 | 846 | ################################################################### | 931 | ################################################################### |
1055 | 847 | class SyncThread(threading.Thread): | 932 | class SyncThread(threading.Thread): |
1056 | 848 | #def __init__(self, label, spinner, progress, cmd, url): | 933 | #def __init__(self, label, spinner, progress, cmd, url): |
1057 | 849 | def __init__(self, vm_id): | 934 | def __init__(self, vm_id): |
1059 | 850 | threading.Thread.__init__ (self) | 935 | threading.Thread.__init__(self) |
1060 | 851 | self.spin = ISOLIST[vm_id]["spinner"] | 936 | self.spin = ISOLIST[vm_id]["spinner"] |
1061 | 852 | self.status_label = ISOLIST[vm_id]["lb_status"] | 937 | self.status_label = ISOLIST[vm_id]["lb_status"] |
1062 | 853 | self.previous_text = self.status_label.get_text() | 938 | self.previous_text = self.status_label.get_text() |
1063 | @@ -859,16 +944,19 @@ | |||
1064 | 859 | 944 | ||
1065 | 860 | def run(self): | 945 | def run(self): |
1066 | 861 | cmd = self.command.split() | 946 | cmd = self.command.split() |
1068 | 862 | self.p = subprocess.Popen(cmd, stdout=subprocess.PIPE, universal_newlines = True) | 947 | self.p = subprocess.Popen(cmd, stdout=subprocess.PIPE, |
1069 | 948 | universal_newlines=True) | ||
1070 | 863 | percent = re.compile(r'(\d+)%') | 949 | percent = re.compile(r'(\d+)%') |
1071 | 864 | self.status_label.show() | 950 | self.status_label.show() |
1072 | 865 | self.spin.show() | 951 | self.spin.show() |
1073 | 866 | self.spin.start() | 952 | self.spin.start() |
1076 | 867 | text = _(" Downloading %s (0%%)") % os.path.basename(self.url).partition("_")[2] | 953 | text = _(" Downloading %s (0%%)") % os.path.basename( |
1077 | 868 | self.status_label.set_markup("<b><span size='10000'>%s</span></b>" % text) | 954 | self.url).partition("_")[2] |
1078 | 955 | self.status_label.set_markup( | ||
1079 | 956 | "<b><span size='10000'>%s</span></b>" % text) | ||
1080 | 869 | prev = None | 957 | prev = None |
1081 | 870 | while not self.stopthread.isSet(): | 958 | while not self.stopthread.isSet(): |
1083 | 871 | if self.p.poll() != None: | 959 | if self.p.poll() is not None: |
1084 | 872 | self.update_status_label() | 960 | self.update_status_label() |
1085 | 873 | self.p = None | 961 | self.p = None |
1086 | 874 | self.spin.stop() | 962 | self.spin.stop() |
1087 | @@ -880,12 +968,14 @@ | |||
1088 | 880 | #gtk.gdk.threads_leave() | 968 | #gtk.gdk.threads_leave() |
1089 | 881 | line = self.p.stdout.readline(1024).strip() | 969 | line = self.p.stdout.readline(1024).strip() |
1090 | 882 | match = percent.search(line) | 970 | match = percent.search(line) |
1092 | 883 | if match != None: | 971 | if match is not None: |
1093 | 884 | cur = match.group(1) | 972 | cur = match.group(1) |
1094 | 885 | if prev != cur: | 973 | if prev != cur: |
1095 | 886 | prev = match.group(1) | 974 | prev = match.group(1) |
1098 | 887 | text = _(" Downloading %s (%s%%)") % (os.path.basename(self.url).partition("_")[2], prev) | 975 | text = _(" Downloading %s (%s%%)") % (os.path.basename( |
1099 | 888 | self.status_label.set_markup("<b><span size='10000'>%s</span></b>" % text) | 976 | self.url).partition("_")[2], prev) |
1100 | 977 | self.status_label.set_markup( | ||
1101 | 978 | "<b><span size='10000'>%s</span></b>" % text) | ||
1102 | 889 | time.sleep(1) | 979 | time.sleep(1) |
1103 | 890 | 980 | ||
1104 | 891 | def stop(self): | 981 | def stop(self): |
1105 | @@ -902,10 +992,13 @@ | |||
1106 | 902 | 992 | ||
1107 | 903 | def update_status_label(self): | 993 | def update_status_label(self): |
1108 | 904 | if os.path.exists(self.url): | 994 | if os.path.exists(self.url): |
1110 | 905 | self.status_label.set_markup(_("<i> CACHE: [%s]</i>") % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(os.path.getmtime(self.url))))) | 995 | self.status_label.set_markup(_("<i> CACHE: [%s]</i>") % ( |
1111 | 996 | time.strftime("%Y-%m-%d %H:%M:%S", time.localtime( | ||
1112 | 997 | os.path.getmtime(self.url))))) | ||
1113 | 906 | else: | 998 | else: |
1114 | 907 | self.status_label.set_markup(_("<i> CACHE: [empty]</i>")) | 999 | self.status_label.set_markup(_("<i> CACHE: [empty]</i>")) |
1115 | 908 | 1000 | ||
1116 | 1001 | |||
1117 | 909 | ################################################################### | 1002 | ################################################################### |
1118 | 910 | ########## Class that supports threading for VM Running ########### | 1003 | ########## Class that supports threading for VM Running ########### |
1119 | 911 | ################################################################### | 1004 | ################################################################### |
1120 | @@ -923,9 +1016,9 @@ | |||
1121 | 923 | self.p = None | 1016 | self.p = None |
1122 | 924 | 1017 | ||
1123 | 925 | def prepare_to_launch_vm(self): | 1018 | def prepare_to_launch_vm(self): |
1127 | 926 | ################################################################### | 1019 | ############################################################### |
1128 | 927 | ######## Prepare the VM to launch and return launch command ####### | 1020 | ##### Prepare the VM to launch and return launch command ###### |
1129 | 928 | ################################################################### | 1021 | ############################################################### |
1130 | 929 | # TODO TODO TODO - Re-add validation | 1022 | # TODO TODO TODO - Re-add validation |
1131 | 930 | self.ovirt.validate_virt() | 1023 | self.ovirt.validate_virt() |
1132 | 931 | self.ovirt.setup_virt() | 1024 | self.ovirt.setup_virt() |
1133 | @@ -945,8 +1038,9 @@ | |||
1134 | 945 | 1038 | ||
1135 | 946 | if self.virt == 'kvm': | 1039 | if self.virt == 'kvm': |
1136 | 947 | while not self.stopthread.isSet(): | 1040 | while not self.stopthread.isSet(): |
1139 | 948 | if self.p.poll() != None: | 1041 | if self.p.poll() is not None: |
1140 | 949 | self.status_label.set_markup("<i>%s</i>" % self.previous_text) | 1042 | self.status_label.set_markup( |
1141 | 1043 | "<i>%s</i>" % self.previous_text) | ||
1142 | 950 | self.p = None | 1044 | self.p = None |
1143 | 951 | break | 1045 | break |
1144 | 952 | time.sleep(0.1) | 1046 | time.sleep(0.1) |
1145 | @@ -954,16 +1048,20 @@ | |||
1146 | 954 | elif self.virt == 'virtualbox': | 1048 | elif self.virt == 'virtualbox': |
1147 | 955 | time.sleep(5) | 1049 | time.sleep(5) |
1148 | 956 | while not self.stopthread.isSet(): | 1050 | while not self.stopthread.isSet(): |
1151 | 957 | if commands.getstatusoutput("VBoxManage list runningvms | grep -qs %s" % self.VBOX_NAME)[0] != 0: | 1051 | if commands.getstatusoutput("VBoxManage list runningvms | " |
1152 | 958 | self.status_label.set_markup("<i>%s</i>" % self.previous_text) | 1052 | "grep -qs %s" % self.VBOX_NAME)[0] != 0: |
1153 | 1053 | self.status_label.set_markup("<i>%s</i>" | ||
1154 | 1054 | % self.previous_text) | ||
1155 | 959 | self.p = None | 1055 | self.p = None |
1156 | 960 | break | 1056 | break |
1157 | 961 | time.sleep(2) | 1057 | time.sleep(2) |
1158 | 962 | 1058 | ||
1159 | 963 | elif self.virt == 'parallels': | 1059 | elif self.virt == 'parallels': |
1160 | 964 | while not self.stopthread.isSet(): | 1060 | while not self.stopthread.isSet(): |
1163 | 965 | if commands.getstatusoutput("prlctl list %s | grep -qs stopped" % td.VBOX_NAME)[0] == 0: | 1061 | if commands.getstatusoutput("prlctl list %s | grep -qs stopped" |
1164 | 966 | self.status_label.set_markup("<i>%s</i>" % self.previous_text) | 1062 | % td.VBOX_NAME)[0] == 0: |
1165 | 1063 | self.status_label.set_markup( | ||
1166 | 1064 | "<i>%s</i>" % self.previous_text) | ||
1167 | 967 | self.p = None | 1065 | self.p = None |
1168 | 968 | break | 1066 | break |
1169 | 969 | time.sleep(2) | 1067 | time.sleep(2) |
1170 | 970 | 1068 | ||
1171 | === modified file 'debian/changelog' | |||
1172 | --- debian/changelog 2013-09-28 02:34:10 +0000 | |||
1173 | +++ debian/changelog 2013-10-06 20:59:44 +0000 | |||
1174 | @@ -2,15 +2,13 @@ | |||
1175 | 2 | 2 | ||
1176 | 3 | * Fixed VirtualBox PAE option bug. LP: #940755 | 3 | * Fixed VirtualBox PAE option bug. LP: #940755 |
1177 | 4 | Thanks Ben Blankley | 4 | Thanks Ben Blankley |
1178 | 5 | * Follow pep8 standards | ||
1179 | 6 | * debian/copyright: Add testdrivegtk/AddOtherTestdrivegtkDialog.py | ||
1180 | 7 | * debian/control: Add working VCS fields | ||
1181 | 8 | * debian/release.sh: Update current ubuntu release | ||
1182 | 5 | 9 | ||
1183 | 6 | -- Jackson Doak <noskcaj@ubuntu.com> Sat, 28 Sep 2013 12:30:24 +1000 | 10 | -- Jackson Doak <noskcaj@ubuntu.com> Sat, 28 Sep 2013 12:30:24 +1000 |
1184 | 7 | 11 | ||
1185 | 8 | testdrive (3.25) unreleased; urgency=low | ||
1186 | 9 | |||
1187 | 10 | * UNRELEASED | ||
1188 | 11 | |||
1189 | 12 | -- Dustin Kirkland <kirkland@ubuntu.com> Tue, 27 Aug 2013 11:31:59 -0500 | ||
1190 | 13 | |||
1191 | 14 | testdrive (3.24-0ubuntu1) saucy; urgency=low | 12 | testdrive (3.24-0ubuntu1) saucy; urgency=low |
1192 | 15 | 13 | ||
1193 | 16 | [ Jackson Doak ] | 14 | [ Jackson Doak ] |
1194 | 17 | 15 | ||
1195 | === modified file 'debian/control' | |||
1196 | --- debian/control 2013-08-27 16:23:53 +0000 | |||
1197 | +++ debian/control 2013-10-06 20:59:44 +0000 | |||
1198 | @@ -6,7 +6,8 @@ | |||
1199 | 6 | Build-Depends: debhelper (>= 9), gettext-base, python (>= 2.6.6-3~), python-distutils-extra (>= 2.10) | 6 | Build-Depends: debhelper (>= 9), gettext-base, python (>= 2.6.6-3~), python-distutils-extra (>= 2.10) |
1200 | 7 | X-Python-Version: >= 2.6 | 7 | X-Python-Version: >= 2.6 |
1201 | 8 | Homepage: http://launchpad.net/testdrive | 8 | Homepage: http://launchpad.net/testdrive |
1203 | 9 | Vcs-Bzr: http://bazaar.launchpad.net/~kirkland/testdrive/trunk | 9 | Vcs-Bzr: bzr://bazaar.launchpad.net/+branch/testdrive/ |
1204 | 10 | Vcr-Browser: https://code.launchpad.net/~testdrive/testdrive/trunk | ||
1205 | 10 | 11 | ||
1206 | 11 | Package: testdrive | 12 | Package: testdrive |
1207 | 12 | Architecture: all | 13 | Architecture: all |
1208 | 13 | 14 | ||
1209 | === modified file 'debian/copyright' | |||
1210 | --- debian/copyright 2013-08-13 06:10:36 +0000 | |||
1211 | +++ debian/copyright 2013-10-06 20:59:44 +0000 | |||
1212 | @@ -22,3 +22,8 @@ | |||
1213 | 22 | . | 22 | . |
1214 | 23 | On Debian systems, the complete text of the GNU General Public | 23 | On Debian systems, the complete text of the GNU General Public |
1215 | 24 | License, version 3, can be found in /usr/share/common-licenses/GPL-3. | 24 | License, version 3, can be found in /usr/share/common-licenses/GPL-3. |
1216 | 25 | |||
1217 | 26 | Files: testdrivegtk/AddOtherTestdrivegtkDialog.py | ||
1218 | 27 | Copyright: Public domain | ||
1219 | 28 | License: Public domain | ||
1220 | 29 | This file is in the public domain | ||
1221 | 25 | 30 | ||
1222 | === modified file 'debian/release.sh' | |||
1223 | --- debian/release.sh 2009-11-12 23:26:08 +0000 | |||
1224 | +++ debian/release.sh 2013-10-06 20:59:44 +0000 | |||
1225 | @@ -8,7 +8,7 @@ | |||
1226 | 8 | exit 1 | 8 | exit 1 |
1227 | 9 | } | 9 | } |
1228 | 10 | 10 | ||
1230 | 11 | head -n1 debian/changelog | grep "lucid" || error "This version must be ready for 'lucid'" | 11 | head -n1 debian/changelog | grep "saucy" || error "This version must be ready for 'saucy'" |
1231 | 12 | 12 | ||
1232 | 13 | # Tag the release in bzr | 13 | # Tag the release in bzr |
1233 | 14 | minor=`head -n1 debian/changelog | sed "s/^.*($MAJOR.//" | sed "s/-.*$//"` | 14 | minor=`head -n1 debian/changelog | sed "s/^.*($MAJOR.//" | sed "s/-.*$//"` |
1234 | 15 | 15 | ||
1235 | === modified file 'po/testdrive.pot' | |||
1236 | --- po/testdrive.pot 2013-08-10 21:31:38 +0000 | |||
1237 | +++ po/testdrive.pot 2013-10-06 20:59:44 +0000 | |||
1238 | @@ -8,7 +8,7 @@ | |||
1239 | 8 | msgstr "" | 8 | msgstr "" |
1240 | 9 | "Project-Id-Version: PACKAGE VERSION\n" | 9 | "Project-Id-Version: PACKAGE VERSION\n" |
1241 | 10 | "Report-Msgid-Bugs-To: \n" | 10 | "Report-Msgid-Bugs-To: \n" |
1243 | 11 | "POT-Creation-Date: 2013-08-11 07:31+1000\n" | 11 | "POT-Creation-Date: 2013-10-06 19:12+1100\n" |
1244 | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
1245 | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
1246 | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" |
1247 | @@ -29,62 +29,63 @@ | |||
1248 | 29 | msgid "ISO;Testing;Ubuntu;Daily;VM;Virtual Machine;zsync;rsync;Testdrive" | 29 | msgid "ISO;Testing;Ubuntu;Daily;VM;Virtual Machine;zsync;rsync;Testdrive" |
1249 | 30 | msgstr "" | 30 | msgstr "" |
1250 | 31 | 31 | ||
1252 | 32 | #: ../bin/testdrive-gtk.py:49 | 32 | #: ../bin/testdrive-gtk.py:51 |
1253 | 33 | msgid "Other" | 33 | msgid "Other" |
1254 | 34 | msgstr "" | 34 | msgstr "" |
1255 | 35 | 35 | ||
1256 | 36 | #. ################################################################## | 36 | #. ################################################################## |
1257 | 37 | #. ####### Obtaining the settings from the Preferences Class ######## | 37 | #. ####### Obtaining the settings from the Preferences Class ######## |
1258 | 38 | #. ################################################################## | 38 | #. ################################################################## |
1260 | 39 | #: ../bin/testdrive-gtk.py:139 | 39 | #: ../bin/testdrive-gtk.py:142 |
1261 | 40 | msgid "Instancing Preferences..." | 40 | msgid "Instancing Preferences..." |
1262 | 41 | msgstr "" | 41 | msgstr "" |
1263 | 42 | 42 | ||
1265 | 43 | #: ../bin/testdrive-gtk.py:222 | 43 | #: ../bin/testdrive-gtk.py:235 |
1266 | 44 | #, python-format | 44 | #, python-format |
1267 | 45 | msgid "" | 45 | msgid "" |
1270 | 46 | "Checking available ISOs at the ISO tracker [http://iso.qa.ubuntu.com] every " | 46 | "Checking available ISOs at the ISO tracker [http://" |
1271 | 47 | "%s seconds" | 47 | "iso.qa.ubuntu.com] every %s seconds" |
1272 | 48 | msgstr "" | 48 | msgstr "" |
1273 | 49 | 49 | ||
1275 | 50 | #: ../bin/testdrive-gtk.py:227 | 50 | #: ../bin/testdrive-gtk.py:244 |
1276 | 51 | msgid "Unable to check the ISO tracker" | 51 | msgid "Unable to check the ISO tracker" |
1277 | 52 | msgstr "" | 52 | msgstr "" |
1278 | 53 | 53 | ||
1280 | 54 | #: ../bin/testdrive-gtk.py:265 | 54 | #: ../bin/testdrive-gtk.py:285 |
1281 | 55 | #, python-format | 55 | #, python-format |
1282 | 56 | msgid "<b>Release:</b> %s" | 56 | msgid "<b>Release:</b> %s" |
1283 | 57 | msgstr "" | 57 | msgstr "" |
1284 | 58 | 58 | ||
1286 | 59 | #: ../bin/testdrive-gtk.py:266 | 59 | #: ../bin/testdrive-gtk.py:286 |
1287 | 60 | #, python-format | 60 | #, python-format |
1288 | 61 | msgid "<b>ISO Repository:</b> http://%s.ubuntu.com/" | 61 | msgid "<b>ISO Repository:</b> http://%s.ubuntu.com/" |
1289 | 62 | msgstr "" | 62 | msgstr "" |
1290 | 63 | 63 | ||
1292 | 64 | #: ../bin/testdrive-gtk.py:306 | 64 | #: ../bin/testdrive-gtk.py:329 |
1293 | 65 | msgid "Add an ISO to TestDrive" | 65 | msgid "Add an ISO to TestDrive" |
1294 | 66 | msgstr "" | 66 | msgstr "" |
1295 | 67 | 67 | ||
1297 | 68 | #: ../bin/testdrive-gtk.py:322 | 68 | #: ../bin/testdrive-gtk.py:345 |
1298 | 69 | msgid "" | 69 | msgid "" |
1300 | 70 | "Unable to open because 'testdrive' is not installed.\n" | 70 | "Unable to open because 'testdrive' is " |
1301 | 71 | "not installed.\n" | ||
1302 | 71 | "Please install testdrive: \n" | 72 | "Please install testdrive: \n" |
1303 | 72 | "\n" | 73 | "\n" |
1304 | 73 | "sudo apt-get install testdrive-cli" | 74 | "sudo apt-get install testdrive-cli" |
1305 | 74 | msgstr "" | 75 | msgstr "" |
1306 | 75 | 76 | ||
1308 | 76 | #: ../bin/testdrive-gtk.py:326 | 77 | #: ../bin/testdrive-gtk.py:350 |
1309 | 77 | msgid "TestDrive an ISO or Disk Image" | 78 | msgid "TestDrive an ISO or Disk Image" |
1310 | 78 | msgstr "" | 79 | msgstr "" |
1311 | 79 | 80 | ||
1312 | 80 | #. ################################################################## | 81 | #. ################################################################## |
1313 | 81 | #. ## Obtains the command for the Sync process based on Protocol #### | 82 | #. ## Obtains the command for the Sync process based on Protocol #### |
1314 | 82 | #. ################################################################## | 83 | #. ################################################################## |
1316 | 83 | #: ../bin/testdrive-gtk.py:401 | 84 | #: ../bin/testdrive-gtk.py:430 |
1317 | 84 | msgid "Obtaining the sync protocol for the specified ISO..." | 85 | msgid "Obtaining the sync protocol for the specified ISO..." |
1318 | 85 | msgstr "" | 86 | msgstr "" |
1319 | 86 | 87 | ||
1321 | 87 | #: ../bin/testdrive-gtk.py:404 ../bin/testdrive.py:375 | 88 | #: ../bin/testdrive-gtk.py:434 ../bin/testdrive.py:425 |
1322 | 88 | #, python-format | 89 | #, python-format |
1323 | 89 | msgid "Unsupported protocol [%s]" | 90 | msgid "Unsupported protocol [%s]" |
1324 | 90 | msgstr "" | 91 | msgstr "" |
1325 | @@ -93,30 +94,34 @@ | |||
1326 | 93 | #. #### Obtains the Virtualization Method, if not shows warnings #### | 94 | #. #### Obtains the Virtualization Method, if not shows warnings #### |
1327 | 94 | #. ################################################################## | 95 | #. ################################################################## |
1328 | 95 | #. Choose the virtualization engine | 96 | #. Choose the virtualization engine |
1330 | 96 | #: ../bin/testdrive-gtk.py:415 | 97 | #: ../bin/testdrive-gtk.py:445 |
1331 | 97 | msgid "Obtaining the virtualization method..." | 98 | msgid "Obtaining the virtualization method..." |
1332 | 98 | msgstr "" | 99 | msgstr "" |
1333 | 99 | 100 | ||
1336 | 100 | #: ../bin/testdrive-gtk.py:419 | 101 | #: ../bin/testdrive-gtk.py:449 |
1337 | 101 | msgid "Your CPU supports KVM acceleration; please install KVM" | 102 | msgid "" |
1338 | 103 | "Your CPU supports KVM acceleration; please " | ||
1339 | 104 | "install KVM" | ||
1340 | 102 | msgstr "" | 105 | msgstr "" |
1341 | 103 | 106 | ||
1343 | 104 | #: ../bin/testdrive-gtk.py:420 | 107 | #: ../bin/testdrive-gtk.py:451 |
1344 | 105 | msgid "" | 108 | msgid "" |
1346 | 106 | "Your CPU supports KVM acceleration; please install KVM:\n" | 109 | "Your CPU supports KVM acceleration; please " |
1347 | 110 | "install KVM:\n" | ||
1348 | 107 | "\n" | 111 | "\n" |
1349 | 108 | "sudo apt-get install qemu-kvm" | 112 | "sudo apt-get install qemu-kvm" |
1350 | 109 | msgstr "" | 113 | msgstr "" |
1351 | 110 | 114 | ||
1353 | 111 | #: ../bin/testdrive-gtk.py:424 | 115 | #: ../bin/testdrive-gtk.py:456 |
1354 | 112 | msgid "" | 116 | msgid "" |
1357 | 113 | "Your CPU does not support acceleration; run kvm-ok for more information; " | 117 | "Your CPU does not support acceleration; run kvm-ok " |
1358 | 114 | "then install VBox" | 118 | "for more information; then install VBox" |
1359 | 115 | msgstr "" | 119 | msgstr "" |
1360 | 116 | 120 | ||
1362 | 117 | #: ../bin/testdrive-gtk.py:425 | 121 | #: ../bin/testdrive-gtk.py:458 |
1363 | 118 | msgid "" | 122 | msgid "" |
1365 | 119 | "Your CPU does not support acceleration; run kvm-ok for more information;\n" | 123 | "Your CPU does not support acceleration; " |
1366 | 124 | "run kvm-ok for more information;\n" | ||
1367 | 120 | "then please install VirtualBox\n" | 125 | "then please install VirtualBox\n" |
1368 | 121 | "\n" | 126 | "\n" |
1369 | 122 | "kvm-ok\n" | 127 | "kvm-ok\n" |
1370 | @@ -127,292 +132,307 @@ | |||
1371 | 127 | #. ### Obtains the list of ISO available from the iso list cache #### | 132 | #. ### Obtains the list of ISO available from the iso list cache #### |
1372 | 128 | #. ################################################################## | 133 | #. ################################################################## |
1373 | 129 | #. Try to retrieve the ISO list from the cache | 134 | #. Try to retrieve the ISO list from the cache |
1375 | 130 | #: ../bin/testdrive-gtk.py:438 ../bin/testdrive.py:348 | 135 | #: ../bin/testdrive-gtk.py:472 ../bin/testdrive.py:398 |
1376 | 131 | msgid "Retrieving the Ubuntu ISO list from cache..." | 136 | msgid "Retrieving the Ubuntu ISO list from cache..." |
1377 | 132 | msgstr "" | 137 | msgstr "" |
1378 | 133 | 138 | ||
1381 | 134 | #: ../bin/testdrive-gtk.py:442 ../bin/testdrive-gtk.py:443 | 139 | #: ../bin/testdrive-gtk.py:477 ../bin/testdrive-gtk.py:479 |
1382 | 135 | #: ../bin/testdrive.py:352 | 140 | #: ../bin/testdrive.py:402 |
1383 | 136 | msgid "Unable to retrieve the Ubuntu ISO list from cache..." | 141 | msgid "Unable to retrieve the Ubuntu ISO list from cache..." |
1384 | 137 | msgstr "" | 142 | msgstr "" |
1385 | 138 | 143 | ||
1388 | 139 | #: ../bin/testdrive-gtk.py:563 ../bin/testdrive-gtk.py:598 | 144 | #: ../bin/testdrive-gtk.py:604 ../bin/testdrive-gtk.py:652 |
1389 | 140 | #: ../bin/testdrive-gtk.py:905 | 145 | #: ../bin/testdrive-gtk.py:995 |
1390 | 141 | #, python-format | 146 | #, python-format |
1391 | 142 | msgid "<i> CACHE: [%s]</i>" | 147 | msgid "<i> CACHE: [%s]</i>" |
1392 | 143 | msgstr "" | 148 | msgstr "" |
1393 | 144 | 149 | ||
1396 | 145 | #: ../bin/testdrive-gtk.py:565 ../bin/testdrive-gtk.py:600 | 150 | #: ../bin/testdrive-gtk.py:609 ../bin/testdrive-gtk.py:658 |
1397 | 146 | #: ../bin/testdrive-gtk.py:907 | 151 | #: ../bin/testdrive-gtk.py:999 |
1398 | 147 | msgid "<i> CACHE: [empty]</i>" | 152 | msgid "<i> CACHE: [empty]</i>" |
1399 | 148 | msgstr "" | 153 | msgstr "" |
1400 | 149 | 154 | ||
1403 | 150 | #: ../bin/testdrive-gtk.py:628 | 155 | #: ../bin/testdrive-gtk.py:696 |
1404 | 151 | msgid "<b><i>There are no Other ISOs yet...</i></b>" | 156 | msgid "<b><i>There are no Other ISOs yet...</i></b>" |
1405 | 152 | msgstr "" | 157 | msgstr "" |
1406 | 153 | 158 | ||
1409 | 154 | #: ../bin/testdrive-gtk.py:631 | 159 | #: ../bin/testdrive-gtk.py:700 |
1410 | 155 | msgid "<b><i>There are no ISOs for this architecture yet...</i></b>" | 160 | msgid "" |
1411 | 161 | "<b><i>There are no ISOs for this architecture yet..." | ||
1412 | 162 | "</i></b>" | ||
1413 | 156 | msgstr "" | 163 | msgstr "" |
1414 | 157 | 164 | ||
1415 | 158 | #. Add Button | 165 | #. Add Button |
1417 | 159 | #: ../bin/testdrive-gtk.py:665 | 166 | #: ../bin/testdrive-gtk.py:737 |
1418 | 160 | msgid "Add ISO" | 167 | msgid "Add ISO" |
1419 | 161 | msgstr "" | 168 | msgstr "" |
1420 | 162 | 169 | ||
1421 | 163 | #. Create Buttons | 170 | #. Create Buttons |
1423 | 164 | #: ../bin/testdrive-gtk.py:672 | 171 | #: ../bin/testdrive-gtk.py:744 |
1424 | 165 | msgid "Create USB Disk" | 172 | msgid "Create USB Disk" |
1425 | 166 | msgstr "" | 173 | msgstr "" |
1426 | 167 | 174 | ||
1428 | 168 | #: ../bin/testdrive-gtk.py:677 | 175 | #: ../bin/testdrive-gtk.py:750 |
1429 | 169 | msgid "Sync" | 176 | msgid "Sync" |
1430 | 170 | msgstr "" | 177 | msgstr "" |
1431 | 171 | 178 | ||
1433 | 172 | #: ../bin/testdrive-gtk.py:682 | 179 | #: ../bin/testdrive-gtk.py:755 |
1434 | 173 | msgid "Launch" | 180 | msgid "Launch" |
1435 | 174 | msgstr "" | 181 | msgstr "" |
1436 | 175 | 182 | ||
1438 | 176 | #: ../bin/testdrive-gtk.py:736 ../bin/testdrive.py:264 | 183 | #: ../bin/testdrive-gtk.py:814 |
1439 | 177 | msgid "Using KVM for virtual machine hosting..." | 184 | msgid "Using KVM for virtual machine hosting..." |
1440 | 178 | msgstr "" | 185 | msgstr "" |
1441 | 179 | 186 | ||
1443 | 180 | #: ../bin/testdrive-gtk.py:739 ../bin/testdrive.py:266 | 187 | #: ../bin/testdrive-gtk.py:818 |
1444 | 181 | msgid "Using VirtualBox for virtual machine hosting..." | 188 | msgid "Using VirtualBox for virtual machine hosting..." |
1445 | 182 | msgstr "" | 189 | msgstr "" |
1446 | 183 | 190 | ||
1448 | 184 | #: ../bin/testdrive-gtk.py:742 ../bin/testdrive.py:268 | 191 | #: ../bin/testdrive-gtk.py:822 |
1449 | 185 | msgid "Using Parallels Desktop for virtual machine hosting..." | 192 | msgid "Using Parallels Desktop for virtual machine hosting..." |
1450 | 186 | msgstr "" | 193 | msgstr "" |
1451 | 187 | 194 | ||
1453 | 188 | #: ../bin/testdrive-gtk.py:796 | 195 | #: ../bin/testdrive-gtk.py:877 |
1454 | 189 | msgid "sync_iso: Thread is executing..." | 196 | msgid "sync_iso: Thread is executing..." |
1455 | 190 | msgstr "" | 197 | msgstr "" |
1456 | 191 | 198 | ||
1458 | 192 | #: ../bin/testdrive-gtk.py:817 | 199 | #: ../bin/testdrive-gtk.py:899 |
1459 | 193 | msgid "launch_iso: Thread is executing or syncing..." | 200 | msgid "launch_iso: Thread is executing or syncing..." |
1460 | 194 | msgstr "" | 201 | msgstr "" |
1461 | 195 | 202 | ||
1463 | 196 | #: ../bin/testdrive-gtk.py:824 | 203 | #: ../bin/testdrive-gtk.py:906 |
1464 | 197 | msgid "" | 204 | msgid "" |
1465 | 198 | "No ISO has been selected.\n" | 205 | "No ISO has been selected.\n" |
1466 | 199 | "\n" | 206 | "\n" |
1468 | 200 | "Please select an ISO to create an USB Startup Disk." | 207 | "Please select an ISO to create an USB " |
1469 | 208 | "Startup Disk." | ||
1470 | 201 | msgstr "" | 209 | msgstr "" |
1471 | 202 | 210 | ||
1473 | 203 | #: ../bin/testdrive-gtk.py:829 | 211 | #: ../bin/testdrive-gtk.py:912 |
1474 | 204 | msgid "" | 212 | msgid "" |
1475 | 205 | "More than 1 ISO has been selected.\n" | 213 | "More than 1 ISO has been selected.\n" |
1476 | 206 | "\n" | 214 | "\n" |
1477 | 207 | "Please select only 1 ISO to continue!" | 215 | "Please select only 1 ISO to continue!" |
1478 | 208 | msgstr "" | 216 | msgstr "" |
1479 | 209 | 217 | ||
1481 | 210 | #: ../bin/testdrive-gtk.py:834 | 218 | #: ../bin/testdrive-gtk.py:917 |
1482 | 211 | msgid "" | 219 | msgid "" |
1483 | 212 | "The specified ISO does not exist!\n" | 220 | "The specified ISO does not exist!\n" |
1484 | 213 | "\n" | 221 | "\n" |
1486 | 214 | "Please, synchronize the ISO to continue." | 222 | "Please synchronize the ISO to continue." |
1487 | 215 | msgstr "" | 223 | msgstr "" |
1488 | 216 | 224 | ||
1490 | 217 | #: ../bin/testdrive-gtk.py:841 | 225 | #: ../bin/testdrive-gtk.py:925 |
1491 | 218 | msgid "Unable to launch USB Creator!" | 226 | msgid "Unable to launch USB Creator!" |
1492 | 219 | msgstr "" | 227 | msgstr "" |
1493 | 220 | 228 | ||
1495 | 221 | #: ../bin/testdrive-gtk.py:867 | 229 | #: ../bin/testdrive-gtk.py:953 |
1496 | 222 | #, python-format | 230 | #, python-format |
1497 | 223 | msgid " Downloading %s (0%%)" | 231 | msgid " Downloading %s (0%%)" |
1498 | 224 | msgstr "" | 232 | msgstr "" |
1499 | 225 | 233 | ||
1501 | 226 | #: ../bin/testdrive-gtk.py:887 | 234 | #: ../bin/testdrive-gtk.py:975 |
1502 | 227 | #, python-format | 235 | #, python-format |
1503 | 228 | msgid " Downloading %s (%s%%)" | 236 | msgid " Downloading %s (%s%%)" |
1504 | 229 | msgstr "" | 237 | msgstr "" |
1505 | 230 | 238 | ||
1507 | 231 | #: ../bin/testdrive-gtk.py:936 | 239 | #: ../bin/testdrive-gtk.py:1029 |
1508 | 232 | msgid " Configuring Virtual Machine..." | 240 | msgid " Configuring Virtual Machine..." |
1509 | 233 | msgstr "" | 241 | msgstr "" |
1510 | 234 | 242 | ||
1512 | 235 | #: ../bin/testdrive-gtk.py:942 | 243 | #: ../bin/testdrive-gtk.py:1035 |
1513 | 236 | msgid " Running Virtual Machine..." | 244 | msgid " Running Virtual Machine..." |
1514 | 237 | msgstr "" | 245 | msgstr "" |
1515 | 238 | 246 | ||
1517 | 239 | #: ../bin/testdrive-gtk.py:991 | 247 | #: ../bin/testdrive-gtk.py:1089 |
1518 | 240 | msgid "Show debug messages" | 248 | msgid "Show debug messages" |
1519 | 241 | msgstr "" | 249 | msgstr "" |
1520 | 242 | 250 | ||
1522 | 243 | #: ../bin/testdrive.py:52 | 251 | #: ../bin/testdrive.py:62 |
1523 | 244 | msgid "" | 252 | msgid "" |
1524 | 245 | "\n" | 253 | "\n" |
1525 | 246 | "Welcome to Testdrive!\n" | 254 | "Welcome to Testdrive!\n" |
1526 | 247 | msgstr "" | 255 | msgstr "" |
1527 | 248 | 256 | ||
1529 | 249 | #: ../bin/testdrive.py:60 | 257 | #: ../bin/testdrive.py:70 |
1530 | 250 | #, python-format | 258 | #, python-format |
1531 | 251 | msgid " +-cache--> [%s] %s" | 259 | msgid " +-cache--> [%s] %s" |
1532 | 252 | msgstr "" | 260 | msgstr "" |
1533 | 253 | 261 | ||
1535 | 254 | #: ../bin/testdrive.py:63 | 262 | #: ../bin/testdrive.py:76 |
1536 | 255 | #, python-format | 263 | #, python-format |
1537 | 256 | msgid " %d. Other (prompt for ISO URL)" | 264 | msgid " %d. Other (prompt for ISO URL)" |
1538 | 257 | msgstr "" | 265 | msgstr "" |
1539 | 258 | 266 | ||
1541 | 259 | #: ../bin/testdrive.py:65 | 267 | #: ../bin/testdrive.py:78 |
1542 | 260 | msgid "" | 268 | msgid "" |
1543 | 261 | "\n" | 269 | "\n" |
1544 | 262 | "Select an image to testdrive [1]: " | 270 | "Select an image to testdrive [1]: " |
1545 | 263 | msgstr "" | 271 | msgstr "" |
1546 | 264 | 272 | ||
1548 | 265 | #: ../bin/testdrive.py:74 | 273 | #: ../bin/testdrive.py:87 |
1549 | 266 | msgid "" | 274 | msgid "" |
1550 | 267 | "\n" | 275 | "\n" |
1551 | 268 | "ERROR: Invalid input\n" | 276 | "ERROR: Invalid input\n" |
1552 | 269 | msgstr "" | 277 | msgstr "" |
1553 | 270 | 278 | ||
1555 | 271 | #: ../bin/testdrive.py:77 | 279 | #: ../bin/testdrive.py:90 |
1556 | 272 | msgid "" | 280 | msgid "" |
1557 | 273 | "\n" | 281 | "\n" |
1558 | 274 | "Enter an ISO URL to testdrive: " | 282 | "Enter an ISO URL to testdrive: " |
1559 | 275 | msgstr "" | 283 | msgstr "" |
1560 | 276 | 284 | ||
1562 | 277 | #: ../bin/testdrive.py:84 | 285 | #: ../bin/testdrive.py:97 |
1563 | 278 | msgid "" | 286 | msgid "" |
1564 | 279 | "\n" | 287 | "\n" |
1565 | 280 | "ERROR: Invalid selection\n" | 288 | "ERROR: Invalid selection\n" |
1566 | 281 | msgstr "" | 289 | msgstr "" |
1567 | 282 | 290 | ||
1569 | 283 | #: ../bin/testdrive.py:88 | 291 | #: ../bin/testdrive.py:102 |
1570 | 284 | #, python-format | 292 | #, python-format |
1571 | 285 | msgid "" | 293 | msgid "" |
1572 | 286 | "\n" | 294 | "\n" |
1573 | 287 | "%s\n" | 295 | "%s\n" |
1574 | 288 | msgstr "" | 296 | msgstr "" |
1575 | 289 | 297 | ||
1577 | 290 | #: ../bin/testdrive.py:102 ../testdrivegtk/AddOtherTestdrivegtkDialog.py:155 | 298 | #: ../bin/testdrive.py:118 ../testdrivegtk/AddOtherTestdrivegtkDialog.py:161 |
1578 | 291 | #, python-format | 299 | #, python-format |
1579 | 292 | msgid "Invalid ISO URL [%s]" | 300 | msgid "Invalid ISO URL [%s]" |
1580 | 293 | msgstr "" | 301 | msgstr "" |
1581 | 294 | 302 | ||
1583 | 295 | #: ../bin/testdrive.py:144 | 303 | #: ../bin/testdrive.py:167 |
1584 | 296 | #, python-format | 304 | #, python-format |
1585 | 297 | msgid "" | 305 | msgid "" |
1586 | 298 | "Command failed\n" | 306 | "Command failed\n" |
1587 | 299 | " `%s`" | 307 | " `%s`" |
1588 | 300 | msgstr "" | 308 | msgstr "" |
1589 | 301 | 309 | ||
1591 | 302 | #: ../bin/testdrive.py:151 | 310 | #: ../bin/testdrive.py:176 |
1592 | 303 | msgid "Launching Virtual Machine using CURSES as screen mode" | 311 | msgid "Launching Virtual Machine using CURSES as screen mode" |
1593 | 304 | msgstr "" | 312 | msgstr "" |
1594 | 305 | 313 | ||
1596 | 306 | #: ../bin/testdrive.py:196 | 314 | #: ../bin/testdrive.py:226 |
1597 | 307 | msgid "user configuration file (overriding default values" | 315 | msgid "user configuration file (overriding default values" |
1598 | 308 | msgstr "" | 316 | msgstr "" |
1599 | 309 | 317 | ||
1601 | 310 | #: ../bin/testdrive.py:198 | 318 | #: ../bin/testdrive.py:229 |
1602 | 311 | msgid "print version and system data, and exit" | 319 | msgid "print version and system data, and exit" |
1603 | 312 | msgstr "" | 320 | msgstr "" |
1604 | 313 | 321 | ||
1606 | 314 | #: ../bin/testdrive.py:200 | 322 | #: ../bin/testdrive.py:232 |
1607 | 315 | msgid "get ISO image from this URL location" | 323 | msgid "get ISO image from this URL location" |
1608 | 316 | msgstr "" | 324 | msgstr "" |
1609 | 317 | 325 | ||
1611 | 318 | #: ../bin/testdrive.py:202 | 326 | #: ../bin/testdrive.py:235 |
1612 | 319 | msgid "try to launch usb-creator for further testing" | 327 | msgid "try to launch usb-creator for further testing" |
1613 | 320 | msgstr "" | 328 | msgstr "" |
1614 | 321 | 329 | ||
1616 | 322 | #: ../bin/testdrive.py:204 | 330 | #: ../bin/testdrive.py:238 |
1617 | 323 | msgid "hardcode Ubuntu RELEASE codename" | 331 | msgid "hardcode Ubuntu RELEASE codename" |
1618 | 324 | msgstr "" | 332 | msgstr "" |
1619 | 325 | 333 | ||
1621 | 326 | #: ../bin/testdrive.py:206 | 334 | #: ../bin/testdrive.py:241 |
1622 | 327 | msgid "" | 335 | msgid "" |
1623 | 328 | "hardcode Ubuntu flavor. Available Flavors:\n" | 336 | "hardcode Ubuntu flavor. Available Flavors:\n" |
1626 | 329 | " ubuntu/kubuntu/xubuntu/edubuntu/mythbuntu/ubuntustudio/lubuntu/" | 337 | " ubuntu/kubuntu/xubuntu/edubuntu/mythbuntu/ " |
1627 | 330 | "ubuntukylin" | 338 | "ubuntustudio/lubuntu/ubuntukylin" |
1628 | 331 | msgstr "" | 339 | msgstr "" |
1629 | 332 | 340 | ||
1631 | 333 | #: ../bin/testdrive.py:209 | 341 | #: ../bin/testdrive.py:246 |
1632 | 334 | msgid "" | 342 | msgid "" |
1633 | 335 | "hardcode Ubuntu repository from where to obtain ISOs:\n" | 343 | "hardcode Ubuntu repository from where to obtain ISOs:\n" |
1634 | 336 | " releases/cdimage/cloud-daily/cloud-releases" | 344 | " releases/cdimage/cloud-daily/cloud-releases" |
1635 | 337 | msgstr "" | 345 | msgstr "" |
1636 | 338 | 346 | ||
1639 | 339 | #: ../bin/testdrive.py:212 | 347 | #: ../bin/testdrive.py:250 |
1640 | 340 | msgid "displays the Virtual Machine in the shell. Only valid for Cloud images." | 348 | msgid "" |
1641 | 349 | "displays the Virtual Machine in the shell. Only valid for Cloud " | ||
1642 | 350 | "images." | ||
1643 | 341 | msgstr "" | 351 | msgstr "" |
1644 | 342 | 352 | ||
1646 | 343 | #: ../bin/testdrive.py:217 | 353 | #: ../bin/testdrive.py:257 |
1647 | 344 | #, python-format | 354 | #, python-format |
1648 | 345 | msgid "version passed: %s" | 355 | msgid "version passed: %s" |
1649 | 346 | msgstr "" | 356 | msgstr "" |
1650 | 347 | 357 | ||
1652 | 348 | #: ../bin/testdrive.py:221 | 358 | #: ../bin/testdrive.py:262 |
1653 | 349 | #, python-format | 359 | #, python-format |
1654 | 350 | msgid "testdrive %s" | 360 | msgid "testdrive %s" |
1655 | 351 | msgstr "" | 361 | msgstr "" |
1656 | 352 | 362 | ||
1658 | 353 | #: ../bin/testdrive.py:233 | 363 | #: ../bin/testdrive.py:276 |
1659 | 354 | #, python-format | 364 | #, python-format |
1660 | 355 | msgid "config passed: %s" | 365 | msgid "config passed: %s" |
1661 | 356 | msgstr "" | 366 | msgstr "" |
1662 | 357 | 367 | ||
1664 | 358 | #: ../bin/testdrive.py:243 | 368 | #: ../bin/testdrive.py:286 |
1665 | 359 | #, python-format | 369 | #, python-format |
1666 | 360 | msgid "Trying config in %s" | 370 | msgid "Trying config in %s" |
1667 | 361 | msgstr "" | 371 | msgstr "" |
1668 | 362 | 372 | ||
1670 | 363 | #: ../bin/testdrive.py:247 | 373 | #: ../bin/testdrive.py:290 |
1671 | 364 | #, python-format | 374 | #, python-format |
1672 | 365 | msgid "Using configuration in %s" | 375 | msgid "Using configuration in %s" |
1673 | 366 | msgstr "" | 376 | msgstr "" |
1674 | 367 | 377 | ||
1676 | 368 | #: ../bin/testdrive.py:249 | 378 | #: ../bin/testdrive.py:292 |
1677 | 369 | #, python-format | 379 | #, python-format |
1678 | 370 | msgid "Invalid configuration [%s]" | 380 | msgid "Invalid configuration [%s]" |
1679 | 371 | msgstr "" | 381 | msgstr "" |
1680 | 372 | 382 | ||
1682 | 373 | #: ../bin/testdrive.py:257 | 383 | #: ../bin/testdrive.py:300 |
1683 | 374 | msgid "" | 384 | msgid "" |
1684 | 375 | "Your CPU supports KVM acceleration; please install KVM:\n" | 385 | "Your CPU supports KVM acceleration; please install KVM:\n" |
1685 | 376 | " sudo apt-get install qemu-kvm" | 386 | " sudo apt-get install qemu-kvm" |
1686 | 377 | msgstr "" | 387 | msgstr "" |
1687 | 378 | 388 | ||
1689 | 379 | #: ../bin/testdrive.py:260 | 389 | #: ../bin/testdrive.py:303 |
1690 | 380 | msgid "" | 390 | msgid "" |
1693 | 381 | "Your CPU does not support acceleration; run kvm-ok for more information; " | 391 | "Your CPU does not support acceleration; run kvm-ok for more " |
1694 | 382 | "then please install VirtualBox:\n" | 392 | "information; then please install VirtualBox:\n" |
1695 | 383 | " kvm-ok\n" | 393 | " kvm-ok\n" |
1696 | 384 | " sudo apt-get install virtualbox" | 394 | " sudo apt-get install virtualbox" |
1697 | 385 | msgstr "" | 395 | msgstr "" |
1698 | 386 | 396 | ||
1700 | 387 | #: ../bin/testdrive.py:284 | 397 | #: ../bin/testdrive.py:308 |
1701 | 398 | msgid "Using KVM for virtual machine hosting." | ||
1702 | 399 | msgstr "" | ||
1703 | 400 | |||
1704 | 401 | #: ../bin/testdrive.py:310 | ||
1705 | 402 | msgid "Using VirtualBox for virtual machine hosting." | ||
1706 | 403 | msgstr "" | ||
1707 | 404 | |||
1708 | 405 | #: ../bin/testdrive.py:312 | ||
1709 | 406 | msgid "Using Parallels Desktop for virtual machine hosting." | ||
1710 | 407 | msgstr "" | ||
1711 | 408 | |||
1712 | 409 | #: ../bin/testdrive.py:329 | ||
1713 | 388 | msgid "" | 410 | msgid "" |
1716 | 389 | "Launching Cloud images only works with KVM. Please switch your " | 411 | "Launching Cloud images only works with KVM. Please switch " |
1717 | 390 | "virtualization method..." | 412 | "your virtualization method..." |
1718 | 391 | msgstr "" | 413 | msgstr "" |
1719 | 392 | 414 | ||
1722 | 393 | #: ../bin/testdrive.py:335 | 415 | #: ../bin/testdrive.py:384 |
1721 | 394 | #: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:339 | ||
1723 | 395 | #, python-format | 416 | #, python-format |
1724 | 396 | msgid "Obtaining Ubuntu ISO list from %s..." | 417 | msgid "Obtaining Ubuntu ISO list from %s..." |
1725 | 397 | msgstr "" | 418 | msgstr "" |
1726 | 398 | 419 | ||
1728 | 399 | #: ../bin/testdrive.py:339 | 420 | #: ../bin/testdrive.py:388 |
1729 | 400 | #, python-format | 421 | #, python-format |
1730 | 401 | msgid "ERROR: Could not obtain the Ubuntu ISO list from %s..." | 422 | msgid "ERROR: Could not obtain the Ubuntu ISO list from %s..." |
1731 | 402 | msgstr "" | 423 | msgstr "" |
1732 | 403 | 424 | ||
1735 | 404 | #: ../bin/testdrive.py:345 | 425 | #: ../bin/testdrive.py:395 |
1734 | 405 | #: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:351 | ||
1736 | 406 | msgid "Unable to update the Ubuntu ISO list cache..." | 426 | msgid "Unable to update the Ubuntu ISO list cache..." |
1737 | 407 | msgstr "" | 427 | msgstr "" |
1738 | 408 | 428 | ||
1739 | 409 | #. BUG: should check disk space availability in CACHE dir | 429 | #. BUG: should check disk space availability in CACHE dir |
1740 | 410 | #. Update the cache | 430 | #. Update the cache |
1742 | 411 | #: ../bin/testdrive.py:371 | 431 | #: ../bin/testdrive.py:421 |
1743 | 412 | msgid "Syncing the specified ISO..." | 432 | msgid "Syncing the specified ISO..." |
1744 | 413 | msgstr "" | 433 | msgstr "" |
1745 | 414 | 434 | ||
1747 | 415 | #: ../bin/testdrive.py:378 ../testdrivegtk/AddOtherTestdrivegtkDialog.py:167 | 435 | #: ../bin/testdrive.py:429 ../testdrivegtk/AddOtherTestdrivegtkDialog.py:174 |
1748 | 416 | #, python-format | 436 | #, python-format |
1749 | 417 | msgid "ISO not found at [%s]" | 437 | msgid "ISO not found at [%s]" |
1750 | 418 | msgstr "" | 438 | msgstr "" |
1751 | @@ -420,75 +440,78 @@ | |||
1752 | 420 | #. ################## | 440 | #. ################## |
1753 | 421 | #. # Launch the VM ## | 441 | #. # Launch the VM ## |
1754 | 422 | #. ################## | 442 | #. ################## |
1756 | 423 | #: ../bin/testdrive.py:401 | 443 | #: ../bin/testdrive.py:453 |
1757 | 424 | msgid "Validating Virtualization Method...." | 444 | msgid "Validating Virtualization Method...." |
1758 | 425 | msgstr "" | 445 | msgstr "" |
1759 | 426 | 446 | ||
1761 | 427 | #: ../bin/testdrive.py:405 | 447 | #: ../bin/testdrive.py:457 |
1762 | 428 | #, python-format | 448 | #, python-format |
1763 | 429 | msgid "Unable to validate Virtualization Method [%s]" | 449 | msgid "Unable to validate Virtualization Method [%s]" |
1764 | 430 | msgstr "" | 450 | msgstr "" |
1765 | 431 | 451 | ||
1767 | 432 | #: ../bin/testdrive.py:407 | 452 | #: ../bin/testdrive.py:459 |
1768 | 433 | msgid "Setting up Virtual Machine..." | 453 | msgid "Setting up Virtual Machine..." |
1769 | 434 | msgstr "" | 454 | msgstr "" |
1770 | 435 | 455 | ||
1772 | 436 | #: ../bin/testdrive.py:411 | 456 | #: ../bin/testdrive.py:463 |
1773 | 437 | msgid "Unable to setup Virtual Machine" | 457 | msgid "Unable to setup Virtual Machine" |
1774 | 438 | msgstr "" | 458 | msgstr "" |
1775 | 439 | 459 | ||
1777 | 440 | #: ../bin/testdrive.py:413 | 460 | #: ../bin/testdrive.py:465 |
1778 | 441 | msgid "Launching Virtual Machine..." | 461 | msgid "Launching Virtual Machine..." |
1779 | 442 | msgstr "" | 462 | msgstr "" |
1780 | 443 | 463 | ||
1782 | 444 | #: ../bin/testdrive.py:421 | 464 | #: ../bin/testdrive.py:473 |
1783 | 445 | msgid "Unable to launch Virtual Machine" | 465 | msgid "Unable to launch Virtual Machine" |
1784 | 446 | msgstr "" | 466 | msgstr "" |
1785 | 447 | 467 | ||
1787 | 448 | #: ../bin/testdrive.py:425 | 468 | #: ../bin/testdrive.py:477 |
1788 | 449 | #, python-format | 469 | #, python-format |
1789 | 450 | msgid "Cleaning up disk image [%s]..." | 470 | msgid "Cleaning up disk image [%s]..." |
1790 | 451 | msgstr "" | 471 | msgstr "" |
1791 | 452 | 472 | ||
1792 | 453 | #. Remind about cache cleanup | 473 | #. Remind about cache cleanup |
1794 | 454 | #: ../bin/testdrive.py:428 | 474 | #: ../bin/testdrive.py:480 |
1795 | 455 | msgid "You may wish to clean up the cache directory..." | 475 | msgid "You may wish to clean up the cache directory..." |
1796 | 456 | msgstr "" | 476 | msgstr "" |
1797 | 457 | 477 | ||
1799 | 458 | #: ../bin/testdrive.py:429 | 478 | #: ../bin/testdrive.py:481 |
1800 | 459 | #, python-format | 479 | #, python-format |
1801 | 460 | msgid " %s and %s" | 480 | msgid " %s and %s" |
1802 | 461 | msgstr "" | 481 | msgstr "" |
1803 | 462 | 482 | ||
1805 | 463 | #: ../bin/testdrive.py:436 | 483 | #: ../bin/testdrive.py:490 |
1806 | 464 | msgid "" | 484 | msgid "" |
1807 | 465 | "\n" | 485 | "\n" |
1809 | 466 | "Launch USB Startup Disk Creator for further testing of this ISO? [y/N] " | 486 | "Launch USB Startup Disk Creator for further testing of this ISO? " |
1810 | 487 | "[y/N] " | ||
1811 | 467 | msgstr "" | 488 | msgstr "" |
1812 | 468 | 489 | ||
1814 | 469 | #: ../bin/testdrive.py:440 | 490 | #: ../bin/testdrive.py:495 |
1815 | 470 | msgid "" | 491 | msgid "" |
1816 | 471 | "\n" | 492 | "\n" |
1817 | 472 | "Press <enter> to exit..." | 493 | "Press <enter> to exit..." |
1818 | 473 | msgstr "" | 494 | msgstr "" |
1819 | 474 | 495 | ||
1821 | 475 | #: ../testdrivegtk/AddOtherTestdrivegtkDialog.py:135 | 496 | #: ../testdrivegtk/AddOtherTestdrivegtkDialog.py:140 |
1822 | 476 | msgid "Please insert a Description" | 497 | msgid "Please insert a Description" |
1823 | 477 | msgstr "" | 498 | msgstr "" |
1824 | 478 | 499 | ||
1826 | 479 | #: ../testdrivegtk/AddOtherTestdrivegtkDialog.py:140 | 500 | #: ../testdrivegtk/AddOtherTestdrivegtkDialog.py:145 |
1827 | 480 | msgid "Please insert a URL" | 501 | msgid "Please insert a URL" |
1828 | 481 | msgstr "" | 502 | msgstr "" |
1829 | 482 | 503 | ||
1832 | 483 | #: ../testdrivegtk/AddOtherTestdrivegtkDialog.py:171 | 504 | #: ../testdrivegtk/AddOtherTestdrivegtkDialog.py:178 |
1833 | 484 | msgid "No sync protocol has been selected, please select one." | 505 | msgid "" |
1834 | 506 | "No sync protocol has been selected, please " | ||
1835 | 507 | "select one." | ||
1836 | 485 | msgstr "" | 508 | msgstr "" |
1837 | 486 | 509 | ||
1839 | 487 | #: ../testdrivegtk/AddOtherTestdrivegtkDialog.py:196 | 510 | #: ../testdrivegtk/AddOtherTestdrivegtkDialog.py:204 |
1840 | 488 | msgid "Description" | 511 | msgid "Description" |
1841 | 489 | msgstr "" | 512 | msgstr "" |
1842 | 490 | 513 | ||
1844 | 491 | #: ../testdrivegtk/AddOtherTestdrivegtkDialog.py:227 | 514 | #: ../testdrivegtk/AddOtherTestdrivegtkDialog.py:238 |
1845 | 492 | msgid "Select Protocol:" | 515 | msgid "Select Protocol:" |
1846 | 493 | msgstr "" | 516 | msgstr "" |
1847 | 494 | 517 | ||
1848 | @@ -497,54 +520,76 @@ | |||
1849 | 497 | msgid "Other..." | 520 | msgid "Other..." |
1850 | 498 | msgstr "" | 521 | msgstr "" |
1851 | 499 | 522 | ||
1853 | 500 | #: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:72 | 523 | #: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:73 |
1854 | 501 | msgid "TestDrive Preferences" | 524 | msgid "TestDrive Preferences" |
1855 | 502 | msgstr "" | 525 | msgstr "" |
1856 | 503 | 526 | ||
1858 | 504 | #: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:98 | 527 | #: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:99 |
1859 | 505 | msgid "finish_initialization()" | 528 | msgid "finish_initialization()" |
1860 | 506 | msgstr "" | 529 | msgstr "" |
1861 | 507 | 530 | ||
1863 | 508 | #: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:138 | 531 | #: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:143 |
1864 | 509 | msgid "Select Repository:" | 532 | msgid "Select Repository:" |
1865 | 510 | msgstr "" | 533 | msgstr "" |
1866 | 511 | 534 | ||
1869 | 512 | #: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:149 | 535 | #: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:155 |
1870 | 513 | #: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:496 | 536 | #: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:532 |
1871 | 514 | msgid "Select Release:" | 537 | msgid "Select Release:" |
1872 | 515 | msgstr "" | 538 | msgstr "" |
1873 | 516 | 539 | ||
1874 | 517 | #. Load config files for local variables | 540 | #. Load config files for local variables |
1875 | 518 | #. self.load_config_files(file) | 541 | #. self.load_config_files(file) |
1877 | 519 | #: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:217 | 542 | #: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:238 |
1878 | 520 | #, python-format | 543 | #, python-format |
1879 | 521 | msgid "Reading config file: [%s]" | 544 | msgid "Reading config file: [%s]" |
1880 | 522 | msgstr "" | 545 | msgstr "" |
1881 | 523 | 546 | ||
1883 | 524 | #: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:219 | 547 | #: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:241 |
1884 | 525 | #, python-format | 548 | #, python-format |
1885 | 526 | msgid "Unable to load config file [%s]" | 549 | msgid "Unable to load config file [%s]" |
1886 | 527 | msgstr "" | 550 | msgstr "" |
1887 | 528 | 551 | ||
1889 | 529 | #: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:282 | 552 | #: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:305 |
1890 | 530 | #, python-format | 553 | #, python-format |
1891 | 531 | msgid " of %s available." | 554 | msgid " of %s available." |
1892 | 532 | msgstr "" | 555 | msgstr "" |
1893 | 533 | 556 | ||
1900 | 534 | #: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:343 | 557 | #: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:366 |
1901 | 535 | #, python-format | 558 | #, python-format |
1902 | 536 | msgid "Could not obtain the Ubuntu ISO list from %s..." | 559 | msgid "" |
1903 | 537 | msgstr "" | 560 | "\n" |
1904 | 538 | 561 | " Obtaining Ubuntu ISO list from %s...\n" | |
1905 | 539 | #: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:347 | 562 | " " |
1906 | 563 | msgstr "" | ||
1907 | 564 | |||
1908 | 565 | #: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:372 | ||
1909 | 566 | #, python-format | ||
1910 | 567 | msgid "" | ||
1911 | 568 | "\n" | ||
1912 | 569 | " Could not obtain the Ubuntu ISO list from %s...\n" | ||
1913 | 570 | " " | ||
1914 | 571 | msgstr "" | ||
1915 | 572 | |||
1916 | 573 | #: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:378 | ||
1917 | 540 | msgid "Updating the Ubuntu ISO list cache..." | 574 | msgid "Updating the Ubuntu ISO list cache..." |
1918 | 541 | msgstr "" | 575 | msgstr "" |
1919 | 542 | 576 | ||
1921 | 543 | #: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:355 | 577 | #: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:382 |
1922 | 578 | msgid "" | ||
1923 | 579 | "\n" | ||
1924 | 580 | " Unable to update the Ubuntu ISO list cache...\n" | ||
1925 | 581 | " " | ||
1926 | 582 | msgstr "" | ||
1927 | 583 | |||
1928 | 584 | #: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:388 | ||
1929 | 544 | msgid "get_preferences()" | 585 | msgid "get_preferences()" |
1930 | 545 | msgstr "" | 586 | msgstr "" |
1931 | 546 | 587 | ||
1933 | 547 | #: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:478 | 588 | #: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:512 |
1934 | 548 | #, python-format | 589 | #, python-format |
1935 | 549 | msgid "Unable to clean up files from [%s]" | 590 | msgid "Unable to clean up files from [%s]" |
1936 | 550 | msgstr "" | 591 | msgstr "" |
1937 | 592 | |||
1938 | 593 | #: ../testdrivegtk/AboutTestdrivegtkDialog.py:48 | ||
1939 | 594 | msgid "PyGTK Front-end for TestDrive" | ||
1940 | 595 | msgstr "" | ||
1941 | 551 | 596 | ||
1942 | === modified file 'setup.py' | |||
1943 | --- setup.py 2013-08-27 16:31:59 +0000 | |||
1944 | +++ setup.py 2013-10-06 20:59:44 +0000 | |||
1945 | @@ -2,24 +2,25 @@ | |||
1946 | 2 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | 2 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
1947 | 3 | ### BEGIN LICENSE | 3 | ### BEGIN LICENSE |
1948 | 4 | # Copyright (C) 2010 Canonical Ltd. | 4 | # Copyright (C) 2010 Canonical Ltd. |
1950 | 5 | # | 5 | # |
1951 | 6 | # Authors: | 6 | # Authors: |
1952 | 7 | # Andres Rodriguez <andreserl@ubuntu.com> | 7 | # Andres Rodriguez <andreserl@ubuntu.com> |
1956 | 8 | # | 8 | # |
1957 | 9 | # This program is free software: you can redistribute it and/or modify it | 9 | # This program is free software: you can redistribute it and/or modify it |
1958 | 10 | # under the terms of the GNU General Public License version 3, as published | 10 | # under the terms of the GNU General Public License version 3, as published |
1959 | 11 | # by the Free Software Foundation. | 11 | # by the Free Software Foundation. |
1964 | 12 | # | 12 | # |
1965 | 13 | # This program is distributed in the hope that it will be useful, but | 13 | # This program is distributed in the hope that it will be useful, but |
1966 | 14 | # WITHOUT ANY WARRANTY; without even the implied warranties of | 14 | # WITHOUT ANY WARRANTY; without even the implied warranties of |
1967 | 15 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | 15 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
1968 | 16 | # PURPOSE. See the GNU General Public License for more details. | 16 | # PURPOSE. See the GNU General Public License for more details. |
1971 | 17 | # | 17 | # |
1972 | 18 | # You should have received a copy of the GNU General Public License along | 18 | # You should have received a copy of the GNU General Public License along |
1973 | 19 | # with this program. If not, see <http://www.gnu.org/licenses/>. | 19 | # with this program. If not, see <http://www.gnu.org/licenses/>. |
1974 | 20 | ### END LICENSE | 20 | ### END LICENSE |
1975 | 21 | 21 | ||
1977 | 22 | ###################### DO NOT TOUCH THIS (HEAD TO THE SECOND PART) ###################### | 22 | |
1978 | 23 | ################# DO NOT TOUCH THIS (HEAD TO THE SECOND PART) ################# | ||
1979 | 23 | 24 | ||
1980 | 24 | import os | 25 | import os |
1981 | 25 | import sys | 26 | import sys |
1982 | @@ -28,9 +29,11 @@ | |||
1983 | 28 | try: | 29 | try: |
1984 | 29 | import DistUtilsExtra.auto | 30 | import DistUtilsExtra.auto |
1985 | 30 | except ImportError: | 31 | except ImportError: |
1987 | 31 | print >> sys.stderr, 'To build testdrivegtk you need https://launchpad.net/python-distutils-extra' | 32 | print >> sys.stderr, 'To build testdrive you need python-distutils-extra' |
1988 | 32 | sys.exit(1) | 33 | sys.exit(1) |
1990 | 33 | assert DistUtilsExtra.auto.__version__ >= '2.18', 'needs DistUtilsExtra.auto >= 2.18' | 34 | assert DistUtilsExtra.auto.__version__ >= '2.18', \ |
1991 | 35 | 'needs DistUtilsExtra.auto >= 2.18' | ||
1992 | 36 | |||
1993 | 34 | 37 | ||
1994 | 35 | def update_data_path(prefix, oldvalue=None): | 38 | def update_data_path(prefix, oldvalue=None): |
1995 | 36 | 39 | ||
1996 | @@ -38,14 +41,14 @@ | |||
1997 | 38 | fin = file('testdrivegtk/testdrivegtkconfig.py', 'r') | 41 | fin = file('testdrivegtk/testdrivegtkconfig.py', 'r') |
1998 | 39 | fout = file(fin.name + '.new', 'w') | 42 | fout = file(fin.name + '.new', 'w') |
1999 | 40 | 43 | ||
2002 | 41 | for line in fin: | 44 | for line in fin: |
2003 | 42 | fields = line.split(' = ') # Separate variable from value | 45 | fields = line.split(' = ') # Separate variable from value |
2004 | 43 | if fields[0] == '__testdrivegtk_data_directory__': | 46 | if fields[0] == '__testdrivegtk_data_directory__': |
2005 | 44 | # update to prefix, store oldvalue | 47 | # update to prefix, store oldvalue |
2006 | 45 | if not oldvalue: | 48 | if not oldvalue: |
2007 | 46 | oldvalue = fields[1] | 49 | oldvalue = fields[1] |
2008 | 47 | line = "%s = '%s'\n" % (fields[0], prefix) | 50 | line = "%s = '%s'\n" % (fields[0], prefix) |
2010 | 48 | else: # restore oldvalue | 51 | else: # restore oldvalue |
2011 | 49 | line = "%s = %s" % (fields[0], oldvalue) | 52 | line = "%s = %s" % (fields[0], oldvalue) |
2012 | 50 | fout.write(line) | 53 | fout.write(line) |
2013 | 51 | 54 | ||
2014 | @@ -53,7 +56,7 @@ | |||
2015 | 53 | fout.close() | 56 | fout.close() |
2016 | 54 | fin.close() | 57 | fin.close() |
2017 | 55 | os.rename(fout.name, fin.name) | 58 | os.rename(fout.name, fin.name) |
2019 | 56 | except (OSError, IOError), e: | 59 | except (OSError, IOError): |
2020 | 57 | print ("ERROR: Can't find testdrivegtk/testdrivegtkconfig.py") | 60 | print ("ERROR: Can't find testdrivegtk/testdrivegtkconfig.py") |
2021 | 58 | sys.exit(1) | 61 | sys.exit(1) |
2022 | 59 | return oldvalue | 62 | return oldvalue |
2023 | @@ -65,7 +68,7 @@ | |||
2024 | 65 | fin = file('testdrive-gtk.desktop.in', 'r') | 68 | fin = file('testdrive-gtk.desktop.in', 'r') |
2025 | 66 | fout = file(fin.name + '.new', 'w') | 69 | fout = file(fin.name + '.new', 'w') |
2026 | 67 | 70 | ||
2028 | 68 | for line in fin: | 71 | for line in fin: |
2029 | 69 | if 'Icon=' in line: | 72 | if 'Icon=' in line: |
2030 | 70 | line = "Icon=%s\n" % (datadir + 'media/testdrive-gtk.xpm') | 73 | line = "Icon=%s\n" % (datadir + 'media/testdrive-gtk.xpm') |
2031 | 71 | fout.write(line) | 74 | fout.write(line) |
2032 | @@ -73,7 +76,7 @@ | |||
2033 | 73 | fout.close() | 76 | fout.close() |
2034 | 74 | fin.close() | 77 | fin.close() |
2035 | 75 | os.rename(fout.name, fin.name) | 78 | os.rename(fout.name, fin.name) |
2037 | 76 | except (OSError, IOError), e: | 79 | except (OSError, IOError): |
2038 | 77 | print ("ERROR: Can't find testdrive-gtk.desktop.in") | 80 | print ("ERROR: Can't find testdrive-gtk.desktop.in") |
2039 | 78 | sys.exit(1) | 81 | sys.exit(1) |
2040 | 79 | 82 | ||
2041 | @@ -86,10 +89,9 @@ | |||
2042 | 86 | update_data_path(self.prefix, previous_value) | 89 | update_data_path(self.prefix, previous_value) |
2043 | 87 | 90 | ||
2044 | 88 | 91 | ||
2049 | 89 | 92 | ############################################################################### | |
2050 | 90 | ################################################################################## | 93 | #################### YOU SHOULD MODIFY ONLY WHAT IS BELOW ##################### |
2051 | 91 | ###################### YOU SHOULD MODIFY ONLY WHAT IS BELOW ###################### | 94 | ############################################################################### |
2048 | 92 | ################################################################################## | ||
2052 | 93 | 95 | ||
2053 | 94 | DistUtilsExtra.auto.setup( | 96 | DistUtilsExtra.auto.setup( |
2054 | 95 | name='testdrive', | 97 | name='testdrive', |
2055 | @@ -100,11 +102,11 @@ | |||
2056 | 100 | description='Test Drive an Ubuntu ISO', | 102 | description='Test Drive an Ubuntu ISO', |
2057 | 101 | long_description='Download and run an Ubuntu ISO in a Virtual Machine', | 103 | long_description='Download and run an Ubuntu ISO in a Virtual Machine', |
2058 | 102 | url='https://launchpad.net/testdrive', | 104 | url='https://launchpad.net/testdrive', |
2060 | 103 | packages=[ 'testdrive', | 105 | packages=['testdrive', |
2061 | 104 | 'testdrive.virt', | 106 | 'testdrive.virt', |
2062 | 105 | 'testdrivegtk'], | 107 | 'testdrivegtk'], |
2063 | 106 | scripts=['bin/testdrive', 'bin/testdrive-gtk'], | 108 | scripts=['bin/testdrive', 'bin/testdrive-gtk'], |
2065 | 107 | data_files=[ ('/etc', ['testdriverc']), | 109 | data_files=[('/etc', ['testdriverc']), |
2066 | 108 | ('share/testdrive', ['testdriverc']), | 110 | ('share/testdrive', ['testdriverc']), |
2067 | 109 | ('share/testdrivegtk/ui', glob('data/ui/*.ui')), | 111 | ('share/testdrivegtk/ui', glob('data/ui/*.ui')), |
2068 | 110 | ('share/testdrivegtk/ui', glob('data/ui/*.xml')), | 112 | ('share/testdrivegtk/ui', glob('data/ui/*.xml')), |
2069 | @@ -112,8 +114,8 @@ | |||
2070 | 112 | ('share/testdrivegtk/media', glob('data/media/*.svg')) | 114 | ('share/testdrivegtk/media', glob('data/media/*.svg')) |
2071 | 113 | #('share/pixmaps', glob('data/media/testdrive-gtk.xpm')), | 115 | #('share/pixmaps', glob('data/media/testdrive-gtk.xpm')), |
2072 | 114 | #('share/testdrivegtk/indicator', glob('indicator/testdrive-gtk')) | 116 | #('share/testdrivegtk/indicator', glob('indicator/testdrive-gtk')) |
2075 | 115 | #('share/indicators/messages/applications', glob('indicator/testdrive-gtk')) | 117 | #('share/indicators/messages/applications', |
2076 | 116 | ], | 118 | # glob('indicator/testdrive-gtk')) |
2077 | 119 | ], | ||
2078 | 117 | cmdclass={'install': InstallAndUpdateDataDirectory} | 120 | cmdclass={'install': InstallAndUpdateDataDirectory} |
2079 | 118 | ) | 121 | ) |
2080 | 119 | |||
2081 | 120 | 122 | ||
2082 | === modified file 'testdrive/testdrive.py' | |||
2083 | --- testdrive/testdrive.py 2013-08-10 09:59:15 +0000 | |||
2084 | +++ testdrive/testdrive.py 2013-10-06 20:59:44 +0000 | |||
2085 | @@ -19,9 +19,16 @@ | |||
2086 | 19 | # You should have received a copy of the GNU General Public License | 19 | # You should have received a copy of the GNU General Public License |
2087 | 20 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 20 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
2088 | 21 | 21 | ||
2090 | 22 | import os, platform, commands, tempfile, hashlib, ConfigParser, time | 22 | import os |
2091 | 23 | import platform | ||
2092 | 24 | import commands | ||
2093 | 25 | import tempfile | ||
2094 | 26 | import hashlib | ||
2095 | 27 | import ConfigParser | ||
2096 | 28 | import time | ||
2097 | 23 | import xdg.BaseDirectory | 29 | import xdg.BaseDirectory |
2098 | 24 | 30 | ||
2099 | 31 | |||
2100 | 25 | class Testdrive: | 32 | class Testdrive: |
2101 | 26 | def __init__(self, pkg_section): | 33 | def __init__(self, pkg_section): |
2102 | 27 | self.HOME = os.getenv("HOME", "") | 34 | self.HOME = os.getenv("HOME", "") |
2103 | @@ -42,10 +49,11 @@ | |||
2104 | 42 | self.PROTO = None | 49 | self.PROTO = None |
2105 | 43 | self.ISO_PATH_HEADER = None | 50 | self.ISO_PATH_HEADER = None |
2106 | 44 | self.PKG_SECTION = pkg_section | 51 | self.PKG_SECTION = pkg_section |
2111 | 45 | self.r = None #Release (maverick, lucid, etc) | 52 | self.r = None # Release (precise, saucy, etc) |
2112 | 46 | self.m = None #Arch (amd64, i386) | 53 | self.m = None # Arch (amd64, i386) |
2113 | 47 | self.f = None #Flavor (ubuntu, kubuntu, etc) | 54 | self.f = None # Flavor (ubuntu, kubuntu, etc) |
2114 | 48 | self.p = None # Ubuntu ISO Repository (cdimage, releases, cloud-daily, cloud-releases) | 55 | self.p = None # Ubuntu ISO Repository |
2115 | 56 | # (cdimage, releases, cloud-daily, cloud-releases) | ||
2116 | 49 | 57 | ||
2117 | 50 | def set_values(self, var, value): | 58 | def set_values(self, var, value): |
2118 | 51 | if var == 'kvm_args': | 59 | if var == 'kvm_args': |
2119 | @@ -95,7 +103,8 @@ | |||
2120 | 95 | except: | 103 | except: |
2121 | 96 | pass | 104 | pass |
2122 | 97 | 105 | ||
2124 | 98 | ## TODO: This possible needs to go outside the class due to in PyGTK front end we might need the list of ISO's before even instancing an object | 106 | ## TODO: This possible needs to go outside the class due to in PyGTK front |
2125 | 107 | ## end we might need the list of ISO's before even instancing an object | ||
2126 | 99 | def list_isos(self, ISOS): | 108 | def list_isos(self, ISOS): |
2127 | 100 | ISO = [] | 109 | ISO = [] |
2128 | 101 | for iso in ISOS: | 110 | for iso in ISOS: |
2129 | @@ -141,19 +150,23 @@ | |||
2130 | 141 | url = iso.split()[2] | 150 | url = iso.split()[2] |
2131 | 142 | if self.p == 'cloud-daily' or self.p == 'cloud-releases': | 151 | if self.p == 'cloud-daily' or self.p == 'cloud-releases': |
2132 | 143 | arch = url.split(".tar.gz")[0].split("-")[-1] | 152 | arch = url.split(".tar.gz")[0].split("-")[-1] |
2134 | 144 | name = "%s" % flavor | 153 | name = "%s" % flavor |
2135 | 145 | else: | 154 | else: |
2136 | 146 | arch = url.split(".iso")[0].split("-")[-1] | 155 | arch = url.split(".iso")[0].split("-")[-1] |
2138 | 147 | image = url.split("-%s.iso" % arch)[0].split("-")[-1].capitalize() | 156 | image = url.split("-%s.iso" % arch)[0].split( |
2139 | 157 | "-")[-1].capitalize() | ||
2140 | 148 | if image == 'Dvd': | 158 | if image == 'Dvd': |
2142 | 149 | image = url.split("-%s.iso" % arch)[0].split("-")[-1].swapcase() | 159 | image = url.split("-%s.iso" % arch)[0].split( |
2143 | 160 | "-")[-1].swapcase() | ||
2144 | 150 | name = "%s %s" % (flavor, image) | 161 | name = "%s %s" % (flavor, image) |
2145 | 151 | # Name: Shows a description | 162 | # Name: Shows a description |
2146 | 152 | # URL: Shows the URL from where it downloads the ISO | 163 | # URL: Shows the URL from where it downloads the ISO |
2147 | 153 | # Arch: Shows the architecture (amd64|i386) | 164 | # Arch: Shows the architecture (amd64|i386) |
2149 | 154 | # Category: The header used to save the ISO, i.e.: ubuntu_lucid-desktop-i386.iso kubuntu_lucid-desktop-i386.iso | 165 | # Category: The header used to save the ISO, i.e.: |
2150 | 166 | # ubuntu_saucy-desktop-i386.iso kubuntu_saucy-desktop-i386.iso | ||
2151 | 155 | if arch in self.m: | 167 | if arch in self.m: |
2153 | 156 | ISO.append({"name":name, "url":"%s%s" % (self.u, url), "arch":arch, "category":category}) | 168 | ISO.append({"name": name, "url": "%s%s" % (self.u, url), |
2154 | 169 | "arch": arch, "category": category}) | ||
2155 | 157 | return ISO | 170 | return ISO |
2156 | 158 | 171 | ||
2157 | 159 | def get_virt(self): | 172 | def get_virt(self): |
2158 | @@ -165,7 +178,9 @@ | |||
2159 | 165 | acceleration = 1 | 178 | acceleration = 1 |
2160 | 166 | else: | 179 | else: |
2161 | 167 | # Okay, we don't have kvm-ok, so let's hack it... | 180 | # Okay, we don't have kvm-ok, so let's hack it... |
2163 | 168 | if commands.getstatusoutput("egrep \"^flags.*:.*(svm|vmx)\" /proc/cpuinfo")[0] == 0: | 181 | if commands.getstatusoutput( |
2164 | 182 | "egrep \"^flags.*:.*(svm|vmx)\" /proc/cpuinfo" | ||
2165 | 183 | )[0] == 0: | ||
2166 | 169 | acceleration = 1 | 184 | acceleration = 1 |
2167 | 170 | # Prefer KVM if acceleration available and installed | 185 | # Prefer KVM if acceleration available and installed |
2168 | 171 | if acceleration == 1 and commands.getstatusoutput("which kvm")[0] == 0: | 186 | if acceleration == 1 and commands.getstatusoutput("which kvm")[0] == 0: |
2169 | @@ -186,7 +201,8 @@ | |||
2170 | 186 | # Set defaults where undefined | 201 | # Set defaults where undefined |
2171 | 187 | if self.CACHE is None: | 202 | if self.CACHE is None: |
2172 | 188 | if xdg.BaseDirectory.xdg_cache_home: | 203 | if xdg.BaseDirectory.xdg_cache_home: |
2174 | 189 | self.CACHE = "%s/%s" % (xdg.BaseDirectory.xdg_cache_home, self.PKG) | 204 | self.CACHE = "%s/%s" % ( |
2175 | 205 | xdg.BaseDirectory.xdg_cache_home, self.PKG) | ||
2176 | 190 | else: | 206 | else: |
2177 | 191 | self.CACHE = "%s/.cache/%s" % (self.HOME, self.PKG) | 207 | self.CACHE = "%s/.cache/%s" % (self.HOME, self.PKG) |
2178 | 192 | 208 | ||
2179 | @@ -214,7 +230,8 @@ | |||
2180 | 214 | self.DISK_SIZE = "6G" | 230 | self.DISK_SIZE = "6G" |
2181 | 215 | 231 | ||
2182 | 216 | if len(self.MEM) == 0: | 232 | if len(self.MEM) == 0: |
2184 | 217 | total = commands.getoutput("grep ^MemTotal /proc/meminfo | awk '{print $2}'") | 233 | total = commands.getoutput( |
2185 | 234 | "grep ^MemTotal /proc/meminfo | awk '{print $2}'") | ||
2186 | 218 | if total > 4000000: | 235 | if total > 4000000: |
2187 | 219 | self.MEM = "2048" | 236 | self.MEM = "2048" |
2188 | 220 | elif total > 2000000: | 237 | elif total > 2000000: |
2189 | @@ -227,15 +244,16 @@ | |||
2190 | 227 | self.MEM = "256" | 244 | self.MEM = "256" |
2191 | 228 | 245 | ||
2192 | 229 | if len(self.KVM_ARGS) == 0: | 246 | if len(self.KVM_ARGS) == 0: |
2194 | 230 | self.KVM_ARGS = "-usb -usbdevice tablet -net nic,model=virtio -net user -soundhw es1370" | 247 | self.KVM_ARGS = "-usb -usbdevice tablet -net nic,model=virtio", |
2195 | 248 | "-net user -soundhw es1370" | ||
2196 | 231 | 249 | ||
2197 | 232 | if len(self.VBOX_NAME) == 0: | 250 | if len(self.VBOX_NAME) == 0: |
2198 | 233 | self.VBOX_NAME = self.PKG | 251 | self.VBOX_NAME = self.PKG |
2199 | 234 | 252 | ||
2201 | 235 | if self.ISO_PATH_HEADER == None: | 253 | if self.ISO_PATH_HEADER is None: |
2202 | 236 | self.ISO_PATH_HEADER = 'other' | 254 | self.ISO_PATH_HEADER = 'other' |
2203 | 237 | 255 | ||
2205 | 238 | if self.f == None: | 256 | if self.f is None: |
2206 | 239 | self.f = 'ubuntu' | 257 | self.f = 'ubuntu' |
2207 | 240 | 258 | ||
2208 | 241 | if self.m is None: | 259 | if self.m is None: |
2209 | @@ -244,7 +262,7 @@ | |||
2210 | 244 | else: | 262 | else: |
2211 | 245 | self.m = ["i386"] | 263 | self.m = ["i386"] |
2212 | 246 | 264 | ||
2214 | 247 | if self.p == None: | 265 | if self.p is None: |
2215 | 248 | self.p = 'cdimage' | 266 | self.p = 'cdimage' |
2216 | 249 | 267 | ||
2217 | 250 | if self.p == 'cdimage': | 268 | if self.p == 'cdimage': |
2218 | @@ -263,11 +281,14 @@ | |||
2219 | 263 | if self.PROTO == "rsync": | 281 | if self.PROTO == "rsync": |
2220 | 264 | cmd = "rsync -azPL %s %s" % (self.ISO_URL, self.PATH_TO_ISO) | 282 | cmd = "rsync -azPL %s %s" % (self.ISO_URL, self.PATH_TO_ISO) |
2221 | 265 | return cmd | 283 | return cmd |
2223 | 266 | elif self.PROTO == "zsync" or self.PROTO == "http" or self.PROTO == "ftp": | 284 | elif self.PROTO == "zsync" or \ |
2224 | 285 | self.PROTO == "http" or self.PROTO == "ftp": | ||
2225 | 267 | if commands.getstatusoutput("which zsync")[0] == 0: | 286 | if commands.getstatusoutput("which zsync")[0] == 0: |
2226 | 268 | if self.ISO_URL.partition("://")[0] == "zsync": | 287 | if self.ISO_URL.partition("://")[0] == "zsync": |
2227 | 269 | self.ISO_URL = self.ISO_URL.replace('zsync', 'http') | 288 | self.ISO_URL = self.ISO_URL.replace('zsync', 'http') |
2229 | 270 | cmd = "cd '%s' && zsync %s.zsync -o %s" % (self.CACHE_ISO, self.ISO_URL, self.PATH_TO_ISO) | 289 | cmd = "cd '%s' && zsync %s.zsync -o %s" % ( |
2230 | 290 | self.CACHE_ISO, self.ISO_URL, self.PATH_TO_ISO | ||
2231 | 291 | ) | ||
2232 | 271 | return cmd | 292 | return cmd |
2233 | 272 | else: | 293 | else: |
2234 | 273 | cmd = "wget %s -O %s" % (self.ISO_URL, self.PATH_TO_ISO) | 294 | cmd = "wget %s -O %s" % (self.ISO_URL, self.PATH_TO_ISO) |
2235 | @@ -276,7 +297,8 @@ | |||
2236 | 276 | # If the iso is on file:///, use the ISO in place | 297 | # If the iso is on file:///, use the ISO in place |
2237 | 277 | self.PATH_TO_ISO = self.ISO_URL.partition("://")[2] | 298 | self.PATH_TO_ISO = self.ISO_URL.partition("://")[2] |
2238 | 278 | # Get absolute path if a relative path is used | 299 | # Get absolute path if a relative path is used |
2240 | 279 | DIR = commands.getoutput("cd `dirname '%s'` && pwd" % self.PATH_TO_ISO) | 300 | DIR = commands.getoutput("cd `dirname '%s'` && pwd" % |
2241 | 301 | self.PATH_TO_ISO) | ||
2242 | 280 | FILE = os.path.basename("%s" % self.PATH_TO_ISO) | 302 | FILE = os.path.basename("%s" % self.PATH_TO_ISO) |
2243 | 281 | self.PATH_TO_ISO = "%s/%s" % (DIR, FILE) | 303 | self.PATH_TO_ISO = "%s/%s" % (DIR, FILE) |
2244 | 282 | return 0 | 304 | return 0 |
2245 | @@ -299,10 +321,11 @@ | |||
2246 | 299 | else: | 321 | else: |
2247 | 300 | rm_disk = False | 322 | rm_disk = False |
2248 | 301 | 323 | ||
2250 | 302 | # If disk image is stock (e.g., you just ran a LiveCD, no installation), | 324 | # If disk image is stock (e.g. you just ran a LiveCD, no installation), |
2251 | 303 | # purge it automatically. | 325 | # purge it automatically. |
2252 | 304 | if os.path.exists(self.DISK_FILE): | 326 | if os.path.exists(self.DISK_FILE): |
2254 | 305 | if os.path.getsize(self.DISK_FILE) == 262144 and self.md5sum(self.DISK_FILE) == "1da7553f642332ec9fb58a6094d2c8ef": | 327 | if os.path.getsize(self.DISK_FILE) == 262144 and self.md5sum( |
2255 | 328 | self.DISK_FILE) == "1da7553f642332ec9fb58a6094d2c8ef": | ||
2256 | 306 | # Clean up kvm qcow2 image | 329 | # Clean up kvm qcow2 image |
2257 | 307 | rm_disk = True | 330 | rm_disk = True |
2258 | 308 | if os.path.getsize(self.DISK_FILE) == 24576: | 331 | if os.path.getsize(self.DISK_FILE) == 24576: |
2259 | @@ -321,18 +344,22 @@ | |||
2260 | 321 | 344 | ||
2261 | 322 | def set_launch_path(self): | 345 | def set_launch_path(self): |
2262 | 323 | # Move from set_defaults, due to merge of upstream rev 189 | 346 | # Move from set_defaults, due to merge of upstream rev 189 |
2264 | 324 | ISO_NAME = "%s_%s" % (self.ISO_PATH_HEADER, os.path.basename(self.ISO_URL)) | 347 | ISO_NAME = "%s_%s" % (self.ISO_PATH_HEADER, |
2265 | 348 | os.path.basename(self.ISO_URL)) | ||
2266 | 325 | self.PROTO = self.ISO_URL.partition(":")[0] | 349 | self.PROTO = self.ISO_URL.partition(":")[0] |
2267 | 326 | self.PATH_TO_ISO = "%s/%s" % (self.CACHE_ISO, ISO_NAME) | 350 | self.PATH_TO_ISO = "%s/%s" % (self.CACHE_ISO, ISO_NAME) |
2268 | 327 | 351 | ||
2269 | 328 | def launch_usb_creator(self): | 352 | def launch_usb_creator(self): |
2270 | 329 | if os.path.exists("/usr/bin/usb-creator-gtk"): | 353 | if os.path.exists("/usr/bin/usb-creator-gtk"): |
2272 | 330 | os.execv("/usr/bin/usb-creator-gtk", ["usb-creator-gtk", "-i", self.PATH_TO_ISO]) | 354 | os.execv("/usr/bin/usb-creator-gtk", |
2273 | 355 | ["usb-creator-gtk", "-i", self.PATH_TO_ISO]) | ||
2274 | 331 | else: | 356 | else: |
2276 | 332 | os.execv("/usr/bin/usb-creator-kde", ["usb-creator-kde", "-i", self.PATH_TO_ISO]) | 357 | os.execv("/usr/bin/usb-creator-kde", |
2277 | 358 | ["usb-creator-kde", "-i", self.PATH_TO_ISO]) | ||
2278 | 333 | 359 | ||
2279 | 334 | def is_disk_empty(self): | 360 | def is_disk_empty(self): |
2281 | 335 | (status, output) = commands.getstatusoutput("file %s | grep -qs 'empty'" % self.DISK_FILE) | 361 | (status, output) = commands.getstatusoutput( |
2282 | 362 | "file %s | grep -qs 'empty'" % self.DISK_FILE) | ||
2283 | 336 | if status == 0: | 363 | if status == 0: |
2284 | 337 | return True | 364 | return True |
2285 | 338 | return False | 365 | return False |
2286 | @@ -346,7 +373,8 @@ | |||
2287 | 346 | return True | 373 | return True |
2288 | 347 | 374 | ||
2289 | 348 | def is_iso_list_cache_expired(self): | 375 | def is_iso_list_cache_expired(self): |
2291 | 349 | cache_time = time.localtime(os.path.getmtime("%s/%s.isos" % (self.CACHE, self.p))) | 376 | cache_time = time.localtime(os.path.getmtime( |
2292 | 377 | "%s/%s.isos" % (self.CACHE, self.p))) | ||
2293 | 350 | local_time = time.localtime() | 378 | local_time = time.localtime() |
2294 | 351 | time_difference = time.mktime(local_time) - time.mktime(cache_time) | 379 | time_difference = time.mktime(local_time) - time.mktime(cache_time) |
2295 | 352 | # Check for new release at most every 12hrs (60*60*12 = 43200) | 380 | # Check for new release at most every 12hrs (60*60*12 = 43200) |
2296 | @@ -356,18 +384,26 @@ | |||
2297 | 356 | 384 | ||
2298 | 357 | def obtain_ubuntu_iso_list_from_repo(self): | 385 | def obtain_ubuntu_iso_list_from_repo(self): |
2299 | 358 | if self.p == 'cdimage': | 386 | if self.p == 'cdimage': |
2301 | 359 | (status, output) = commands.getstatusoutput("wget -q -O- http://cdimage.ubuntu.com/.manifest-daily | egrep '(amd64|i386)' | egrep '(current)'") | 387 | (status, output) = commands.getstatusoutput( |
2302 | 388 | "wget -q -O- http://cdimage.ubuntu.com/.manifest-daily " | ||
2303 | 389 | "| egrep '(amd64|i386)' | egrep '(current)'") | ||
2304 | 360 | elif self.p == 'releases': | 390 | elif self.p == 'releases': |
2306 | 361 | (status, output) = commands.getstatusoutput("wget -q -O- http://releases.ubuntu.com/.manifest | egrep '(amd64|i386)'") | 391 | (status, output) = commands.getstatusoutput( |
2307 | 392 | "wget -q -O- http://releases.ubuntu.com/.manifest " | ||
2308 | 393 | "| egrep '(amd64|i386)'") | ||
2309 | 362 | elif self.p == 'cloud-daily': | 394 | elif self.p == 'cloud-daily': |
2311 | 363 | (status, output) = commands.getstatusoutput("wget -q -O- http://cloud-images.ubuntu.com/.manifest-daily | egrep '(amd64|i386)'") | 395 | (status, output) = commands.getstatusoutput( |
2312 | 396 | "wget -q -O- http://cloud-images.ubuntu.com/.manifest-daily " | ||
2313 | 397 | "| egrep '(amd64|i386)'") | ||
2314 | 364 | elif self.p == 'cloud-releases': | 398 | elif self.p == 'cloud-releases': |
2316 | 365 | (status, output) = commands.getstatusoutput("wget -q -O- http://cloud-images.ubuntu.com/.manifest | egrep '(amd64|i386)'") | 399 | (status, output) = commands.getstatusoutput( |
2317 | 400 | "wget -q -O- http://cloud-images.ubuntu.com/.manifest " | ||
2318 | 401 | "| egrep '(amd64|i386)'") | ||
2319 | 366 | return output | 402 | return output |
2320 | 367 | 403 | ||
2321 | 368 | def update_ubuntu_iso_list_cache(self, str): | 404 | def update_ubuntu_iso_list_cache(self, str): |
2322 | 369 | try: | 405 | try: |
2324 | 370 | f = open("%s/%s.isos" % (self.CACHE, self.p),'w') | 406 | f = open("%s/%s.isos" % (self.CACHE, self.p), 'w') |
2325 | 371 | f.write(str) | 407 | f.write(str) |
2326 | 372 | f.close | 408 | f.close |
2327 | 373 | except IOError: | 409 | except IOError: |
2328 | @@ -390,16 +426,19 @@ | |||
2329 | 390 | self.r = codename[-1] | 426 | self.r = codename[-1] |
2330 | 391 | 427 | ||
2331 | 392 | def create_disk_file(self): | 428 | def create_disk_file(self): |
2333 | 393 | return tempfile.mkstemp(".img", "testdrive-disk-", "%s" % self.CACHE_IMG)[1] | 429 | return tempfile.mkstemp(".img", "testdrive-disk-", |
2334 | 430 | "%s" % self.CACHE_IMG)[1] | ||
2335 | 394 | 431 | ||
2336 | 395 | def prepare_cloud_img_tarball(self): | 432 | def prepare_cloud_img_tarball(self): |
2337 | 396 | untar = False | 433 | untar = False |
2339 | 397 | TAR_BASENAME = os.path.basename(self.PATH_TO_ISO).split(".tar.gz")[0].split("_")[-1] | 434 | TAR_BASENAME = os.path.basename(self.PATH_TO_ISO).split( |
2340 | 435 | ".tar.gz")[0].split("_")[-1] | ||
2341 | 398 | ORIG_DISK_NAME = "%s.img" % TAR_BASENAME | 436 | ORIG_DISK_NAME = "%s.img" % TAR_BASENAME |
2342 | 399 | FLOPPY_NAME = "%s-floppy" % TAR_BASENAME | 437 | FLOPPY_NAME = "%s-floppy" % TAR_BASENAME |
2343 | 400 | 438 | ||
2344 | 401 | image_path = "%s/%s" % (self.CACHE_ISO, ORIG_DISK_NAME) | 439 | image_path = "%s/%s" % (self.CACHE_ISO, ORIG_DISK_NAME) |
2345 | 402 | floppy_path = "%s/%s" % (self.CACHE_ISO, FLOPPY_NAME) | 440 | floppy_path = "%s/%s" % (self.CACHE_ISO, FLOPPY_NAME) |
2346 | 403 | 441 | ||
2348 | 404 | cmd = 'cd %s && tar Szxvf %s %s %s' % (self.CACHE_ISO, self.PATH_TO_ISO, ORIG_DISK_NAME, FLOPPY_NAME) | 442 | cmd = 'cd %s && tar Szxvf %s %s %s' % ( |
2349 | 443 | self.CACHE_ISO, self.PATH_TO_ISO, ORIG_DISK_NAME, FLOPPY_NAME) | ||
2350 | 405 | os.system(cmd) | 444 | os.system(cmd) |
2351 | 406 | 445 | ||
2352 | === modified file 'testdrive/virt/kvm.py' | |||
2353 | --- testdrive/virt/kvm.py 2013-05-20 17:12:31 +0000 | |||
2354 | +++ testdrive/virt/kvm.py 2013-10-06 20:59:44 +0000 | |||
2355 | @@ -19,10 +19,14 @@ | |||
2356 | 19 | # You should have received a copy of the GNU General Public License | 19 | # You should have received a copy of the GNU General Public License |
2357 | 20 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 20 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
2358 | 21 | 21 | ||
2360 | 22 | import commands, os, uuid, logging | 22 | import commands |
2361 | 23 | import os | ||
2362 | 24 | import uuid | ||
2363 | 25 | import logging | ||
2364 | 23 | 26 | ||
2365 | 24 | logger = logging.getLogger("testdrive.virt.kvm") | 27 | logger = logging.getLogger("testdrive.virt.kvm") |
2366 | 25 | 28 | ||
2367 | 29 | |||
2368 | 26 | class KVM: | 30 | class KVM: |
2369 | 27 | 31 | ||
2370 | 28 | def __init__(self, td): | 32 | def __init__(self, td): |
2371 | @@ -36,7 +40,8 @@ | |||
2372 | 36 | self.DISK_SIZE = td.DISK_SIZE | 40 | self.DISK_SIZE = td.DISK_SIZE |
2373 | 37 | 41 | ||
2374 | 38 | def is_disk_empty(self): | 42 | def is_disk_empty(self): |
2376 | 39 | (status, output) = commands.getstatusoutput("file %s | grep -qs 'empty'" % self.DISK_FILE) | 43 | (status, output) = commands.getstatusoutput( |
2377 | 44 | "file %s | grep -qs 'empty'" % self.DISK_FILE) | ||
2378 | 40 | if status == 0: | 45 | if status == 0: |
2379 | 41 | return True | 46 | return True |
2380 | 42 | return False | 47 | return False |
2381 | @@ -50,23 +55,32 @@ | |||
2382 | 50 | # Code to setup virtual machine | 55 | # Code to setup virtual machine |
2383 | 51 | def setup_virt(self): | 56 | def setup_virt(self): |
2384 | 52 | if self.p == 'cloud-daily' or self.p == 'cloud-releases': | 57 | if self.p == 'cloud-daily' or self.p == 'cloud-releases': |
2387 | 53 | #path = "%s/%s" % (self.CACHE_ISO, self.PATH_TO_ISO.split(".tar.gz")[0].split("_")[-1]) | 58 | #path = "%s/%s" % (self.CACHE_ISO, self.PATH_TO_ISO.split( |
2388 | 54 | path = "%s/%s" % (self.CACHE_ISO, os.path.basename(self.PATH_TO_ISO).split(".tar.gz")[0]) | 59 | # ".tar.gz")[0].split("_")[-1]) |
2389 | 60 | path = "%s/%s" % (self.CACHE_ISO, os.path.basename( | ||
2390 | 61 | self.PATH_TO_ISO).split(".tar.gz")[0]) | ||
2391 | 55 | self.ORIG_DISK = "%s.img" % path | 62 | self.ORIG_DISK = "%s.img" % path |
2392 | 56 | self.FLOPPY_FILE = "%s-floppy" % path | 63 | self.FLOPPY_FILE = "%s-floppy" % path |
2394 | 57 | self.run_or_die("kvm-img create -f qcow2 -b %s %s" % (self.ORIG_DISK, self.DISK_FILE)) | 64 | self.run_or_die("kvm-img create -f qcow2 -b %s %s" % ( |
2395 | 65 | self.ORIG_DISK, self.DISK_FILE)) | ||
2396 | 58 | elif not os.path.exists(self.DISK_FILE) or self.is_disk_empty(): | 66 | elif not os.path.exists(self.DISK_FILE) or self.is_disk_empty(): |
2397 | 59 | logger.info("Creating disk image [%s]..." % self.DISK_FILE) | 67 | logger.info("Creating disk image [%s]..." % self.DISK_FILE) |
2399 | 60 | self.run_or_die("kvm-img create -f qcow2 %s %s" % (self.DISK_FILE, self.DISK_SIZE)) | 68 | self.run_or_die("kvm-img create -f qcow2 %s %s" % ( |
2400 | 69 | self.DISK_FILE, self.DISK_SIZE)) | ||
2401 | 61 | 70 | ||
2402 | 62 | # Code launch virtual machine | 71 | # Code launch virtual machine |
2403 | 63 | def launch_virt(self): | 72 | def launch_virt(self): |
2404 | 64 | logger.info("Running the Virtual Machine...") | 73 | logger.info("Running the Virtual Machine...") |
2405 | 65 | UUID = uuid.uuid4() | 74 | UUID = uuid.uuid4() |
2406 | 66 | if self.p == 'cloud-daily' or self.p == 'cloud-releases': | 75 | if self.p == 'cloud-daily' or self.p == 'cloud-releases': |
2408 | 67 | cmd = "qemu-system-x86_64 -uuid %s -boot a -fda %s -drive file=%s,if=virtio %s" % (UUID, self.FLOPPY_FILE, self.DISK_FILE, self.KVM_ARGS) | 76 | cmd = "qemu-system-x86_64 -uuid %s -boot a -fda %s -drive file=%s," |
2409 | 77 | "if=virtio %s" % ( | ||
2410 | 78 | UUID, self.FLOPPY_FILE, self.DISK_FILE, self.KVM_ARGS) | ||
2411 | 68 | else: | 79 | else: |
2413 | 69 | cmd = "qemu-system-x86_64 -uuid %s -m %s -smp %s -cdrom %s -drive file=%s,if=virtio,cache=writeback,index=0 %s" % (UUID, self.MEM, self.SMP, self.PATH_TO_ISO, self.DISK_FILE, self.KVM_ARGS) | 80 | cmd = "qemu-system-x86_64 -uuid %s -m %s -smp %s -cdrom %s -drive", |
2414 | 81 | "file=%s,if=virtio,cache=writeback,index=0 %s" % ( | ||
2415 | 82 | UUID, self.MEM, self.SMP, self.PATH_TO_ISO, | ||
2416 | 83 | self.DISK_FILE, self.KVM_ARGS) | ||
2417 | 70 | return cmd | 84 | return cmd |
2418 | 71 | 85 | ||
2419 | 72 | def run(self, cmd): | 86 | def run(self, cmd): |
2420 | 73 | 87 | ||
2421 | === modified file 'testdrive/virt/parallels.py' | |||
2422 | --- testdrive/virt/parallels.py 2012-04-21 02:05:42 +0000 | |||
2423 | +++ testdrive/virt/parallels.py 2013-10-06 20:59:44 +0000 | |||
2424 | @@ -19,7 +19,10 @@ | |||
2425 | 19 | # You should have received a copy of the GNU General Public License | 19 | # You should have received a copy of the GNU General Public License |
2426 | 20 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 20 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
2427 | 21 | 21 | ||
2429 | 22 | import commands, os, time | 22 | import commands |
2430 | 23 | import os | ||
2431 | 24 | #import time | ||
2432 | 25 | |||
2433 | 23 | 26 | ||
2434 | 24 | class Parallels: | 27 | class Parallels: |
2435 | 25 | 28 | ||
2436 | @@ -34,7 +37,9 @@ | |||
2437 | 34 | 37 | ||
2438 | 35 | # Code to validate if virtualization is installed/supported | 38 | # Code to validate if virtualization is installed/supported |
2439 | 36 | def validate_virt(self): | 39 | def validate_virt(self): |
2441 | 37 | if commands.getstatusoutput("prlctl list %s | grep -qsv \"UUID\"" % self.VBOX_NAME)[0] == 0: | 40 | if commands.getstatusoutput( |
2442 | 41 | "prlctl list %s | grep -qsv \"UUID\"" % self.VBOX_NAME | ||
2443 | 42 | )[0] == 0: | ||
2444 | 38 | self.run_or_die("prlctl delete %s" % self.VBOX_NAME) | 43 | self.run_or_die("prlctl delete %s" % self.VBOX_NAME) |
2445 | 39 | 44 | ||
2446 | 40 | # Code to setup virtual machine | 45 | # Code to setup virtual machine |
2447 | @@ -42,18 +47,24 @@ | |||
2448 | 42 | self.DISK_SIZE = self.DISK_SIZE.replace("G", "000") | 47 | self.DISK_SIZE = self.DISK_SIZE.replace("G", "000") |
2449 | 43 | #info("Creating VM...") | 48 | #info("Creating VM...") |
2450 | 44 | print "INFO: Creating VM..." | 49 | print "INFO: Creating VM..." |
2453 | 45 | self.run_or_die("prlctl create %s --ostype linux --distribution ubuntu" % self.VBOX_NAME) | 50 | self.run_or_die("prlctl create %s --ostype linux --distribution ubuntu" |
2454 | 46 | self.run_or_die("prlctl set %s --memsize %s" % (self.VBOX_NAME, self.MEM)) | 51 | % self.VBOX_NAME) |
2455 | 52 | self.run_or_die("prlctl set %s --memsize %s" % ( | ||
2456 | 53 | self.VBOX_NAME, self.MEM)) | ||
2457 | 47 | self.run_or_die("prlctl set %s --device-del hdd0" % self.VBOX_NAME) | 54 | self.run_or_die("prlctl set %s --device-del hdd0" % self.VBOX_NAME) |
2460 | 48 | self.run_or_die("prlctl set %s --device-add hdd --type expand --size %s --iface scsi --position 0:0" % (self.VBOX_NAME, self.DISK_SIZE)) | 55 | self.run_or_die("prlctl set %s --device-add hdd --type expand --size", |
2461 | 49 | self.run_or_die("prlctl set %s --device-set cdrom0 --image %s" % (self.VBOX_NAME, self.PATH_TO_ISO)) | 56 | "%s --iface scsi --position 0:0" % ( |
2462 | 57 | self.VBOX_NAME, self.DISK_SIZE)) | ||
2463 | 58 | self.run_or_die("prlctl set %s --device-set cdrom0 --image %s" % ( | ||
2464 | 59 | self.VBOX_NAME, self.PATH_TO_ISO)) | ||
2465 | 50 | 60 | ||
2466 | 51 | # Code launch virtual machine | 61 | # Code launch virtual machine |
2467 | 52 | def launch_virt(self): | 62 | def launch_virt(self): |
2468 | 53 | #self.run_or_die("prlctl start %s" % self.td.VBOX_NAME) | 63 | #self.run_or_die("prlctl start %s" % self.td.VBOX_NAME) |
2469 | 54 | return "prlctl start %s" % self.VBOX_NAME | 64 | return "prlctl start %s" % self.VBOX_NAME |
2470 | 55 | # Loop as long as this VM is running | 65 | # Loop as long as this VM is running |
2472 | 56 | #while commands.getstatusoutput("prlctl list %s | grep -qs stopped" % self.td.VBOX_NAME)[0] != 0: | 66 | #while commands.getstatusoutput( |
2473 | 67 | #"prlctl list %s | grep -qs stopped" % self.td.VBOX_NAME)[0] != 0: | ||
2474 | 57 | # time.sleep(2) | 68 | # time.sleep(2) |
2475 | 58 | 69 | ||
2476 | 59 | def run(self, cmd): | 70 | def run(self, cmd): |
2477 | 60 | 71 | ||
2478 | === modified file 'testdrive/virt/virtualbox.py' | |||
2479 | --- testdrive/virt/virtualbox.py 2013-09-19 06:13:32 +0000 | |||
2480 | +++ testdrive/virt/virtualbox.py 2013-10-06 20:59:44 +0000 | |||
2481 | @@ -19,10 +19,14 @@ | |||
2482 | 19 | # You should have received a copy of the GNU General Public License | 19 | # You should have received a copy of the GNU General Public License |
2483 | 20 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 20 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
2484 | 21 | 21 | ||
2486 | 22 | import commands, os, time, logging | 22 | import commands |
2487 | 23 | import os | ||
2488 | 24 | #import time | ||
2489 | 25 | import logging | ||
2490 | 23 | 26 | ||
2491 | 24 | logger = logging.getLogger("testdrive.virt.vbox") | 27 | logger = logging.getLogger("testdrive.virt.vbox") |
2492 | 25 | 28 | ||
2493 | 29 | |||
2494 | 26 | class VBox: | 30 | class VBox: |
2495 | 27 | 31 | ||
2496 | 28 | def __init__(self, td): | 32 | def __init__(self, td): |
2497 | @@ -37,72 +41,98 @@ | |||
2498 | 37 | self.ISO_URL = td.ISO_URL | 41 | self.ISO_URL = td.ISO_URL |
2499 | 38 | 42 | ||
2500 | 39 | def is_disk_empty(self): | 43 | def is_disk_empty(self): |
2502 | 40 | (status, output) = commands.getstatusoutput("file %s | grep -qs 'empty'" % self.DISK_FILE) | 44 | (status, output) = commands.getstatusoutput( |
2503 | 45 | "file %s | grep -qs 'empty'" % self.DISK_FILE) | ||
2504 | 41 | if status == 0: | 46 | if status == 0: |
2505 | 42 | return True | 47 | return True |
2506 | 43 | return False | 48 | return False |
2507 | 44 | 49 | ||
2508 | 45 | # Code to validate if virtualization is installed/supported | 50 | # Code to validate if virtualization is installed/supported |
2509 | 46 | def validate_virt(self): | 51 | def validate_virt(self): |
2514 | 47 | # Determine which version of VirtualBox we have installed. What is returned is | 52 | # Determine which version of VirtualBox we have installed. What is |
2515 | 48 | # typically a string such as '4.1.0r55467', lets assume that the command line | 53 | # returned is typically a string such as '4.1.0r55467', lets assume |
2516 | 49 | # is consistent within 4.x.x versions extract this part of the | 54 | # that the command line is consistent within 4.x.x versions extract |
2517 | 50 | # version string for comparison later | 55 | # this part of the version string for comparison later |
2518 | 51 | self.vboxversion = commands.getoutput("VBoxManage --version") | 56 | self.vboxversion = commands.getoutput("VBoxManage --version") |
2521 | 52 | self.vboxversion = ( int(self.vboxversion.split(".")[0]), int(self.vboxversion.split(".")[1]) ) | 57 | self.vboxversion = (int(self.vboxversion.split(".")[0]), |
2522 | 53 | if self.vboxversion == (4,0) or self.vboxversion == (4,1) or self.vboxversion == (4,2): | 58 | int(self.vboxversion.split(".")[1])) |
2523 | 59 | if self.vboxversion == (4, 0) or self.vboxversion == (4, 1) \ | ||
2524 | 60 | or self.vboxversion == (4, 2): | ||
2525 | 54 | logger.info("VirtualBox %s.%s detected." % self.vboxversion) | 61 | logger.info("VirtualBox %s.%s detected." % self.vboxversion) |
2526 | 55 | else: | 62 | else: |
2528 | 56 | logger.error("ERROR: Unsupported version (%s.%s) of VirtualBox; please install v4.0, v4.1 or v4.2." % self.vboxversion) | 63 | logger.error( |
2529 | 64 | "ERROR: Unsupported version (%s.%s) of VirtualBox; please", | ||
2530 | 65 | "install v4.0, v4.1 or v4.2." % self.vboxversion) | ||
2531 | 57 | exit(0) | 66 | exit(0) |
2532 | 58 | 67 | ||
2533 | 59 | # Code to setup virtual machine | 68 | # Code to setup virtual machine |
2534 | 60 | def setup_virt(self): | 69 | def setup_virt(self): |
2536 | 61 | self.run("sed -i \":HardDisk.*%s:d\" %s/.VirtualBox/VirtualBox.xml" % (self.DISK_FILE, self.HOME)) | 70 | self.run("sed -i \":HardDisk.*%s:d\" %s/.VirtualBox/VirtualBox.xml" |
2537 | 71 | % (self.DISK_FILE, self.HOME)) | ||
2538 | 62 | if self.is_disk_empty(): | 72 | if self.is_disk_empty(): |
2539 | 63 | os.unlink(self.DISK_FILE) | 73 | os.unlink(self.DISK_FILE) |
2540 | 64 | if not os.path.exists(self.DISK_FILE): | 74 | if not os.path.exists(self.DISK_FILE): |
2541 | 65 | self.DISK_SIZE = self.DISK_SIZE.replace("G", "000") | 75 | self.DISK_SIZE = self.DISK_SIZE.replace("G", "000") |
2542 | 66 | logger.info("Creating disk image...") | 76 | logger.info("Creating disk image...") |
2546 | 67 | self.run_or_die("VBoxManage createhd --filename %s --size %s" % (self.DISK_FILE, self.DISK_SIZE)) | 77 | self.run_or_die("VBoxManage createhd --filename %s --size %s" |
2547 | 68 | if self.vboxversion == (4,0) or self.vboxversion == (4,1) or self.vboxversion == (4,2): | 78 | % (self.DISK_FILE, self.DISK_SIZE)) |
2548 | 69 | self.run("VBoxManage storageattach %s --storagectl \"IDE Controller\" --port 0 --device 0 --type hdd --medium none" % self.VBOX_NAME) | 79 | if self.vboxversion == (4, 0) or self.vboxversion == (4, 1) \ |
2549 | 80 | or self.vboxversion == (4, 2): | ||
2550 | 81 | self.run( | ||
2551 | 82 | "VBoxManage storageattach %s --storagectl \"IDE Controller\"", | ||
2552 | 83 | "--port 0 --device 0 --type hdd --medium none" | ||
2553 | 84 | % self.VBOX_NAME) | ||
2554 | 70 | if self.PATH_TO_ISO != "/dev/null": | 85 | if self.PATH_TO_ISO != "/dev/null": |
2556 | 71 | self.run("VBoxManage storageattach %s --storagectl \"IDE Controller\" --port 0 --device 1 --type dvddrive --medium none" % self.VBOX_NAME) | 86 | self.run("VBoxManage storageattach %s --storagectl \"IDE " |
2557 | 87 | "Controller\" --port 0 --device 1 --type dvddrive " | ||
2558 | 88 | "--medium none" % self.VBOX_NAME) | ||
2559 | 72 | #info("Creating the Virtual Machine...") | 89 | #info("Creating the Virtual Machine...") |
2560 | 73 | logger.info("Creating the Virtual Machine...") | 90 | logger.info("Creating the Virtual Machine...") |
2563 | 74 | if os.path.exists("%s/.VirtualBox/Machines/%s/%s.xml" % (self.HOME, self.VBOX_NAME, self.VBOX_NAME)): | 91 | if os.path.exists("%s/.VirtualBox/Machines/%s/%s.xml" % ( |
2564 | 75 | os.unlink("%s/.VirtualBox/Machines/%s/%s.xml" % (self.HOME, self.VBOX_NAME, self.VBOX_NAME)) | 92 | self.HOME, self.VBOX_NAME, self.VBOX_NAME)): |
2565 | 93 | os.unlink("%s/.VirtualBox/Machines/%s/%s.xml" % ( | ||
2566 | 94 | self.HOME, self.VBOX_NAME, self.VBOX_NAME)) | ||
2567 | 76 | self.run("VBoxManage unregistervm %s --delete" % self.VBOX_NAME) | 95 | self.run("VBoxManage unregistervm %s --delete" % self.VBOX_NAME) |
2570 | 77 | self.run_or_die("VBoxManage createvm --register --name %s" % self.VBOX_NAME) | 96 | self.run_or_die("VBoxManage createvm --register --name %s" |
2571 | 78 | self.run_or_die("VBoxManage modifyvm %s --memory %s" % (self.VBOX_NAME, self.MEM)) | 97 | % self.VBOX_NAME) |
2572 | 98 | self.run_or_die("VBoxManage modifyvm %s --memory %s" | ||
2573 | 99 | % (self.VBOX_NAME, self.MEM)) | ||
2574 | 79 | # This should probably support more than just Ubuntu... | 100 | # This should probably support more than just Ubuntu... |
2575 | 80 | if self.ISO_URL.find("amd64") >= 0: | 101 | if self.ISO_URL.find("amd64") >= 0: |
2576 | 81 | platform = "Ubuntu_64" | 102 | platform = "Ubuntu_64" |
2577 | 82 | else: | 103 | else: |
2578 | 83 | platform = "Ubuntu" | 104 | platform = "Ubuntu" |
2580 | 84 | self.run_or_die("VBoxManage modifyvm %s --ostype %s" % (self.VBOX_NAME, platform)) | 105 | self.run_or_die("VBoxManage modifyvm %s --ostype %s" |
2581 | 106 | % (self.VBOX_NAME, platform)) | ||
2582 | 85 | self.run_or_die("VBoxManage modifyvm %s --vram 128" % self.VBOX_NAME) | 107 | self.run_or_die("VBoxManage modifyvm %s --vram 128" % self.VBOX_NAME) |
2583 | 86 | self.run_or_die("VBoxManage modifyvm %s --boot1 disk" % self.VBOX_NAME) | 108 | self.run_or_die("VBoxManage modifyvm %s --boot1 disk" % self.VBOX_NAME) |
2584 | 87 | self.run_or_die("VBoxManage modifyvm %s --boot2 dvd" % self.VBOX_NAME) | 109 | self.run_or_die("VBoxManage modifyvm %s --boot2 dvd" % self.VBOX_NAME) |
2585 | 88 | self.run_or_die("VBoxManage modifyvm %s --nic1 nat" % self.VBOX_NAME) | 110 | self.run_or_die("VBoxManage modifyvm %s --nic1 nat" % self.VBOX_NAME) |
2587 | 89 | self.run_or_die("VBoxManage modifyvm %s --pae on" % self.VBOX_NAME) | 111 | self.run_or_die("VBoxManage modifyvm %s --pae on" % self.VBOX_NAME) |
2588 | 90 | 112 | ||
2589 | 91 | # Code launch virtual machine | 113 | # Code launch virtual machine |
2590 | 92 | def launch_virt(self): | 114 | def launch_virt(self): |
2591 | 93 | logger.info("Running the Virtual Machine...") | 115 | logger.info("Running the Virtual Machine...") |
2595 | 94 | if self.vboxversion == (4,0) or self.vboxversion == (4,1) or self.vboxversion == (4,2): | 116 | if self.vboxversion == (4, 0) or self.vboxversion == (4, 1) \ |
2596 | 95 | self.run_or_die("VBoxManage storagectl %s --name \"IDE Controller\" --add ide" % self.VBOX_NAME) | 117 | or self.vboxversion == (4, 2): |
2597 | 96 | self.run_or_die("VBoxManage storageattach %s --storagectl \"IDE Controller\" --port 0 --device 0 --type hdd --medium %s" % (self.VBOX_NAME, self.DISK_FILE)) | 118 | self.run_or_die("VBoxManage storagectl %s --name \"IDE", |
2598 | 119 | "Controller\" --add ide" % self.VBOX_NAME) | ||
2599 | 120 | self.run_or_die("VBoxManage storageattach %s --storagectl \"IDE", | ||
2600 | 121 | "Controller\" --port 0 --device 0 --type hdd", | ||
2601 | 122 | "--medium %s" % (self.VBOX_NAME, self.DISK_FILE)) | ||
2602 | 97 | if self.PATH_TO_ISO != "/dev/null": | 123 | if self.PATH_TO_ISO != "/dev/null": |
2604 | 98 | self.run_or_die("VBoxManage storageattach %s --storagectl \"IDE Controller\" --port 0 --device 1 --type dvddrive --medium %s" % (self.VBOX_NAME, self.PATH_TO_ISO)) | 124 | self.run_or_die( |
2605 | 125 | "VBoxManage storageattach %s --storagectl \"IDE", | ||
2606 | 126 | "Controller\"--port 0 --device 1 --type dvddrive", | ||
2607 | 127 | "--medium %s" % (self.VBOX_NAME, self.PATH_TO_ISO)) | ||
2608 | 99 | #self.run_or_die("VBoxManage startvm %s" % self.td.VBOX_NAME) | 128 | #self.run_or_die("VBoxManage startvm %s" % self.td.VBOX_NAME) |
2609 | 100 | return "VBoxManage startvm %s" % self.VBOX_NAME | 129 | return "VBoxManage startvm %s" % self.VBOX_NAME |
2610 | 101 | 130 | ||
2611 | 102 | # Give this VM a few seconds to start up | 131 | # Give this VM a few seconds to start up |
2612 | 103 | #time.sleep(5) | 132 | #time.sleep(5) |
2613 | 104 | # Loop as long as this VM is running | 133 | # Loop as long as this VM is running |
2615 | 105 | #while commands.getstatusoutput("VBoxManage list runningvms | grep -qs %s" % self.td.VBOX_NAME)[0] == 0: | 134 | #while commands.getstatusoutput("VBoxManage list runningvms | \ |
2616 | 135 | # grep -qs %s" % self.td.VBOX_NAME)[0] == 0: | ||
2617 | 106 | # time.sleep(2) | 136 | # time.sleep(2) |
2618 | 107 | 137 | ||
2619 | 108 | def run(self, cmd): | 138 | def run(self, cmd): |
2620 | 109 | 139 | ||
2621 | === modified file 'testdrivegtk/AboutTestdrivegtkDialog.py' | |||
2622 | --- testdrivegtk/AboutTestdrivegtkDialog.py 2012-05-15 20:43:24 +0000 | |||
2623 | +++ testdrivegtk/AboutTestdrivegtkDialog.py 2013-10-06 20:59:44 +0000 | |||
2624 | @@ -1,20 +1,20 @@ | |||
2625 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
2626 | 2 | ### BEGIN LICENSE | 2 | ### BEGIN LICENSE |
2627 | 3 | # Copyright (C) 2010 Canonical Ltd. | 3 | # Copyright (C) 2010 Canonical Ltd. |
2629 | 4 | # | 4 | # |
2630 | 5 | # Authors: | 5 | # Authors: |
2631 | 6 | # Andres Rodriguez <andreserl@ubuntu.com> | 6 | # Andres Rodriguez <andreserl@ubuntu.com> |
2635 | 7 | # | 7 | # |
2636 | 8 | # This program is free software: you can redistribute it and/or modify it | 8 | # This program is free software: you can redistribute it and/or modify it |
2637 | 9 | # under the terms of the GNU General Public License version 3, as published | 9 | # under the terms of the GNU General Public License version 3, as published |
2638 | 10 | # by the Free Software Foundation. | 10 | # by the Free Software Foundation. |
2643 | 11 | # | 11 | # |
2644 | 12 | # This program is distributed in the hope that it will be useful, but | 12 | # This program is distributed in the hope that it will be useful, but |
2645 | 13 | # WITHOUT ANY WARRANTY; without even the implied warranties of | 13 | # WITHOUT ANY WARRANTY; without even the implied warranties of |
2646 | 14 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | 14 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
2647 | 15 | # PURPOSE. See the GNU General Public License for more details. | 15 | # PURPOSE. See the GNU General Public License for more details. |
2650 | 16 | # | 16 | # |
2651 | 17 | # You should have received a copy of the GNU General Public License along | 17 | # You should have received a copy of the GNU General Public License along |
2652 | 18 | # with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | # with this program. If not, see <http://www.gnu.org/licenses/>. |
2653 | 19 | ### END LICENSE | 19 | ### END LICENSE |
2654 | 20 | 20 | ||
2655 | @@ -23,14 +23,16 @@ | |||
2656 | 23 | from testdrivegtk.helpers import get_builder | 23 | from testdrivegtk.helpers import get_builder |
2657 | 24 | 24 | ||
2658 | 25 | import gettext | 25 | import gettext |
2660 | 26 | from gettext import gettext as _ | 26 | _ = gettext.gettext |
2661 | 27 | gettext.textdomain('testdrive') | 27 | gettext.textdomain('testdrive') |
2662 | 28 | 28 | ||
2663 | 29 | import commands | 29 | import commands |
2665 | 30 | version = commands.getstatusoutput("dpkg -l testdrive-gtk | tail -n1 | awk '{print $3}'") | 30 | version = commands.getstatusoutput( |
2666 | 31 | "dpkg -l testdrive-gtk | tail -n1 | awk '{print $3}'") | ||
2667 | 31 | 32 | ||
2668 | 32 | __version__ = version[1].split("-0")[0] | 33 | __version__ = version[1].split("-0")[0] |
2670 | 33 | __licensenotice__ = 'This program is free software: you can redistribute it and/or modify\n\ | 34 | __licensenotice__ = """ |
2671 | 35 | 'This program is free software: you can redistribute it and/or modify\n\ | ||
2672 | 34 | it under the terms of the GNU General Public License as published by\n\ | 36 | it under the terms of the GNU General Public License as published by\n\ |
2673 | 35 | the Free Software Foundation, either version 3 of the License, or\n\ | 37 | the Free Software Foundation, either version 3 of the License, or\n\ |
2674 | 36 | (at your option) any later version.\n\ | 38 | (at your option) any later version.\n\ |
2675 | @@ -41,17 +43,18 @@ | |||
2676 | 41 | GNU General Public License for more details.\n\ | 43 | GNU General Public License for more details.\n\ |
2677 | 42 | \n\ | 44 | \n\ |
2678 | 43 | You should have received a copy of the GNU General Public License\n\ | 45 | You should have received a copy of the GNU General Public License\n\ |
2680 | 44 | along with this program. If not, see <http://www.gnu.org/licenses/>.' | 46 | along with this program. If not, see <http://www.gnu.org/licenses/>. """ |
2681 | 45 | __authors__ = ['Andres Rodriguez <andreserl@ubuntu.com>'] | 47 | __authors__ = ['Andres Rodriguez <andreserl@ubuntu.com>'] |
2683 | 46 | __description__ = 'PyGTK Front-end for TestDrive' | 48 | __description__ = _('PyGTK Front-end for TestDrive') |
2684 | 47 | __website__ = "https://launchpad.net/testdrive" | 49 | __website__ = "https://launchpad.net/testdrive" |
2685 | 48 | __copyright__ = "Copyright © 2010 - 2012 Canonical Ltd." | 50 | __copyright__ = "Copyright © 2010 - 2012 Canonical Ltd." |
2686 | 49 | 51 | ||
2687 | 52 | |||
2688 | 50 | class AboutTestdrivegtkDialog(gtk.AboutDialog): | 53 | class AboutTestdrivegtkDialog(gtk.AboutDialog): |
2689 | 51 | __gtype_name__ = "AboutTestdrivegtkDialog" | 54 | __gtype_name__ = "AboutTestdrivegtkDialog" |
2690 | 52 | 55 | ||
2691 | 53 | def __new__(cls): | 56 | def __new__(cls): |
2693 | 54 | """Special static method that's automatically called by Python when | 57 | """Special static method that's automatically called by Python when |
2694 | 55 | constructing a new instance of this class. | 58 | constructing a new instance of this class. |
2695 | 56 | 59 | ||
2696 | 57 | Returns a fully instantiated AboutTestdrivegtkDialog object. | 60 | Returns a fully instantiated AboutTestdrivegtkDialog object. |
2697 | @@ -77,7 +80,7 @@ | |||
2698 | 77 | 80 | ||
2699 | 78 | # Code for other initialization actions should be added here. | 81 | # Code for other initialization actions should be added here. |
2700 | 79 | dialog = builder.get_object("about_testdrivegtk_dialog") | 82 | dialog = builder.get_object("about_testdrivegtk_dialog") |
2702 | 80 | 83 | ||
2703 | 81 | dialog.set_version(__version__) | 84 | dialog.set_version(__version__) |
2704 | 82 | dialog.set_authors(__authors__) | 85 | dialog.set_authors(__authors__) |
2705 | 83 | dialog.set_comments(__description__) | 86 | dialog.set_comments(__description__) |
2706 | 84 | 87 | ||
2707 | === modified file 'testdrivegtk/AddOtherTestdrivegtkDialog.py' | |||
2708 | --- testdrivegtk/AddOtherTestdrivegtkDialog.py 2012-04-21 02:05:42 +0000 | |||
2709 | +++ testdrivegtk/AddOtherTestdrivegtkDialog.py 2013-10-06 20:59:44 +0000 | |||
2710 | @@ -6,17 +6,20 @@ | |||
2711 | 6 | import gtk | 6 | import gtk |
2712 | 7 | 7 | ||
2713 | 8 | from testdrivegtk.helpers import get_builder | 8 | from testdrivegtk.helpers import get_builder |
2715 | 9 | import os, string, commands | 9 | import os |
2716 | 10 | import string | ||
2717 | 11 | import commands | ||
2718 | 10 | 12 | ||
2719 | 11 | import gettext | 13 | import gettext |
2721 | 12 | from gettext import gettext as _ | 14 | _ = gettext.gettext |
2722 | 13 | gettext.textdomain('testdrive') | 15 | gettext.textdomain('testdrive') |
2723 | 14 | 16 | ||
2724 | 17 | |||
2725 | 15 | class AddOtherTestdrivegtkDialog(gtk.Dialog): | 18 | class AddOtherTestdrivegtkDialog(gtk.Dialog): |
2726 | 16 | __gtype_name__ = "AddothertestdrivegtkDialog" | 19 | __gtype_name__ = "AddothertestdrivegtkDialog" |
2727 | 17 | 20 | ||
2728 | 18 | def __new__(cls, cache): | 21 | def __new__(cls, cache): |
2730 | 19 | """Special static method that's automatically called by Python when | 22 | """Special static method that's automatically called by Python when |
2731 | 20 | constructing a new instance of this class. | 23 | constructing a new instance of this class. |
2732 | 21 | 24 | ||
2733 | 22 | Returns a fully instantiated AddothertestdrivegtkDialog object. | 25 | Returns a fully instantiated AddothertestdrivegtkDialog object. |
2734 | @@ -57,7 +60,7 @@ | |||
2735 | 57 | # Saving changes in the isos file | 60 | # Saving changes in the isos file |
2736 | 58 | path = "%s/other.isos" % self.CACHE | 61 | path = "%s/other.isos" % self.CACHE |
2737 | 59 | try: | 62 | try: |
2739 | 60 | f = open(path,'w') | 63 | f = open(path, 'w') |
2740 | 61 | for item in self.liststore: | 64 | for item in self.liststore: |
2741 | 62 | iso = "other\tother\t\t%s\t\t%s\n" % (item[2], item[1]) | 65 | iso = "other\tother\t\t%s\t\t%s\n" % (item[2], item[1]) |
2742 | 63 | f.write(iso) | 66 | f.write(iso) |
2743 | @@ -83,15 +86,17 @@ | |||
2744 | 83 | self.PROTO = None | 86 | self.PROTO = None |
2745 | 84 | 87 | ||
2746 | 85 | def on_error_dlg(self, data=None): | 88 | def on_error_dlg(self, data=None): |
2749 | 86 | errorbox = gtk.MessageDialog(self, | 89 | errorbox = gtk.MessageDialog( |
2750 | 87 | gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_ERROR, | 90 | self, |
2751 | 91 | gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_ERROR, | ||
2752 | 88 | gtk.BUTTONS_CLOSE, data) | 92 | gtk.BUTTONS_CLOSE, data) |
2753 | 89 | response = errorbox.run() | 93 | response = errorbox.run() |
2754 | 90 | errorbox.destroy() | 94 | errorbox.destroy() |
2755 | 91 | 95 | ||
2756 | 92 | def on_info_dlg(self, data=None): | 96 | def on_info_dlg(self, data=None): |
2759 | 93 | errorbox = gtk.MessageDialog(self, | 97 | errorbox = gtk.MessageDialog( |
2760 | 94 | gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO, | 98 | self, |
2761 | 99 | gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO, | ||
2762 | 95 | gtk.BUTTONS_CLOSE, data) | 100 | gtk.BUTTONS_CLOSE, data) |
2763 | 96 | errorbox.run() | 101 | errorbox.run() |
2764 | 97 | errorbox.destroy() | 102 | errorbox.destroy() |
2765 | @@ -116,7 +121,7 @@ | |||
2766 | 116 | self.cb_sync_proto.set_active(0) | 121 | self.cb_sync_proto.set_active(0) |
2767 | 117 | 122 | ||
2768 | 118 | def on_btn_del_iso_clicked(self, widget): | 123 | def on_btn_del_iso_clicked(self, widget): |
2770 | 119 | # When Delete button is clicked, deletes it from the list store, | 124 | # When Delete button is clicked, deletes it from the list store, |
2771 | 120 | # but changes are not saved | 125 | # but changes are not saved |
2772 | 121 | selection = self.treeview.get_selection() | 126 | selection = self.treeview.get_selection() |
2773 | 122 | model, iter = selection.get_selected() | 127 | model, iter = selection.get_selected() |
2774 | @@ -129,7 +134,7 @@ | |||
2775 | 129 | ###### Validating that the input URL si correct and exists ####### | 134 | ###### Validating that the input URL si correct and exists ####### |
2776 | 130 | ################################################################## | 135 | ################################################################## |
2777 | 131 | file = self.txt_other_url.get_text().strip() | 136 | file = self.txt_other_url.get_text().strip() |
2779 | 132 | desc = self.txt_other_desc.get_text().replace(' ','-') | 137 | desc = self.txt_other_desc.get_text().replace(' ', '-') |
2780 | 133 | 138 | ||
2781 | 134 | if len(desc) == 0: | 139 | if len(desc) == 0: |
2782 | 135 | self.on_error_dlg(_("Please insert a Description")) | 140 | self.on_error_dlg(_("Please insert a Description")) |
2783 | @@ -147,9 +152,10 @@ | |||
2784 | 147 | if string.find(file, "%s://" % i) == 0: | 152 | if string.find(file, "%s://" % i) == 0: |
2785 | 148 | self.url = file | 153 | self.url = file |
2786 | 149 | #If it's a local path, test it for viability | 154 | #If it's a local path, test it for viability |
2788 | 150 | if commands.getstatusoutput("file \"%s\" | grep -qs \"ISO 9660\"" % file)[0] == 0: | 155 | if commands.getstatusoutput("file \"%s\" | grep -qs \"ISO 9660\"" |
2789 | 156 | % file)[0] == 0: | ||
2790 | 151 | #return("file://%s" % file) | 157 | #return("file://%s" % file) |
2792 | 152 | self.url ="file://%s" % file | 158 | self.url = "file://%s" % file |
2793 | 153 | 159 | ||
2794 | 154 | if self.url is None: | 160 | if self.url is None: |
2795 | 155 | self.on_error_dlg(_("Invalid ISO URL [%s]") % file) | 161 | self.on_error_dlg(_("Invalid ISO URL [%s]") % file) |
2796 | @@ -163,12 +169,14 @@ | |||
2797 | 163 | url = url.replace(proto, 'http') | 169 | url = url.replace(proto, 'http') |
2798 | 164 | if proto == 'file': | 170 | if proto == 'file': |
2799 | 165 | pass | 171 | pass |
2801 | 166 | elif os.system("wget --spider -S %s 2>&1 | grep 'HTTP/1.. 200 OK'" % url) != 0: | 172 | elif os.system("wget --spider -S %s 2>&1 | grep 'HTTP/1.. 200 OK'" |
2802 | 173 | % url) != 0: | ||
2803 | 167 | self.on_error_dlg(_("ISO not found at [%s]") % url) | 174 | self.on_error_dlg(_("ISO not found at [%s]") % url) |
2805 | 168 | return False | 175 | return False |
2806 | 169 | 176 | ||
2807 | 170 | if self.PROTO is None: | 177 | if self.PROTO is None: |
2809 | 171 | self.on_error_dlg(_("No sync protocol has been selected, please select one.")) | 178 | self.on_error_dlg(_("No sync protocol has been selected, " |
2810 | 179 | "please select one.")) | ||
2811 | 172 | return False | 180 | return False |
2812 | 173 | else: | 181 | else: |
2813 | 174 | return True | 182 | return True |
2814 | @@ -205,9 +213,11 @@ | |||
2815 | 205 | if n >= 1: | 213 | if n >= 1: |
2816 | 206 | self.treeview.columns[n].cell.set_property('editable', True) | 214 | self.treeview.columns[n].cell.set_property('editable', True) |
2817 | 207 | # add the cells to the columns | 215 | # add the cells to the columns |
2819 | 208 | self.treeview.columns[n].pack_start(self.treeview.columns[n].cell, True) | 216 | self.treeview.columns[n].pack_start( |
2820 | 217 | self.treeview.columns[n].cell, True) | ||
2821 | 209 | # set the cell attributes to the appropriate liststore column | 218 | # set the cell attributes to the appropriate liststore column |
2823 | 210 | self.treeview.columns[n].set_attributes(self.treeview.columns[n].cell, text=n) | 219 | self.treeview.columns[n].set_attributes( |
2824 | 220 | self.treeview.columns[n].cell, text=n) | ||
2825 | 211 | 221 | ||
2826 | 212 | self.btn_add_other = self.builder.get_object("btn_add_iso") | 222 | self.btn_add_other = self.builder.get_object("btn_add_iso") |
2827 | 213 | self.btn_add_other.connect("clicked", self.on_btn_add_iso_clicked) | 223 | self.btn_add_other.connect("clicked", self.on_btn_add_iso_clicked) |
2828 | @@ -217,7 +227,8 @@ | |||
2829 | 217 | 227 | ||
2830 | 218 | # Expander | 228 | # Expander |
2831 | 219 | self.ex_other_iso_list = self.builder.get_object("ex_other_iso_list") | 229 | self.ex_other_iso_list = self.builder.get_object("ex_other_iso_list") |
2833 | 220 | self.ex_other_iso_list.connect('notify::expanded', self.on_iso_list_expanded) | 230 | self.ex_other_iso_list.connect( |
2834 | 231 | 'notify::expanded', self.on_iso_list_expanded) | ||
2835 | 221 | self.scroll_iso_list = self.builder.get_object("scrolledwindow1") | 232 | self.scroll_iso_list = self.builder.get_object("scrolledwindow1") |
2836 | 222 | self.ex_other_iso_list.remove(self.ex_other_iso_list.child) | 233 | self.ex_other_iso_list.remove(self.ex_other_iso_list.child) |
2837 | 223 | 234 | ||
2838 | @@ -232,7 +243,8 @@ | |||
2839 | 232 | self.cb_sync_proto.connect('changed', self.on_select_sync_proto) | 243 | self.cb_sync_proto.connect('changed', self.on_select_sync_proto) |
2840 | 233 | self.cb_sync_proto.set_active(0) | 244 | self.cb_sync_proto.set_active(0) |
2841 | 234 | self.cb_sync_proto.show() | 245 | self.cb_sync_proto.show() |
2843 | 235 | self.layout_table.attach(self.cb_sync_proto, 1,3,2,3, gtk.FILL | gtk.EXPAND, gtk.SHRINK) | 246 | self.layout_table.attach( |
2844 | 247 | self.cb_sync_proto, 1, 3, 2, 3, gtk.FILL | gtk.EXPAND, gtk.SHRINK) | ||
2845 | 236 | 248 | ||
2846 | 237 | def get_other_isos_list_from_cache(self): | 249 | def get_other_isos_list_from_cache(self): |
2847 | 238 | ################################################################## | 250 | ################################################################## |
2848 | 239 | 251 | ||
2849 | === modified file 'testdrivegtk/PreferencesTestdrivegtkDialog.py' | |||
2850 | --- testdrivegtk/PreferencesTestdrivegtkDialog.py 2013-08-10 21:31:38 +0000 | |||
2851 | +++ testdrivegtk/PreferencesTestdrivegtkDialog.py 2013-10-06 20:59:44 +0000 | |||
2852 | @@ -1,20 +1,20 @@ | |||
2853 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
2854 | 2 | ### BEGIN LICENSE | 2 | ### BEGIN LICENSE |
2855 | 3 | # Copyright (C) 2010 Canonical Ltd. | 3 | # Copyright (C) 2010 Canonical Ltd. |
2857 | 4 | # | 4 | # |
2858 | 5 | # Authors: | 5 | # Authors: |
2859 | 6 | # Andres Rodriguez <andreserl@ubuntu.com> | 6 | # Andres Rodriguez <andreserl@ubuntu.com> |
2863 | 7 | # | 7 | # |
2864 | 8 | # This program is free software: you can redistribute it and/or modify it | 8 | # This program is free software: you can redistribute it and/or modify it |
2865 | 9 | # under the terms of the GNU General Public License version 3, as published | 9 | # under the terms of the GNU General Public License version 3, as published |
2866 | 10 | # by the Free Software Foundation. | 10 | # by the Free Software Foundation. |
2871 | 11 | # | 11 | # |
2872 | 12 | # This program is distributed in the hope that it will be useful, but | 12 | # This program is distributed in the hope that it will be useful, but |
2873 | 13 | # WITHOUT ANY WARRANTY; without even the implied warranties of | 13 | # WITHOUT ANY WARRANTY; without even the implied warranties of |
2874 | 14 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | 14 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
2875 | 15 | # PURPOSE. See the GNU General Public License for more details. | 15 | # PURPOSE. See the GNU General Public License for more details. |
2878 | 16 | # | 16 | # |
2879 | 17 | # You should have received a copy of the GNU General Public License along | 17 | # You should have received a copy of the GNU General Public License along |
2880 | 18 | # with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | # with this program. If not, see <http://www.gnu.org/licenses/>. |
2881 | 19 | ### END LICENSE | 19 | ### END LICENSE |
2882 | 20 | 20 | ||
2883 | @@ -29,19 +29,20 @@ | |||
2884 | 29 | from testdrivegtk.helpers import get_builder | 29 | from testdrivegtk.helpers import get_builder |
2885 | 30 | 30 | ||
2886 | 31 | import gettext | 31 | import gettext |
2888 | 32 | from gettext import gettext as _ | 32 | _ = gettext.gettext |
2889 | 33 | gettext.textdomain('testdrive') | 33 | gettext.textdomain('testdrive') |
2890 | 34 | 34 | ||
2891 | 35 | ISO_REPOSITORY = ['cdimage', 'releases'] | 35 | ISO_REPOSITORY = ['cdimage', 'releases'] |
2894 | 36 | MEM_SIZE_TAB = ['256', '384', '512', '1024', '2048',_('Other...')] | 36 | MEM_SIZE_TAB = ['256', '384', '512', '1024', '2048', _('Other...')] |
2895 | 37 | DISK_SIZE_TAB = ['4', '6', '8', '10', '16',_('Other...')] | 37 | DISK_SIZE_TAB = ['4', '6', '8', '10', '16', _('Other...')] |
2896 | 38 | |||
2897 | 38 | 39 | ||
2898 | 39 | class PreferencesTestdrivegtkDialog(gtk.Dialog): | 40 | class PreferencesTestdrivegtkDialog(gtk.Dialog): |
2899 | 40 | __gtype_name__ = "PreferencesTestdrivegtkDialog" | 41 | __gtype_name__ = "PreferencesTestdrivegtkDialog" |
2900 | 41 | preferences = {} | 42 | preferences = {} |
2901 | 42 | 43 | ||
2902 | 43 | def __new__(cls): | 44 | def __new__(cls): |
2904 | 44 | """Special static method that's automatically called by Python when | 45 | """Special static method that's automatically called by Python when |
2905 | 45 | constructing a new instance of this class. | 46 | constructing a new instance of this class. |
2906 | 46 | 47 | ||
2907 | 47 | Returns a fully instantiated PreferencesTestdrivegtkDialog object. | 48 | Returns a fully instantiated PreferencesTestdrivegtkDialog object. |
2908 | @@ -96,7 +97,7 @@ | |||
2909 | 96 | self.initialize_widgets() | 97 | self.initialize_widgets() |
2910 | 97 | self.initialize_widgets_values() | 98 | self.initialize_widgets_values() |
2911 | 98 | self.logger.debug(_('finish_initialization()')) | 99 | self.logger.debug(_('finish_initialization()')) |
2913 | 99 | 100 | ||
2914 | 100 | self.builder.get_object("txt_gral_cache") | 101 | self.builder.get_object("txt_gral_cache") |
2915 | 101 | 102 | ||
2916 | 102 | def initialize_variables(self): | 103 | def initialize_variables(self): |
2917 | @@ -119,11 +120,15 @@ | |||
2918 | 119 | self.txt_iso_list_cache = self.builder.get_object("txt_iso_list_cache") | 120 | self.txt_iso_list_cache = self.builder.get_object("txt_iso_list_cache") |
2919 | 120 | # Clean Ups | 121 | # Clean Ups |
2920 | 121 | self.btn_iso_clean = self.builder.get_object("btn_iso_clean") | 122 | self.btn_iso_clean = self.builder.get_object("btn_iso_clean") |
2922 | 122 | self.btn_iso_clean.connect("clicked", self.on_cache_cleanup_clicked, self.td.CACHE_ISO) | 123 | self.btn_iso_clean.connect( |
2923 | 124 | "clicked", self.on_cache_cleanup_clicked, self.td.CACHE_ISO) | ||
2924 | 123 | self.btn_img_clean = self.builder.get_object("btn_img_clean") | 125 | self.btn_img_clean = self.builder.get_object("btn_img_clean") |
2928 | 124 | self.btn_img_clean.connect("clicked", self.on_cache_cleanup_clicked, self.td.CACHE_IMG) | 126 | self.btn_img_clean.connect( |
2929 | 125 | self.btn_update_iso_list_cache = self.builder.get_object("btn_update_iso_list_cache") | 127 | "clicked", self.on_cache_cleanup_clicked, self.td.CACHE_IMG) |
2930 | 126 | self.btn_update_iso_list_cache.connect("clicked", self.on_force_iso_list_update) | 128 | self.btn_update_iso_list_cache = self.builder.get_object( |
2931 | 129 | "btn_update_iso_list_cache") | ||
2932 | 130 | self.btn_update_iso_list_cache.connect( | ||
2933 | 131 | "clicked", self.on_force_iso_list_update) | ||
2934 | 127 | 132 | ||
2935 | 128 | # Ubuntu Releases | 133 | # Ubuntu Releases |
2936 | 129 | self.chk_arch_i386 = self.builder.get_object("chk_arch_i386") | 134 | self.chk_arch_i386 = self.builder.get_object("chk_arch_i386") |
2937 | @@ -136,33 +141,37 @@ | |||
2938 | 136 | self.cb_ubuntu_repo = gtk.combo_box_new_text() | 141 | self.cb_ubuntu_repo = gtk.combo_box_new_text() |
2939 | 137 | self.cb_ubuntu_repo.set_size_request(260, -1) | 142 | self.cb_ubuntu_repo.set_size_request(260, -1) |
2940 | 138 | self.cb_ubuntu_repo.append_text(_('Select Repository:')) | 143 | self.cb_ubuntu_repo.append_text(_('Select Repository:')) |
2942 | 139 | for repo in ISO_REPOSITORY: | 144 | for repo in ISO_REPOSITORY: |
2943 | 140 | self.cb_ubuntu_repo.append_text(repo) | 145 | self.cb_ubuntu_repo.append_text(repo) |
2944 | 141 | self.cb_ubuntu_repo.connect('changed', self.on_select_iso_image_repo) | 146 | self.cb_ubuntu_repo.connect('changed', self.on_select_iso_image_repo) |
2945 | 142 | self.cb_ubuntu_repo.set_active(0) | 147 | self.cb_ubuntu_repo.set_active(0) |
2946 | 143 | self.cb_ubuntu_repo.show() | 148 | self.cb_ubuntu_repo.show() |
2948 | 144 | self.tb_general_prefs.attach(self.cb_ubuntu_repo, 1,2,7,8) | 149 | self.tb_general_prefs.attach(self.cb_ubuntu_repo, 1, 2, 7, 8) |
2949 | 145 | # Ubuntu Releases Combo Box | 150 | # Ubuntu Releases Combo Box |
2950 | 146 | self.cb_ubuntu_release = gtk.combo_box_new_text() | 151 | self.cb_ubuntu_release = gtk.combo_box_new_text() |
2951 | 147 | self.cb_ubuntu_release.set_size_request(260, -1) | 152 | self.cb_ubuntu_release.set_size_request(260, -1) |
2953 | 148 | self.cb_ubuntu_release.connect('changed', self.on_select_ubuntu_release) | 153 | self.cb_ubuntu_release.connect( |
2954 | 154 | 'changed', self.on_select_ubuntu_release) | ||
2955 | 149 | self.cb_ubuntu_release.append_text(_('Select Release:')) | 155 | self.cb_ubuntu_release.append_text(_('Select Release:')) |
2956 | 150 | self.cb_ubuntu_release.set_active(0) | 156 | self.cb_ubuntu_release.set_active(0) |
2957 | 151 | self.cb_ubuntu_release.show() | 157 | self.cb_ubuntu_release.show() |
2960 | 152 | self.tb_general_prefs.attach(self.cb_ubuntu_release, 1,2,8,9) | 158 | self.tb_general_prefs.attach(self.cb_ubuntu_release, 1, 2, 8, 9) |
2961 | 153 | 159 | ||
2962 | 154 | # Initialize Virtualization Method Options | 160 | # Initialize Virtualization Method Options |
2963 | 155 | self.opt_virt_kvm = self.builder.get_object("opt_virt_kvm") | 161 | self.opt_virt_kvm = self.builder.get_object("opt_virt_kvm") |
2965 | 156 | self.opt_virt_kvm.connect("toggled", self.on_select_virt_method, "kvm") | 162 | self.opt_virt_kvm.connect( |
2966 | 163 | "toggled", self.on_select_virt_method, "kvm") | ||
2967 | 157 | self.opt_virt_vbox = self.builder.get_object("opt_virt_vbox") | 164 | self.opt_virt_vbox = self.builder.get_object("opt_virt_vbox") |
2969 | 158 | self.opt_virt_vbox.connect("toggled", self.on_select_virt_method, "virtualbox") | 165 | self.opt_virt_vbox.connect( |
2970 | 166 | "toggled", self.on_select_virt_method, "virtualbox") | ||
2971 | 159 | self.opt_virt_parallels = self.builder.get_object("opt_virt_parallels") | 167 | self.opt_virt_parallels = self.builder.get_object("opt_virt_parallels") |
2973 | 160 | self.opt_virt_parallels.connect("toggled", self.on_select_virt_method, "parallels") | 168 | self.opt_virt_parallels.connect( |
2974 | 169 | "toggled", self.on_select_virt_method, "parallels") | ||
2975 | 161 | 170 | ||
2976 | 162 | # Initialize Memory Options | 171 | # Initialize Memory Options |
2977 | 163 | self.cbe_mem_size = self.builder.get_object("cbe_mem_size") | 172 | self.cbe_mem_size = self.builder.get_object("cbe_mem_size") |
2978 | 164 | self.cbe_mem_size.remove_text(0) | 173 | self.cbe_mem_size.remove_text(0) |
2980 | 165 | for mem in MEM_SIZE_TAB: | 174 | for mem in MEM_SIZE_TAB: |
2981 | 166 | self.cbe_mem_size.append_text(mem) | 175 | self.cbe_mem_size.append_text(mem) |
2982 | 167 | self.cbe_mem_size.connect('changed', self.on_select_mem) | 176 | self.cbe_mem_size.connect('changed', self.on_select_mem) |
2983 | 168 | 177 | ||
2984 | @@ -183,30 +192,42 @@ | |||
2985 | 183 | self.lb_smp_available = self.builder.get_object("lb_smp_available") | 192 | self.lb_smp_available = self.builder.get_object("lb_smp_available") |
2986 | 184 | 193 | ||
2987 | 185 | # Flavors | 194 | # Flavors |
2989 | 186 | self.chk_flavor_ubuntu = self.builder.get_object("chk_flavor_ubuntu") | 195 | self.chk_flavor_ubuntu = self.builder.get_object( |
2990 | 196 | "chk_flavor_ubuntu") | ||
2991 | 187 | self.chk_flavor_ubuntu.connect("clicked", self.on_select_flavors) | 197 | self.chk_flavor_ubuntu.connect("clicked", self.on_select_flavors) |
2993 | 188 | self.chk_flavor_kubuntu = self.builder.get_object("chk_flavor_kubuntu") | 198 | self.chk_flavor_kubuntu = self.builder.get_object( |
2994 | 199 | "chk_flavor_kubuntu") | ||
2995 | 189 | self.chk_flavor_kubuntu.connect("clicked", self.on_select_flavors) | 200 | self.chk_flavor_kubuntu.connect("clicked", self.on_select_flavors) |
2997 | 190 | self.chk_flavor_xubuntu = self.builder.get_object("chk_flavor_xubuntu") | 201 | self.chk_flavor_xubuntu = self.builder.get_object( |
2998 | 202 | "chk_flavor_xubuntu") | ||
2999 | 191 | self.chk_flavor_xubuntu.connect("clicked", self.on_select_flavors) | 203 | self.chk_flavor_xubuntu.connect("clicked", self.on_select_flavors) |
3001 | 192 | self.chk_flavor_edubuntu = self.builder.get_object("chk_flavor_edubuntu") | 204 | self.chk_flavor_edubuntu = self.builder.get_object( |
3002 | 205 | "chk_flavor_edubuntu") | ||
3003 | 193 | self.chk_flavor_edubuntu.connect("clicked", self.on_select_flavors) | 206 | self.chk_flavor_edubuntu.connect("clicked", self.on_select_flavors) |
3005 | 194 | self.chk_flavor_mythbuntu = self.builder.get_object("chk_flavor_mythbuntu") | 207 | self.chk_flavor_mythbuntu = self.builder.get_object( |
3006 | 208 | "chk_flavor_mythbuntu") | ||
3007 | 195 | self.chk_flavor_mythbuntu.connect("clicked", self.on_select_flavors) | 209 | self.chk_flavor_mythbuntu.connect("clicked", self.on_select_flavors) |
3009 | 196 | self.chk_flavor_ubuntustudio = self.builder.get_object("chk_flavor_ubuntustudio") | 210 | self.chk_flavor_ubuntustudio = self.builder.get_object( |
3010 | 211 | "chk_flavor_ubuntustudio") | ||
3011 | 197 | self.chk_flavor_ubuntustudio.connect("clicked", self.on_select_flavors) | 212 | self.chk_flavor_ubuntustudio.connect("clicked", self.on_select_flavors) |
3013 | 198 | self.chk_flavor_lubuntu = self.builder.get_object("chk_flavor_lubuntu") | 213 | self.chk_flavor_lubuntu = self.builder.get_object( |
3014 | 214 | "chk_flavor_lubuntu") | ||
3015 | 199 | self.chk_flavor_lubuntu.connect("clicked", self.on_select_flavors) | 215 | self.chk_flavor_lubuntu.connect("clicked", self.on_select_flavors) |
3017 | 200 | self.chk_flavor_ubuntukylin = self.builder.get_object("chk_flavor_ubuntukylin") | 216 | self.chk_flavor_ubuntukylin = self.builder.get_object( |
3018 | 217 | "chk_flavor_ubuntukylin") | ||
3019 | 201 | self.chk_flavor_ubuntukylin.connect("clicked", self.on_select_flavors) | 218 | self.chk_flavor_ubuntukylin.connect("clicked", self.on_select_flavors) |
3021 | 202 | self.chk_flavor_other = self.builder.get_object("chk_flavor_other") | 219 | self.chk_flavor_other = self.builder.get_object( |
3022 | 220 | "chk_flavor_other") | ||
3023 | 203 | self.chk_flavor_other.connect("clicked", self.on_select_flavors) | 221 | self.chk_flavor_other.connect("clicked", self.on_select_flavors) |
3024 | 204 | 222 | ||
3025 | 205 | def initialize_config_files(self): | 223 | def initialize_config_files(self): |
3026 | 206 | ################################################################## | 224 | ################################################################## |
3027 | 207 | ########### Read the configuration file for settings ############# | 225 | ########### Read the configuration file for settings ############# |
3028 | 208 | ################################################################## | 226 | ################################################################## |
3030 | 209 | config_files = ["/etc/%s" % self.td.PKGRC, "%s/.%s" % (self.td.HOME, self.td.PKGRC), "%s/.config/%s/%s" % (self.td.HOME, self.td.PKG, self.td.PKGRC) ] | 227 | config_files = ["/etc/%s" % self.td.PKGRC, |
3031 | 228 | "%s/.%s" % (self.td.HOME, self.td.PKGRC), | ||
3032 | 229 | "%s/.config/%s/%s" % (self.td.HOME, self.td.PKG, | ||
3033 | 230 | self.td.PKGRC)] | ||
3034 | 210 | for file in config_files: | 231 | for file in config_files: |
3035 | 211 | if os.path.exists(file): | 232 | if os.path.exists(file): |
3036 | 212 | try: | 233 | try: |
3037 | @@ -216,7 +237,8 @@ | |||
3038 | 216 | #self.load_config_files(file) | 237 | #self.load_config_files(file) |
3039 | 217 | self.logger.debug(_("Reading config file: [%s]") % file) | 238 | self.logger.debug(_("Reading config file: [%s]") % file) |
3040 | 218 | except: | 239 | except: |
3042 | 219 | self.logger.debug(_("Unable to load config file [%s]") % file) | 240 | self.logger.debug(_( |
3043 | 241 | "Unable to load config file [%s]") % file) | ||
3044 | 220 | # return False | 242 | # return False |
3045 | 221 | #return True | 243 | #return True |
3046 | 222 | 244 | ||
3047 | @@ -275,11 +297,13 @@ | |||
3048 | 275 | 297 | ||
3049 | 276 | # KVM Args | 298 | # KVM Args |
3050 | 277 | self.txt_kvm_args.set_text(self.td.KVM_ARGS) | 299 | self.txt_kvm_args.set_text(self.td.KVM_ARGS) |
3052 | 278 | 300 | ||
3053 | 279 | # SMP | 301 | # SMP |
3054 | 280 | if self.td.SMP: | 302 | if self.td.SMP: |
3055 | 281 | self.txt_smp_nbr.set_text(self.td.SMP) | 303 | self.txt_smp_nbr.set_text(self.td.SMP) |
3057 | 282 | self.lb_smp_available.set_text(_(" of %s available.") % commands.getoutput("grep -c ^processor /proc/cpuinfo")) | 304 | self.lb_smp_available.set_text(_( |
3058 | 305 | " of %s available." | ||
3059 | 306 | ) % commands.getoutput("grep -c ^processor /proc/cpuinfo")) | ||
3060 | 283 | 307 | ||
3061 | 284 | # Flavors | 308 | # Flavors |
3062 | 285 | i = 0 | 309 | i = 0 |
3063 | @@ -318,29 +342,36 @@ | |||
3064 | 318 | if arch == 'amd64': | 342 | if arch == 'amd64': |
3065 | 319 | self.chk_arch_amd64.set_active(True) | 343 | self.chk_arch_amd64.set_active(True) |
3066 | 320 | 344 | ||
3068 | 321 | def update_iso_cache(self, force_update = False): | 345 | def update_iso_cache(self, force_update=False): |
3069 | 322 | ################################################################## | 346 | ################################################################## |
3070 | 323 | ###### Code to update the ISO list from the repository Cache ##### | 347 | ###### Code to update the ISO list from the repository Cache ##### |
3071 | 324 | ################################################################## | 348 | ################################################################## |
3072 | 325 | update_cache = None | 349 | update_cache = None |
3073 | 326 | cdimage = False | 350 | cdimage = False |
3075 | 327 | """ Verify if the ISO list is cached, if not, set variable to update/create it. """ | 351 | """ Verify if the ISO list is cached, if not, |
3076 | 352 | set variable to update/create it. """ | ||
3077 | 328 | if force_update is True: | 353 | if force_update is True: |
3078 | 329 | update_cache = 1 | 354 | update_cache = 1 |
3079 | 330 | pass | 355 | pass |
3080 | 331 | elif self.td.is_iso_list_cached() is False: | 356 | elif self.td.is_iso_list_cached() is False: |
3081 | 332 | update_cache = 1 | 357 | update_cache = 1 |
3083 | 333 | # If ISO list is cached, verify if it is expired. If it is, set variable to update it. | 358 | # If ISO list is cached, verify if it is expired. |
3084 | 359 | # If it is, set variable to update it. | ||
3085 | 334 | elif self.td.is_iso_list_cache_expired() is True: | 360 | elif self.td.is_iso_list_cache_expired() is True: |
3086 | 335 | update_cache = 1 | 361 | update_cache = 1 |
3087 | 336 | 362 | ||
3089 | 337 | """ If variable set to update, obtain the ISO list from the Ubuntu CD Image repository. """ | 363 | """ If variable set to update, obtain the ISO |
3090 | 364 | list from the Ubuntu CD Image repository. """ | ||
3091 | 338 | if update_cache == 1: | 365 | if update_cache == 1: |
3093 | 339 | self.logger.info(_("Obtaining Ubuntu ISO list from %s...") % self.td.u) | 366 | self.logger.info(_(""" |
3094 | 367 | Obtaining Ubuntu ISO list from %s... | ||
3095 | 368 | """) % self.td.u) | ||
3096 | 340 | try: | 369 | try: |
3097 | 341 | cdimage = self.td.obtain_ubuntu_iso_list_from_repo() | 370 | cdimage = self.td.obtain_ubuntu_iso_list_from_repo() |
3098 | 342 | except: | 371 | except: |
3100 | 343 | self.logger.error(_("Could not obtain the Ubuntu ISO list from %s...") % self.td.u) | 372 | self.logger.error(_(""" |
3101 | 373 | Could not obtain the Ubuntu ISO list from %s... | ||
3102 | 374 | """) % self.td.u) | ||
3103 | 344 | 375 | ||
3104 | 345 | """ If the ISO List was obtained, update the cache file""" | 376 | """ If the ISO List was obtained, update the cache file""" |
3105 | 346 | if cdimage: | 377 | if cdimage: |
3106 | @@ -348,7 +379,9 @@ | |||
3107 | 348 | try: | 379 | try: |
3108 | 349 | self.td.update_ubuntu_iso_list_cache(cdimage) | 380 | self.td.update_ubuntu_iso_list_cache(cdimage) |
3109 | 350 | except: | 381 | except: |
3111 | 351 | self.logger.error(_("Unable to update the Ubuntu ISO list cache...")) | 382 | self.logger.error(_(""" |
3112 | 383 | Unable to update the Ubuntu ISO list cache... | ||
3113 | 384 | """)) | ||
3114 | 352 | 385 | ||
3115 | 353 | def get_preferences(self): | 386 | def get_preferences(self): |
3116 | 354 | """Returns preferences for testdrivegtk.""" | 387 | """Returns preferences for testdrivegtk.""" |
3117 | @@ -393,8 +426,9 @@ | |||
3118 | 393 | pass | 426 | pass |
3119 | 394 | 427 | ||
3120 | 395 | def on_error_dlg(self, data=None): | 428 | def on_error_dlg(self, data=None): |
3123 | 396 | errorbox = gtk.MessageDialog(self, | 429 | errorbox = gtk.MessageDialog( |
3124 | 397 | gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_ERROR, | 430 | self, |
3125 | 431 | gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_ERROR, | ||
3126 | 398 | gtk.BUTTONS_CLOSE, data) | 432 | gtk.BUTTONS_CLOSE, data) |
3127 | 399 | response = errorbox.run() | 433 | response = errorbox.run() |
3128 | 400 | errorbox.destroy() | 434 | errorbox.destroy() |
3129 | @@ -452,9 +486,9 @@ | |||
3130 | 452 | 486 | ||
3131 | 453 | def on_select_arch(self, widget, arch): | 487 | def on_select_arch(self, widget, arch): |
3132 | 454 | # On selecting the architecture | 488 | # On selecting the architecture |
3134 | 455 | if widget.get_active() == True: | 489 | if widget.get_active(): |
3135 | 456 | self.arch.append(arch) | 490 | self.arch.append(arch) |
3137 | 457 | if widget.get_active() == False: | 491 | if not widget.get_active(): |
3138 | 458 | self.arch.remove(arch) | 492 | self.arch.remove(arch) |
3139 | 459 | 493 | ||
3140 | 460 | def on_txt_gral_cache_focus_out_event(self, widget, data=None): | 494 | def on_txt_gral_cache_focus_out_event(self, widget, data=None): |
3141 | @@ -476,7 +510,7 @@ | |||
3142 | 476 | os.unlink(path) | 510 | os.unlink(path) |
3143 | 477 | except: | 511 | except: |
3144 | 478 | on_error_dlg(_("Unable to clean up files from [%s]") % cache_path) | 512 | on_error_dlg(_("Unable to clean up files from [%s]") % cache_path) |
3146 | 479 | 513 | ||
3147 | 480 | def on_select_iso_image_repo(self, widget): | 514 | def on_select_iso_image_repo(self, widget): |
3148 | 481 | ################################################################## | 515 | ################################################################## |
3149 | 482 | #### Select image repo, populate Release combobox accordingly #### | 516 | #### Select image repo, populate Release combobox accordingly #### |
3150 | @@ -487,9 +521,11 @@ | |||
3151 | 487 | old_repo = self.td.p | 521 | old_repo = self.td.p |
3152 | 488 | self.repo = model[index][0] | 522 | self.repo = model[index][0] |
3153 | 489 | self.td.p = self.repo | 523 | self.td.p = self.repo |
3155 | 490 | self.txt_iso_list_cache.set_text("%s/%s.isos" % (self.td.CACHE, self.td.p)) | 524 | self.txt_iso_list_cache.set_text("%s/%s.isos" % |
3156 | 525 | (self.td.CACHE, self.td.p)) | ||
3157 | 491 | 526 | ||
3159 | 492 | # Update cache commented given the hack to sync every repo on initialization | 527 | # Update cache commented given the |
3160 | 528 | # hack to sync every repo on initialization | ||
3161 | 493 | #self.update_iso_cache() | 529 | #self.update_iso_cache() |
3162 | 494 | # Populate the releases combobox | 530 | # Populate the releases combobox |
3163 | 495 | self.cb_ubuntu_release.get_model().clear() | 531 | self.cb_ubuntu_release.get_model().clear() |
3164 | @@ -536,30 +572,30 @@ | |||
3165 | 536 | ################################################################## | 572 | ################################################################## |
3166 | 537 | self.preferences = [] | 573 | self.preferences = [] |
3167 | 538 | # CACHE Variables | 574 | # CACHE Variables |
3169 | 539 | if self.txt_gral_cache.get_text() != None: | 575 | if self.txt_gral_cache.get_text() is not None: |
3170 | 540 | self.td.CACHE = self.txt_gral_cache.get_text() | 576 | self.td.CACHE = self.txt_gral_cache.get_text() |
3171 | 541 | self.preferences.append(['cache', self.td.CACHE]) | 577 | self.preferences.append(['cache', self.td.CACHE]) |
3173 | 542 | if self.txt_img_cache.get_text() != None: | 578 | if self.txt_img_cache.get_text() is not None: |
3174 | 543 | self.td.CACHE_IMG = self.txt_img_cache.get_text() | 579 | self.td.CACHE_IMG = self.txt_img_cache.get_text() |
3175 | 544 | self.preferences.append(['cache_img', self.td.CACHE_IMG]) | 580 | self.preferences.append(['cache_img', self.td.CACHE_IMG]) |
3177 | 545 | if self.txt_iso_cache.get_text() != None: | 581 | if self.txt_iso_cache.get_text() is not None: |
3178 | 546 | self.td.CACHE_ISO = self.txt_iso_cache.get_text() | 582 | self.td.CACHE_ISO = self.txt_iso_cache.get_text() |
3179 | 547 | self.preferences.append(['cache_iso', self.td.CACHE_ISO]) | 583 | self.preferences.append(['cache_iso', self.td.CACHE_ISO]) |
3180 | 548 | 584 | ||
3181 | 549 | # Repo selection | 585 | # Repo selection |
3183 | 550 | if self.repo != None: | 586 | if self.repo is not None: |
3184 | 551 | self.preferences.append(['p', self.td.p]) | 587 | self.preferences.append(['p', self.td.p]) |
3185 | 552 | 588 | ||
3187 | 553 | if self.r != None: | 589 | if self.r is not None: |
3188 | 554 | self.td.r = self.r | 590 | self.td.r = self.r |
3189 | 555 | self.preferences.append(['r', self.td.r]) | 591 | self.preferences.append(['r', self.td.r]) |
3190 | 556 | 592 | ||
3191 | 557 | # KVM Args | 593 | # KVM Args |
3193 | 558 | if self.txt_kvm_args.get_text() != None: | 594 | if self.txt_kvm_args.get_text() is not None: |
3194 | 559 | self.td.KVM_ARGS = self.txt_kvm_args.get_text() | 595 | self.td.KVM_ARGS = self.txt_kvm_args.get_text() |
3195 | 560 | self.preferences.append(['kvm_args', self.td.KVM_ARGS]) | 596 | self.preferences.append(['kvm_args', self.td.KVM_ARGS]) |
3196 | 561 | 597 | ||
3198 | 562 | if self.txt_smp_nbr.get_text() != None: | 598 | if self.txt_smp_nbr.get_text() is not None: |
3199 | 563 | self.td.SMP = self.txt_smp_nbr.get_text() | 599 | self.td.SMP = self.txt_smp_nbr.get_text() |
3200 | 564 | self.preferences.append(['smp', self.td.SMP]) | 600 | self.preferences.append(['smp', self.td.SMP]) |
3201 | 565 | 601 | ||
3202 | @@ -573,21 +609,21 @@ | |||
3203 | 573 | self.preferences.append(['m', self.td.m[0]]) | 609 | self.preferences.append(['m', self.td.m[0]]) |
3204 | 574 | 610 | ||
3205 | 575 | # VIRT Methods | 611 | # VIRT Methods |
3207 | 576 | if self.virt_method != None: | 612 | if self.virt_method is not None: |
3208 | 577 | self.td.VIRT = self.virt_method | 613 | self.td.VIRT = self.virt_method |
3209 | 578 | self.preferences.append(['virt', self.td.VIRT]) | 614 | self.preferences.append(['virt', self.td.VIRT]) |
3210 | 579 | 615 | ||
3211 | 580 | # Memory - TODO: Add validation of text | 616 | # Memory - TODO: Add validation of text |
3212 | 581 | if self.mem == 'other': | 617 | if self.mem == 'other': |
3213 | 582 | self.mem = self.cbe_mem_size.child.get_text() | 618 | self.mem = self.cbe_mem_size.child.get_text() |
3215 | 583 | if self.mem != None or self.mem not in MEM_SIZE_TAB: | 619 | if self.mem is not None or self.mem not in MEM_SIZE_TAB: |
3216 | 584 | self.td.MEM = self.mem | 620 | self.td.MEM = self.mem |
3217 | 585 | self.preferences.append(['mem', self.td.MEM]) | 621 | self.preferences.append(['mem', self.td.MEM]) |
3218 | 586 | 622 | ||
3219 | 587 | # Disk Size - TODO: Add validation of text | 623 | # Disk Size - TODO: Add validation of text |
3220 | 588 | if self.disk_size == 'other': | 624 | if self.disk_size == 'other': |
3221 | 589 | self.disk_size = self.cbe_disk_size.child.get_text() | 625 | self.disk_size = self.cbe_disk_size.child.get_text() |
3223 | 590 | if self.disk_size != None or self.disk_size not in DISK_SIZE_TAB: | 626 | if self.disk_size is not None or self.disk_size not in DISK_SIZE_TAB: |
3224 | 591 | self.td.DISK_SIZE = "%sG" % self.disk_size | 627 | self.td.DISK_SIZE = "%sG" % self.disk_size |
3225 | 592 | self.preferences.append(['disk_size', self.td.DISK_SIZE]) | 628 | self.preferences.append(['disk_size', self.td.DISK_SIZE]) |
3226 | 593 | 629 | ||
3227 | 594 | 630 | ||
3228 | === modified file 'testdrivegtk/helpers.py' | |||
3229 | --- testdrivegtk/helpers.py 2012-04-21 02:05:42 +0000 | |||
3230 | +++ testdrivegtk/helpers.py 2013-10-06 20:59:44 +0000 | |||
3231 | @@ -1,20 +1,20 @@ | |||
3232 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
3233 | 2 | ### BEGIN LICENSE | 2 | ### BEGIN LICENSE |
3234 | 3 | # Copyright (C) 2010 Canonical Ltd. | 3 | # Copyright (C) 2010 Canonical Ltd. |
3236 | 4 | # | 4 | # |
3237 | 5 | # Authors: | 5 | # Authors: |
3238 | 6 | # Andres Rodriguez <andreserl@ubuntu.com> | 6 | # Andres Rodriguez <andreserl@ubuntu.com> |
3242 | 7 | # | 7 | # |
3243 | 8 | # This program is free software: you can redistribute it and/or modify it | 8 | # This program is free software: you can redistribute it and/or modify it |
3244 | 9 | # under the terms of the GNU General Public License version 3, as published | 9 | # under the terms of the GNU General Public License version 3, as published |
3245 | 10 | # by the Free Software Foundation. | 10 | # by the Free Software Foundation. |
3250 | 11 | # | 11 | # |
3251 | 12 | # This program is distributed in the hope that it will be useful, but | 12 | # This program is distributed in the hope that it will be useful, but |
3252 | 13 | # WITHOUT ANY WARRANTY; without even the implied warranties of | 13 | # WITHOUT ANY WARRANTY; without even the implied warranties of |
3253 | 14 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | 14 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
3254 | 15 | # PURPOSE. See the GNU General Public License for more details. | 15 | # PURPOSE. See the GNU General Public License for more details. |
3257 | 16 | # | 16 | # |
3258 | 17 | # You should have received a copy of the GNU General Public License along | 17 | # You should have received a copy of the GNU General Public License along |
3259 | 18 | # with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | # with this program. If not, see <http://www.gnu.org/licenses/>. |
3260 | 19 | ### END LICENSE | 19 | ### END LICENSE |
3261 | 20 | 20 | ||
3262 | @@ -30,11 +30,12 @@ | |||
3263 | 30 | from testdrivegtk.testdrivegtkconfig import get_data_file | 30 | from testdrivegtk.testdrivegtkconfig import get_data_file |
3264 | 31 | 31 | ||
3265 | 32 | import gettext | 32 | import gettext |
3267 | 33 | from gettext import gettext as _ | 33 | _ = gettext.gettext |
3268 | 34 | gettext.textdomain('testdrive') | 34 | gettext.textdomain('testdrive') |
3269 | 35 | 35 | ||
3270 | 36 | |||
3271 | 36 | def get_builder(builder_file_name): | 37 | def get_builder(builder_file_name): |
3273 | 37 | """Return a fully-instantiated gtk.Builder instance from specified ui | 38 | """Return a fully-instantiated gtk.Builder instance from specified ui |
3274 | 38 | file | 39 | file |
3275 | 39 | 40 | ||
3276 | 40 | :param builder_file_name: The name of the builder file, without extension. | 41 | :param builder_file_name: The name of the builder file, without extension. |
3277 | 41 | 42 | ||
3278 | === modified file 'testdrivegtk/testdrivegtkconfig.py' | |||
3279 | --- testdrivegtk/testdrivegtkconfig.py 2012-04-21 02:05:42 +0000 | |||
3280 | +++ testdrivegtk/testdrivegtkconfig.py 2013-10-06 20:59:44 +0000 | |||
3281 | @@ -1,20 +1,20 @@ | |||
3282 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
3283 | 2 | ### BEGIN LICENSE | 2 | ### BEGIN LICENSE |
3284 | 3 | # Copyright (C) 2010 Canonical Ltd. | 3 | # Copyright (C) 2010 Canonical Ltd. |
3286 | 4 | # | 4 | # |
3287 | 5 | # Authors: | 5 | # Authors: |
3288 | 6 | # Andres Rodriguez <andreserl@ubuntu.com> | 6 | # Andres Rodriguez <andreserl@ubuntu.com> |
3292 | 7 | # | 7 | # |
3293 | 8 | # This program is free software: you can redistribute it and/or modify it | 8 | # This program is free software: you can redistribute it and/or modify it |
3294 | 9 | # under the terms of the GNU General Public License version 3, as published | 9 | # under the terms of the GNU General Public License version 3, as published |
3295 | 10 | # by the Free Software Foundation. | 10 | # by the Free Software Foundation. |
3300 | 11 | # | 11 | # |
3301 | 12 | # This program is distributed in the hope that it will be useful, but | 12 | # This program is distributed in the hope that it will be useful, but |
3302 | 13 | # WITHOUT ANY WARRANTY; without even the implied warranties of | 13 | # WITHOUT ANY WARRANTY; without even the implied warranties of |
3303 | 14 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | 14 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
3304 | 15 | # PURPOSE. See the GNU General Public License for more details. | 15 | # PURPOSE. See the GNU General Public License for more details. |
3307 | 16 | # | 16 | # |
3308 | 17 | # You should have received a copy of the GNU General Public License along | 17 | # You should have received a copy of the GNU General Public License along |
3309 | 18 | # with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | # with this program. If not, see <http://www.gnu.org/licenses/>. |
3310 | 19 | ### END LICENSE | 19 | ### END LICENSE |
3311 | 20 | 20 | ||
3312 | @@ -37,9 +37,10 @@ | |||
3313 | 37 | import os | 37 | import os |
3314 | 38 | 38 | ||
3315 | 39 | import gettext | 39 | import gettext |
3317 | 40 | from gettext import gettext as _ | 40 | _ = gettext.gettext |
3318 | 41 | gettext.textdomain('testdrive') | 41 | gettext.textdomain('testdrive') |
3319 | 42 | 42 | ||
3320 | 43 | |||
3321 | 43 | class project_path_not_found(Exception): | 44 | class project_path_not_found(Exception): |
3322 | 44 | """Raised when we can't find the project directory.""" | 45 | """Raised when we can't find the project directory.""" |
3323 | 45 | 46 |
Hi Jackson!
I like this fixes for sure.. however, it is way too big to review.. is there anyway you can split this in smaller branches? (Say one branch per binary, so that it is easier to test and review).
thank you! this is awesome!