~ubuntu-branches/ubuntu/hardy/apturl/hardy-updates

« back to all changes in this revision

Viewing changes to AptUrl/Parser.py

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2007-08-16 18:03:48 UTC
  • Revision ID: james.westby@ubuntu.com-20070816180348-50zrm5ax0h6truxd
Tags: 0.0+bzr20070816
* added i18n support
* added support for "minver"
* added support to add repositories and sections
* added suppor for removing sources again

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
        self.keyfile = None
33
33
        self.minver = None
34
34
        self.repo_url = None
35
 
        self.dist = "/"
 
35
        self.dist = '/'
36
36
        self.section = []
37
37
 
38
38
def parse(full_url):
64
64
                for s in key_value_pairs:
65
65
                    (k,v) = s.split("=")
66
66
                    # for list defaults, add to list
67
 
                    if type(getattr(apt_url, k)) == type([]):
68
 
                        getattr(apt_url, k).append(v)
69
 
                    else:
70
 
                        setattr(apt_url, k, v)
 
67
                    try:
 
68
                        if type(getattr(apt_url, k)) == type([]):
 
69
                            getattr(apt_url, k).append(v)
 
70
                        else:
 
71
                            setattr(apt_url, k, v)
 
72
                    except Exception, e:
 
73
                        raise InvalidUrlException
71
74
        res.append(apt_url)
72
75
    return res