| 94 | # checks if a configuration file is present in the old location |
| 95 | if os.path.isfile("/etc/cups/pykota.conf") : |
| 96 | if not os.path.isfile("/etc/pykota.conf") : |
| 97 | sys.stdout.write("From version 1.02 on, PyKota expects to find its configuration file in /etc instead of /etc/cups.\n") |
| 98 | sys.stdout.write("It seems that you've got a configuration file in the old location, so it will not be used anymore, and no configuration file in the new location.\n") |
| 99 | answer = raw_input("Do you want me to move your configuration file to the new location in /etc (y/N) ? ") |
| 100 | if answer[0:1].upper() == 'Y' : |
| 101 | try : |
| 102 | os.rename("/etc/cups/pykota.conf", "/etc/pykota.conf") |
| 103 | except OSError : |
| 104 | sys.stderr.write("ERROR : An error occured while moving /etc/cups/pykota.conf to /etc/pykota.conf\nAborted !\n") |
| 105 | sys.exit(-1) |
| 106 | else : |
| 107 | sys.stderr.write("WARNING : Configuration file /etc/cups/pykota.conf won't be used ! Move it to /etc instead.\n") |
| 108 | sys.stderr.write("PyKota installation will continue anyway, but the software won't run until you put a proper configuration file in /etc\n") |
| 109 | else : |
| 110 | sys.stderr.write("WARNING : Configuration file /etc/cups/pykota.conf will not be used !\nThe file /etc/pykota.conf will be used instead.\n") |
| 111 | |
| 112 | # checks if some needed Python modules are there or not. |