From 072787627a2339c3d5aca541086c2e4545bbad8d Mon Sep 17 00:00:00 2001 From: Joshua Ismael Haase Hernández Date: Tue, 8 Feb 2011 14:06:58 -0600 Subject: * Changed variable name in filter.py * Added example in test1.py --- filter.py | 15 +++++++-------- test/test1.py | 5 +++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/filter.py b/filter.py index 817a228..ffc0965 100644 --- a/filter.py +++ b/filter.py @@ -89,20 +89,19 @@ def get_file_list_from_rsync_output(rsync_output): return tuple(a) def generate_exclude_list_from_blacklist(packages_iterable, blacklisted_names, - blacklist_file=rsync_blacklist, debug=verbose): + exclude_file=rsync_blacklist, debug=verbose): """ Generate an exclude list for rsync Parameters: ---------- - package_iterable -> list or tuple Contains Package objects - blacklisted_names-> list or tuple Contains blacklisted names - blacklist_file -> str Path to file - debug -> bool + package_iterable -> list or tuple Contains Package objects + blacklisted_names-> list or tuple Contains blacklisted names + exclude_file -> str Path to file + debug -> bool If True, file list gets logged Output: ---------- - if debug == False -> None - if debug == True -> blacklist """ + None """ a=list() for package in packages_iterable: @@ -115,7 +114,7 @@ def generate_exclude_list_from_blacklist(packages_iterable, blacklisted_names, printf(a) try: - fsock = open(blacklist_file,"w") + fsock = open(exclude_file,"w") try: fsock.write("\n".join(a)) finally: diff --git a/test/test1.py b/test/test1.py index 61b0651..13b5660 100644 --- a/test/test1.py +++ b/test/test1.py @@ -13,7 +13,8 @@ import unittest class KnownValues(unittest.TestCase): directory_list=("drwxrwxr-x 15 2010/09/11 11:28:50 community-staging", - "drwxrwxr-x 30 2010/09/11 11:28:50 community-staging/os") + "drwxrwxr-x 30 2010/09/11 11:28:50 community-staging/os", + 'dr-xr-sr-x 4096 2010/09/11 11:37:10 .') # (rsync_out, name, version, arch, release, location) examples=( ("lrwxrwxrwx 53 2011/01/31 01:52:06 community-testing/os/i686/apvlv-0.1.0-2-i686.pkg.tar.xz -> ../../../pool/community/apvlv-0.1.0-2-i686.pkg.tar.xz", "apvlv","0.1.0","i686", "2", "community-testing/os/i686/apvlv-0.1.0-2-i686.pkg.tar.xz"), @@ -60,6 +61,6 @@ class KnownValues(unittest.TestCase): for i in self.examples: k,v = self.generate_results(example_tuple=i,attr="location") self.assertEqual(k, v) - + if __name__ == "__main__": unittest.main() -- cgit v1.2.3-54-g00ecf