From 506eaa21b5f5dd4baef15835ad1d8dd3b96d2388 Mon Sep 17 00:00:00 2001 From: calvin Date: Tue, 28 Jun 2005 10:03:04 +0000 Subject: [PATCH] cleanup git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@2680 e7d03fd6-7b0d-0410-9947-9c21f3af8025 --- linkcheck/configuration.py | 12 ++++++------ linkcheck/decorators.py | 12 ++++++++++++ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/linkcheck/configuration.py b/linkcheck/configuration.py index a7dd8a6d..a67e672b 100644 --- a/linkcheck/configuration.py +++ b/linkcheck/configuration.py @@ -229,13 +229,13 @@ class Configuration (dict): if not cfiles: # system wide config settings config_dir = _linkchecker_configdata.config_dir - path = normpath(os.path.join(config_dir, "linkcheckerrc")) - if os.path.exists(path): - cfiles.append(path) + path = normpath(os.path.join(config_dir, "linkcheckerrc")) + if os.path.exists(path): + cfiles.append(path) # per user config settings - path = normpath("~/.linkchecker/linkcheckerrc") - if os.path.exists(path): - cfiles.append(path) + path = normpath("~/.linkchecker/linkcheckerrc") + if os.path.exists(path): + cfiles.append(path) self.read_config(cfiles) # re-init logger self['logger'] = self.logger_new('text') diff --git a/linkcheck/decorators.py b/linkcheck/decorators.py index 2bcfc170..bfe4ba98 100644 --- a/linkcheck/decorators.py +++ b/linkcheck/decorators.py @@ -12,6 +12,9 @@ def deprecated (func): It emits a warning when the function is called. """ def newfunc (*args, **kwargs): + """ + Print deprecated warning and execute original function. + """ warnings.warn("Call to deprecated function %s." % func.__name__, category=DeprecationWarning) return func(*args, **kwargs) @@ -31,6 +34,9 @@ def signal_handler (signal_number): """ # create the 'real' decorator which takes only a function as an argument def newfunc (function): + """ + Register function as signal handler. + """ if os.name == 'posix': signal.signal(signal_number, function) return function @@ -42,6 +48,9 @@ def _synchronized (lock, func): Call function with aqcuired lock. """ def newfunc (*args, **kwargs): + """ + Execute function synchronized. + """ lock.acquire(True) # blocking try: return func(*args, **kwargs) @@ -58,6 +67,9 @@ def synchronized (lock): A decorator calling a function with aqcuired lock. """ def newfunc (function): + """ + Execute function synchronized. + """ return _synchronized(lock, function) return newfunc