--- a/toolsutils.py Wed Jun 03 09:09:33 2009 +0200
+++ b/toolsutils.py Thu Apr 04 13:49:34 2019 +0200
@@ -39,7 +39,7 @@
if ex.errno != errno.EEXIST:
raise
print 'directory %s already exists' % directory
-
+
def create_symlink(source, target):
"""create a symbolic link"""
if exists(target):
@@ -51,7 +51,7 @@
import shutil
print '[copy] %s <-- %s' % (target, source)
shutil.copy2(source, target)
-
+
def rm(whatever):
import shutil
shutil.rmtree(whatever)
@@ -66,7 +66,7 @@
diffs = p_output.read()
if diffs:
if askconfirm:
- print
+ print
print diffs
action = raw_input('replace (N/y/q) ? ').lower()
else:
@@ -120,7 +120,7 @@
show_diffs(tfpath, fpath, askconfirm)
else:
shutil.copyfile(fpath, tfpath)
-
+
def fill_templated_file(fpath, tfpath, context):
fobj = file(tfpath, 'w')
templated = file(fpath).read()
@@ -158,7 +158,7 @@
:param config_file: path to the configuration file
:rtype: dict
- :return: a dictionary with specified values associated to option names
+ :return: a dictionary with specified values associated to option names
"""
from logilab.common.fileutils import lines
config = current = {}
@@ -194,10 +194,10 @@
:type default: str
:param default: default value if the environment variable is not defined
-
+
:type name: str
:param name: the informal name of the path, used for error message
-
+
:rtype: str
:return: the value of the environment variable or the default value
@@ -243,12 +243,12 @@
msg = 'No helper for command %s using %s configuration' % (
cmdname, config.name)
raise ConfigurationError(msg)
-
+
def fail(self, reason):
print "command failed:", reason
sys.exit(1)
-
-
+
+
def main_run(args, doc):
"""command line tool"""
try:
@@ -289,4 +289,4 @@
if not password:
password = getpass('password: ')
return connect(user=user, password=password, host=optconfig.host, database=appid)
-
+