X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Futils.py;h=dbc8c16c0fce391c8b8f5fc9764f57223d15bd22;hb=4317829cf7fa64926ef29425fce77bdc9459f520;hp=78ee197fe0e24cccc798dbdba59a04c9cca965e9;hpb=2c639c40c65966711c82d46a6f4ee8739e819aad;p=dak.git diff --git a/daklib/utils.py b/daklib/utils.py index 78ee197f..dbc8c16c 100755 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # vim:set et ts=4 sw=4: -# Utility functions +""" Utility functions """ # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 James Troup ################################################################################ @@ -28,7 +28,9 @@ import apt_pkg import database import time from dak_exceptions import * -from regexes import * +from regexes import re_html_escaping, html_escaping, re_single_line_field, \ + re_multi_line_field, re_srchasver, re_verwithext, \ + re_parse_maintainer, re_taint_free, re_gpg_uid ################################################################################ @@ -663,11 +665,11 @@ def regex_safe (s): # Perform a substition of template def TemplateSubst(map, filename): - file = open_file(filename) - template = file.read() + templatefile = open_file(filename) + template = templatefile.read() for x in map.keys(): template = template.replace(x,map[x]) - file.close() + templatefile.close() return template ################################################################################ @@ -763,13 +765,13 @@ def find_next_free (dest, too_many=100): ################################################################################ def result_join (original, sep = '\t'): - list = [] + resultlist = [] for i in xrange(len(original)): if original[i] == None: - list.append("") + resultlist.append("") else: - list.append(original[i]) - return sep.join(list) + resultlist.append(original[i]) + return sep.join(resultlist) ################################################################################ @@ -1096,7 +1098,7 @@ on error.""" return "%s: tainted filename" % (filename) # Invoke gpgv on the file - status_read, status_write = os.pipe(); + status_read, status_write = os.pipe() cmd = "gpgv --status-fd %s --keyring /dev/null %s" % (status_write, filename) (_, status, _) = gpgv_get_status_output(cmd, status_read, status_write) @@ -1168,7 +1170,7 @@ used.""" return None # Build the command line - status_read, status_write = os.pipe(); + status_read, status_write = os.pipe() cmd = "gpgv --status-fd %s %s %s %s" % ( status_write, gpg_keyring_args(keyrings), sig_filename, data_filename)