Changeset 973 for pykota/trunk/setup.py

Show
Ignore:
Timestamp:
04/29/03 20:37:54 (21 years ago)
Author:
jalet
Message:

Pluggable accounting methods (actually doesn't support external scripts)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/setup.py

    r952 r973  
    2323# 
    2424# $Log$ 
     25# Revision 1.13  2003/04/29 18:37:54  jalet 
     26# Pluggable accounting methods (actually doesn't support external scripts) 
     27# 
    2528# Revision 1.12  2003/04/23 22:13:56  jalet 
    2629# Preliminary support for LPRng added BUT STILL UNTESTED. 
     
    7376import shutil 
    7477from distutils.core import setup 
     78import ConfigParser 
    7579 
    7680sys.path.insert(0, "pykota") 
     
    155159            else :         
    156160                sys.stderr.write("WARNING : PyKota won't run without a configuration file !\n") 
     161    else :             
     162        # Configuration file already exists. Check if this is an old version or not 
     163        # if the 'method: lazy' line is present, then the configuration file 
     164        # has to be updated. 
     165        oldconf = ConfigParser.ConfigParser() 
     166        oldconf.read(["/etc/pykota.conf"]) 
     167        try : 
     168            if oldconf.get("global", "method", raw=1).lower().strip() == "lazy" : 
     169                sys.stdout.write("You have got an OLD PyKota configuration file !\n") 
     170                sys.stdout.write("The 'method' statement IS NOT SUPPORTED ANYMORE\nand was replaced with the 'accounter' statement.\n")  
     171                sys.stdout.write("You have to manually set an 'accounter' statement,\neither globally or for each printer.\n") 
     172                sys.stdout.write("Please read the sample configuration file conf/pykota.conf.sample\n") 
     173                sys.stdout.write("to learn how to MANUALLY apply the modifications needed,\nafter the installation is done.\n") 
     174                sys.stdout.write("If you don't do this, then PyKota will stop working !\n") 
     175                answer = raw_input("Please, press ENTER when you'll have read the above paragraph.") 
     176        except ConfigParser.NoOptionError : 
     177            # New configuration file, OK 
     178            pass 
    157179     
    158180    # checks if some needed Python modules are there or not. 
     
    189211      author_email = "alet@librelogiciel.com", 
    190212      url = "http://www.librelogiciel.com/software/", 
    191       packages = [ "pykota", "pykota.storages", "pykota.requesters", "pykota.loggers" ], 
     213      packages = [ "pykota", "pykota.storages", "pykota.requesters", "pykota.loggers", "pykota.accounters" ], 
    192214      scripts = [ "bin/pykota", "bin/edpykota", "bin/repykota", "bin/warnpykota" ], 
    193215      data_files = data_files)