X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=dak%2Fexamine_package.py;h=ae3ec6c9c4e4b4f7f22d1468b4e859e9b6abe4f9;hb=4c85e19682be05636406315ce1cce69eb96822e8;hp=8143eacaf7874c7f64705f2ecde645cf523efa54;hpb=c60719bc9a46557970c0c43e90d6f7d0469230b0;p=dak.git
diff --git a/dak/examine_package.py b/dak/examine_package.py
index 8143eaca..ae3ec6c9 100755
--- a/dak/examine_package.py
+++ b/dak/examine_package.py
@@ -34,7 +34,8 @@
import errno, os, pg, re, sys, md5
import apt_pkg, apt_inst
-import daklib.database, daklib.utils, daklib.queue
+from daklib import database
+from daklib import utils
################################################################################
@@ -62,9 +63,9 @@ re_html_escaping = re.compile('|'.join(map(re.escape, html_escaping.keys())))
Cnf = None
projectB = None
-Cnf = daklib.utils.get_conf()
+Cnf = utils.get_conf()
projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"]))
-daklib.database.init(Cnf, projectB)
+database.init(Cnf, projectB)
printed_copyrights = {}
@@ -89,24 +90,24 @@ PACKAGE can be a .changes, .dsc, .deb or .udeb filename."""
# probably xml.sax.saxutils would work as well
def html_escape(s):
- return re_html_escaping.sub(lambda x: html_escaping.get(x.group(0)), s)
+ return re_html_escaping.sub(lambda x: html_escaping.get(x.group(0)), s)
def escape_if_needed(s):
- if use_html:
- return re_html_escaping.sub(html_escaping.get, s)
- else:
- return s
-
+ if use_html:
+ return re_html_escaping.sub(lambda x: html_escaping.get(x.group(0)), s)
+ else:
+ return s
+
def headline(s, level=2, bodyelement=None):
- if use_html:
- if bodyelement:
- print """
-
- """%{"bodyelement":bodyelement,"title":html_escape(s)}
+ if use_html:
+ if bodyelement:
+ print """
+ %(title)s
+ """%{"bodyelement":bodyelement,"title":html_escape(s)}
+ else:
+ print "%(title)s (click to toggle)
%s" % (s) - else: - print s - -def print_formatted_text(s): - if use_html: - print "
%s" % (html_escape(s)) - else: - print s + if use_html: + return ("%s%s%s" % (html_colours[colour][0], html_escape(s), html_colours[colour][1])) + else: + return ("%s%s%s" % (ansi_colours[colour], s, ansi_colours['end'])) + +def escaped_text(s, strip=False): + if use_html: + if strip: + s = s.strip() + return "
%s" % (s) + else: + return s + +def formatted_text(s, strip=False): + if use_html: + if strip: + s = s.strip() + return "
%s" % (html_escape(s)) + else: + return s + +def output_row(s): + if use_html: + return """
""" - print_formatted_text(strip_pgp_signature(changes_filename)) - if use_html: - print """ | |
Format: | 1.7 |
Date: | Mon, 24 Dec 2007 15:32:08 -0200 |
Source: | php-xdebug |
Binary: | php5-xdebug |
Architecture: | source amd64 |
Version: | 2.0.2-1 |
Distribution: | unstable |
Urgency: | low |
Maintainer: | Marcelo Jorge Vieira (metal) <metal@alucinados.com> |
Changed-By: | Marcelo Jorge Vieira (metal) <metal@alucinados.com> |
Description: | - php5-xdebug - xdebug extension module for PHP5 |
Closes: | 377348 |
Changes: |
- php-xdebug (2.0.2-1) unstable; urgency=low - - * Initial release (Closes: #377348) |
Files: |
- c6ee78b58a4d70d66f8a70436b2a943c 632 web optional php-xdebug_2.0.2-1.dsc - d3547f74353174884452a51ee9ca687f 279891 web optional php-xdebug_2.0.2.orig.tar.gz - 8e7c262113c8ac13f47781e0ac0eb4c3 4107 web optional php-xdebug_2.0.2-1.diff.gz - 3c6be09f23931fabf0b3048575390ed3 137930 web optional php5-xdebug_2.0.2-1_amd64.deb |