From 28c893a878bd685f61e5a1a34e6f46a32d97efc1 Mon Sep 17 00:00:00 2001 From: asergi Date: Sat, 12 Jan 2013 20:02:00 +0100 Subject: [PATCH] Fix setup.py --- glances/glances.py | 9 +++++---- setup.py | 44 +++++++++++++++++++++++--------------------- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/glances/glances.py b/glances/glances.py index 58c1aa91..abfe6356 100755 --- a/glances/glances.py +++ b/glances/glances.py @@ -182,7 +182,8 @@ else: csv_lib_tag = True # Define the default configuration file -default_conf_file = "/etc/glances.conf" +DEFAULT_CONF_FILE = "/etc/glances/glances.conf" + # Classes #======== @@ -228,7 +229,7 @@ class glancesLimits: 'PROCESS_CPU': [50, 70, 90], 'PROCESS_MEM': [50, 70, 90]} - def __init__(self, conf_file = default_conf_file): + def __init__(self, conf_file=DEFAULT_CONF_FILE): # Open the configuration file config = ConfigParser.RawConfigParser() if (config.read(conf_file) != []): @@ -3297,7 +3298,7 @@ def printSyntax(): print(_("\t-B @IP|host\tBind server to the given IP or host NAME")) print(_("\t-c @IP|host\tConnect to a Glances server")) print(_("\t-C file\t\tPath to the configuration file (default: %s)") % - default_conf_file) + DEFAULT_CONF_FILE) print(_("\t-d\t\tDisable disk I/O module")) print(_("\t-e\t\tEnable the sensors module (Linux-only)")) print(_("\t-f file\t\tSet the output folder (HTML) or file (CSV)")) @@ -3362,7 +3363,7 @@ def main(): server_tag = False # Default configuration file (if exist) - conf_file = default_conf_file + conf_file = DEFAULT_CONF_FILE # Set the default refresh time refresh_time = 3 diff --git a/setup.py b/setup.py index 2f696eed..f65ad885 100755 --- a/setup.py +++ b/setup.py @@ -12,10 +12,10 @@ data_files = [ 'COPYING', 'AUTHORS', 'NEWS', - 'screenshot.png']), + 'screenshot.png', + 'glances/conf/glances.conf']), ('share/doc/glances/doc', glob('doc/*.png')), - ('/etc', ['glances/conf/glances.conf']), - ('share/glances/conf-default', ['glances/conf/glances.conf']), + ('etc/glances', ['glances/conf/glances.conf']), ('share/glances/html', glob('glances/html/*.html')), ('share/glances/css', glob('glances/css/*.css')), ('share/glances/img', glob('glances/img/*.png')), @@ -24,22 +24,24 @@ data_files = [ for mo in glob('i18n/*/LC_MESSAGES/*.mo'): data_files.append((dirname(mo).replace('i18n/', 'share/locale/'), [mo])) -setup(name='Glances', - version='1.6b', - download_url='https://s3.amazonaws.com/glances/glances-1.6b.tar.gz', - url='https://github.com/nicolargo/glances', - description='CLI curses-based monitoring tool', - author='Nicolas Hennion', - author_email='nicolas@nicolargo.com', - license="LGPL", - keywords="cli curses monitoring system", - long_description=open('README').read(), - install_requires=['psutil>=0.4.1'], - packages=['glances'], - extras_require = { - 'HTML': ['jinja2>=2.0'], - 'SENSORS': ['pysensors>=0.0.2'],}, - include_package_data=True, - data_files=data_files, - entry_points={"console_scripts": ["glances = glances.glances:main"]}, +setup( + name='Glances', + version='1.6b', + download_url='https://s3.amazonaws.com/glances/glances-1.6b.tar.gz', + url='https://github.com/nicolargo/glances', + description='CLI curses-based monitoring tool', + author='Nicolas Hennion', + author_email='nicolas@nicolargo.com', + license="LGPL", + keywords="cli curses monitoring system", + long_description=open('README').read(), + install_requires=['psutil>=0.4.1'], + packages=['glances'], + extras_require={ + 'HTML': ['jinja2>=2.0'], + 'SENSORS': ['pysensors>=0.0.2'], + }, + include_package_data=True, + data_files=data_files, + entry_points={"console_scripts": ["glances=glances.glances:main"]}, )