~ubuntu-branches/ubuntu/lucid/testdrive/lucid

« back to all changes in this revision

Viewing changes to testdrive-select-iso

  • Committer: Bazaar Package Importer
  • Author(s): Dustin Kirkland
  • Date: 2009-11-17 15:29:50 UTC
  • Revision ID: james.westby@ubuntu.com-20091117152950-uf7h6qapb53up75l
Tags: upstream-1.13
ImportĀ upstreamĀ versionĀ 1.13

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
#
 
3
#    testdrive-select-iso - present a list and select an ISO for testdriving
 
4
#    Copyright (C) 2009 Canonical Ltd.
 
5
#    Copyright (C) 2009 Dustin Kirkland
 
6
#
 
7
#    Authors: Dustin Kirkland <kirkland@canonical.com>
 
8
#
 
9
#    This program is free software: you can redistribute it and/or modify
 
10
#    it under the terms of the GNU General Public License as published by
 
11
#    the Free Software Foundation, version 3 of the License.
 
12
#
 
13
#    This program is distributed in the hope that it will be useful,
 
14
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
#    GNU General Public License for more details.
 
17
#
 
18
#    You should have received a copy of the GNU General Public License
 
19
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
20
 
 
21
 
 
22
import commands, time, os
 
23
 
 
24
PKG = "testdrive"
 
25
ARCH = commands.getoutput("uname -m | grep -qs x86_64 && echo amd64 || echo i386")
 
26
RELEASE = "lucid"
 
27
 
 
28
ISO = []
 
29
ISO.append({"name":"Ubuntu Desktop", "url":"rsync://cdimage.ubuntu.com/cdimage/daily-live/current/%s-desktop-%s.iso"%(RELEASE,ARCH)})
 
30
ISO.append({"name":"Ubuntu Server", "url":"rsync://cdimage.ubuntu.com/cdimage/ubuntu-server/daily/current/%s-server-%s.iso"%(RELEASE,ARCH)})
 
31
ISO.append({"name":"Ubuntu Alternate", "url":"rsync://cdimage.ubuntu.com/cdimage/daily/current/%s-alternate-%s.iso"%(RELEASE,ARCH)})
 
32
ISO.append({"name":"Ubuntu DVD", "url":"rsync://cdimage.ubuntu.com/cdimage/dvd/current/%s-dvd-%s.iso"%(RELEASE,ARCH)})
 
33
ISO.append({"name":"Ubuntu Netbook Remix", "url":"rsync://cdimage.ubuntu.com/cdimage/ubuntu-netbook-remix/daily-live/current/%s-netbook-remix-i386.iso"%(RELEASE)})
 
34
 
 
35
# These are problematic, because the names are all the same ... lucid-desktop-i386.iso
 
36
# Need to rename the destination ISO accordingly
 
37
#rsync://cdimage.ubuntu.com/cdimage/kubuntu/daily-live/current/%s-desktop-%s.iso
 
38
#rsync://cdimage.ubuntu.com/cdimage/xubuntu/daily-live/current/%s-desktop-%s.iso
 
39
#rsync://cdimage.ubuntu.com/cdimage/mythbuntu/daily-live/current/%s-desktop-%s.iso
 
40
#rsync://cdimage.ubuntu.com/cdimage/kubuntu-netbook/daily-live/current/%s-netbook-i386.iso"
 
41
 
 
42
i = 1
 
43
for iso in ISO:
 
44
        print("  %d. %s (%s)" % (i, iso["name"], RELEASE))
 
45
        filename = os.path.basename(iso["url"])
 
46
        path = "%s/.cache/%s/%s" % (os.environ["HOME"], PKG, filename)
 
47
        if os.path.exists(path):
 
48
                print("     +--> [%s] %s" % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(os.path.getmtime(path))), filename))
 
49
        i=i+1
 
50
choice = int(raw_input("\nSelect an ISO to testdrive: "))
 
51
if choice in range(1, i):
 
52
        print(ISO[choice]["url"])
 
53
else:
 
54
        print("Invalid selection")