From c49565fcb18b770817a82aec155dc70d547580ac Mon Sep 17 00:00:00 2001 From: Mika Bostrom Date: Tue, 17 Aug 2010 07:56:00 +0300 Subject: [PATCH] Fix config file copying for debian package If there is no config file in ~/.fpdb/ copy it from the package's /usr/share path --- pyfpdb/Configuration.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pyfpdb/Configuration.py b/pyfpdb/Configuration.py index 618d27da..ae578f57 100755 --- a/pyfpdb/Configuration.py +++ b/pyfpdb/Configuration.py @@ -84,6 +84,13 @@ def get_config(file_name, fallback = True): # print "config path 2=", config_path if os.path.exists(config_path): return (config_path,False) + # Copy from example (debian package) + try: + example_path = '/usr/share/python-fpdb/' + file_name + '.example' + shutil.copyfile(example_path, config_path) + return (config_path,False) + except IOError: + pass # No file found if not fallback: