From a0b206e711cb499e356865405c968a95960045a5 Mon Sep 17 00:00:00 2001 From: James Turk Date: Fri, 27 Feb 2009 19:49:50 +0000 Subject: [PATCH] small changes for cleanup --- saucebrush/__init__.py | 22 +++++++++++----------- saucebrush/filters.py | 6 +++--- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/saucebrush/__init__.py b/saucebrush/__init__.py index cef6e9e..6c1ae84 100644 --- a/saucebrush/__init__.py +++ b/saucebrush/__init__.py @@ -25,19 +25,19 @@ def run_recipe(source, *filter_args): pass # don't care if there isn't a done method -##### allow selection between threading/processing ##### +# experiment with threading - do not use -#from threading import Thread as TaskType -#from Queue import Queue -#from threading import activeCount as active_tasks +from threading import Thread as TaskType +from Queue import Queue +from threading import activeCount as active_tasks -from processing import Process as TaskType -from processing import Queue -def active_tasks(): - from processing import activeChildren - return len(activeChildren()) +# uncomment to use processing instead of threading +#from processing import Process as TaskType +#from processing import Queue +#def active_tasks(): +# from processing import activeChildren +# return len(activeChildren()) -######################################################## class FilterThread(TaskType): __create_count = 0 @@ -105,4 +105,4 @@ def run_recipe_multitasking(source, *filter_args): print 'joining', task task.join() print task, 'joined' - task.done() \ No newline at end of file + task.done() diff --git a/saucebrush/filters.py b/saucebrush/filters.py index 1de572d..26d8cff 100644 --- a/saucebrush/filters.py +++ b/saucebrush/filters.py @@ -382,9 +382,9 @@ class NameCleaner(Filter): Takes a list of target keys. - PhoneNumberCleaner( ('phone','fax'), - number_format='%s%s%s-%s%s%s-%s%s%s%s') - would format the phone & fax columns to 555-123-4567 format. + NameCleaner( ('name', ), nomatch_name='raw_name') + would attempt to split 'name' into firstname, middlename, lastname, + and suffix columns, and if it did not fit would place it in raw_name """ # first middle? last suffix?