diff options
| author | Julian Andres Klode <jak@debian.org> | 2010-03-01 17:12:09 +0100 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2010-03-01 17:12:09 +0100 |
| commit | 78e152429187ef145124b0ac0a69ffd1d52f4ed7 (patch) | |
| tree | 781f35c83798f4d1d9a2019fd0f9409e3312be6d /apt/utils.py | |
| parent | 28fcce3fe36ab2c3855d4c3766490272a7310392 (diff) | |
| download | python-apt-78e152429187ef145124b0ac0a69ffd1d52f4ed7.tar.gz | |
Style fixes.
Diffstat (limited to 'apt/utils.py')
| -rw-r--r-- | apt/utils.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/apt/utils.py b/apt/utils.py index 61d5d54f..dd52f824 100644 --- a/apt/utils.py +++ b/apt/utils.py @@ -17,9 +17,11 @@ # this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -import apt_pkg import os.path +import apt_pkg + + def get_maintenance_end_date(release_date, m_months): """ get the (year, month) tuple when the maintenance for the distribution @@ -28,10 +30,12 @@ def get_maintenance_end_date(release_date, m_months): """ years = m_months / 12 months = m_months % 12 - support_end_year = release_date.year + years + (release_date.month + months)/12 + support_end_year = (release_date.year + years + + (release_date.month + months)/12) support_end_month = (release_date.month + months) % 12 return (support_end_year, support_end_month) + def get_release_date_from_release_file(path): """ return the release date as time_t for the given release file @@ -45,6 +49,7 @@ def get_release_date_from_release_file(path): date = section["Date"] return apt_pkg.str_to_time(date) + def get_release_filename_for_pkg(cache, pkgname, label, release): " get the release file that provides this pkg " if pkgname not in cache: @@ -54,7 +59,7 @@ def get_release_filename_for_pkg(cache, pkgname, label, release): # look for the version that comes from the repos with # the given label and origin for aver in pkg._pkg.version_list: - if aver == None or aver.file_list == None: + if aver is None or aver.file_list is None: continue for ver_file, index in aver.file_list: #print verFile @@ -71,6 +76,7 @@ def get_release_filename_for_pkg(cache, pkgname, label, release): indexfile.describe == m.describe and indexfile.is_trusted): dir = apt_pkg.config.find_dir("Dir::State::lists") - name = apt_pkg.uri_to_filename(metaindex.uri)+"dists_%s_Release" % metaindex.dist + name = (apt_pkg.uri_to_filename(metaindex.uri) + + "dists_%s_Release" % metaindex.dist) return dir+name return None |
