From 67813baaced0cffca3f470dd2c63e9042dde4b6a Mon Sep 17 00:00:00 2001 From: Torsten Werner Date: Sat, 29 Jan 2011 12:25:14 +0100 Subject: [PATCH] Improve file headers in threadpool.py and cruft.py. Signed-off-by: Torsten Werner --- daklib/cruft.py | 23 +++++++++++++++++++++++ daklib/threadpool.py | 20 +++++++++++--------- 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/daklib/cruft.py b/daklib/cruft.py index 0fc40f37..79787e26 100644 --- a/daklib/cruft.py +++ b/daklib/cruft.py @@ -1,3 +1,26 @@ +""" +helper functions for cruft-report + +@contact: Debian FTPMaster +@copyright 2011 Torsten Werner +""" + +# 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 +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +################################################################################ + from daklib.dbconn import * from sqlalchemy import func diff --git a/daklib/threadpool.py b/daklib/threadpool.py index f075f5c3..f1b68ce2 100644 --- a/daklib/threadpool.py +++ b/daklib/threadpool.py @@ -1,19 +1,21 @@ -import threading -from time import sleep +""" +thread pool implementation for Python -from daklib.config import Config +@contact: Debian FTPMaster +@copyright: 2003 Tim Lesher +@copyright: 2004 Carl Kleffner +@copyright: 2010, 2011 Torsten Werner +""" # This code is a modified copy of # http://code.activestate.com/recipes/203871-a-generic-programming-thread-pool/ # and is licensed under the Python License. The full text of the license # is available in the file COPYING-PSF. -# Ensure booleans exist (not needed for Python 2.2.1 or higher) -try: - True -except NameError: - False = 0 - True = not False +import threading +from time import sleep + +from daklib.config import Config if Config().has_key('Common::ThreadCount'): defaultThreadCount = int(Config()['Common::ThreadCount']) -- 2.39.5