~cr3/checkbox/key_test_python3

« back to all changes in this revision

Viewing changes to scripts/cdimage_resource

  • Committer: Marc Tardif
  • Date: 2012-05-22 20:15:54 UTC
  • mfrom: (1394.1.1 pep8-scripts)
  • Revision ID: marc.tardif@canonical.com-20120522201554-zfqgai2uksxm4zbq
General cleanup of scripts by javier.collado.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
    type_regex = r"(?P<type>Binary-\d+)"
40
40
    date_regex = r"(?P<date>[^\)]+)"
41
41
 
42
 
    string_regex = r"%s %s [_\"]%s[_\"] - %s %s (%s )?\(%s\)" % (distributor_regex,
43
 
        release_regex, codename_regex, official_regex, architecture_regex,
44
 
        type_regex, date_regex)
 
42
    string_regex = (r"%s %s [_\"]%s[_\"] - %s %s (%s )?\(%s\)"
 
43
                    % (distributor_regex, release_regex, codename_regex,
 
44
                       official_regex, architecture_regex, type_regex,
 
45
                       date_regex))
45
46
 
46
47
    disk = {}
47
48
    match = re.match(string_regex, string)
51
52
 
52
53
    return disk
53
54
 
 
55
 
54
56
def get_disk_from_casper(filename):
55
57
    disk = {}
56
58
 
72
74
 
73
75
    return disk
74
76
 
 
77
 
75
78
def get_disk_from_media(filename):
76
79
    try:
77
80
        file = open(filename)
81
84
    string = file.readline()
82
85
    return get_disk_from_string(string)
83
86
 
 
87
 
84
88
def main():
85
89
    disk = get_disk_from_media(MEDIA_FILENAME)
86
90
    if not disk: