提交 ec44b193 编写于 作者: J James Troup

don't slice \n off strings when we're strip()-ing it.

上级 56d70778
#!/usr/bin/env python
# Generate Maintainers file used by e.g. the Debian Bug Tracking System
# Copyright (C) 2000, 2001, 2002 James Troup <james@nocrew.org>
# $Id: charisma,v 1.15 2002-10-16 02:47:32 troup Exp $
# Copyright (C) 2000, 2001, 2002, 2003 James Troup <james@nocrew.org>
# $Id: charisma,v 1.16 2003-04-15 16:03:31 troup Exp $
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -132,7 +132,7 @@ def main():
for filename in extra_files:
file = utils.open_file(filename);
for line in file.readlines():
line = utils.re_comments.sub('', line[:-1]).strip();
line = utils.re_comments.sub('', line).strip();
if line == "":
continue;
split = line.split();
......
#!/usr/bin/env python
# Manipulate suite tags
# Copyright (C) 2000, 2001, 2002 James Troup <james@nocrew.org>
# $Id: heidi,v 1.16 2003-01-02 18:11:20 troup Exp $
# Copyright (C) 2000, 2001, 2002, 2003 James Troup <james@nocrew.org>
# $Id: heidi,v 1.17 2003-04-15 16:03:31 troup Exp $
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -107,7 +107,7 @@ def set_suite (file, suite_id):
# Build up a dictionary of what should be in the suite
desired = {};
for line in lines:
split_line = line[:-1].strip().split();
split_line = line.strip().split();
if len(split_line) != 3:
utils.warn("'%s' does not break into 'package version architecture'." % (line[:-1]));
continue;
......@@ -155,7 +155,7 @@ def process_file (file, suite, action):
projectB.query("BEGIN WORK");
for line in lines:
split_line = line[:-1].strip().split();
split_line = line.strip().split();
if len(split_line) != 3:
utils.warn("'%s' does not break into 'package version architecture'." % (line[:-1]));
continue;
......
......@@ -2,7 +2,7 @@
# Manipulate override files
# Copyright (C) 2000, 2001, 2002, 2003 James Troup <james@nocrew.org>
# $Id: natalie,v 1.5 2003-03-14 19:05:43 troup Exp $
# $Id: natalie,v 1.6 2003-04-15 16:03:31 troup Exp $
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -117,7 +117,7 @@ def process_file (file, suite, component, type, action):
start_time = time.time();
projectB.query("BEGIN WORK");
for line in file.readlines():
line = utils.re_comments.sub('', line[:-1]).strip();
line = utils.re_comments.sub('', line).strip();
if line == "":
continue;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册