diff options
| author | Ben Finney <ben@benfinney.id.au> | 2008-05-16 16:11:06 +1000 |
|---|---|---|
| committer | Ben Finney <ben@benfinney.id.au> | 2008-05-16 16:11:06 +1000 |
| commit | a953d82143f0ec979e18f17e8d9bbacbac954868 (patch) | |
| tree | 42e76c37d72847d4fe3ca2487e227ae1649ad3c0 /aptsources/distro.py | |
| parent | 21ef2ab57d68de87a2b44a23d9a3bfb87d24d46d (diff) | |
| download | python-apt-a953d82143f0ec979e18f17e8d9bbacbac954868.tar.gz | |
Fixes to blank lines, to conform with PEP 8.
Diffstat (limited to 'aptsources/distro.py')
| -rw-r--r-- | aptsources/distro.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/aptsources/distro.py b/aptsources/distro.py index 0a977445..faccc271 100644 --- a/aptsources/distro.py +++ b/aptsources/distro.py @@ -28,13 +28,17 @@ import os import sys import gettext + + def _(s): return gettext.dgettext("python-apt", s) class NoDistroTemplateException(Exception): pass + class Distribution: + def __init__(self, id, codename, description, release): """ Container for distribution specific informations """ # LSB information @@ -199,6 +203,7 @@ class Distribution: def get_server_list(self): ''' Return a list of used and suggested servers ''' + def compare_mirrors(mir1, mir2): '''Helper function that handles comaprision of mirror urls that could contain trailing slashes''' @@ -271,6 +276,7 @@ class Distribution: comp: the component that should be enabled """ + def add_component_only_once(source, comps_per_dist): """ Check if we already added the component to the repository, since @@ -347,6 +353,7 @@ class Distribution: def change_server(self, uri): ''' Change the server of all distro specific sources to a given host ''' + def change_server_of_source(source, uri, seen): # Avoid creating duplicate entries source.uri = uri @@ -357,6 +364,7 @@ class Distribution: seen.append([source.uri, source.dist, comp]) if len(source.comps) < 1: self.sourceslist.remove(source) + seen_binary = [] seen_source = [] self.default_server = uri @@ -377,6 +385,7 @@ class Distribution: else: return False + class DebianDistribution(Distribution): ''' Class to support specific Debian features ''' @@ -408,12 +417,15 @@ class DebianDistribution(Distribution): Distribution.get_mirrors(self, mirror_template="http://ftp.%s.debian.org/debian/") + class UbuntuDistribution(Distribution): ''' Class to support specific Ubuntu features ''' + def get_mirrors(self): Distribution.get_mirrors(self, mirror_template="http://%s.archive.ubuntu.com/ubuntu/") + def get_distro(): ''' Check the currently used distribution and return the corresponding distriubtion class that supports distro specific features. ''' @@ -430,4 +442,3 @@ def get_distro(): return DebianDistribution(id, codename, description, release) else: return Distribution(id, codename, description, release) - |
