317 | | if os.path.isfile("conf/pykota.conf.sample") : |
318 | | answer = raw_input("Do you want to install\n\tconf/pykota.conf.sample as /etc/pykota/pykota.conf (y/N) ? ") |
319 | | if answer[0:1].upper() == 'Y' : |
320 | | try : |
321 | | shutil.copy("conf/pykota.conf.sample", os.path.join(ETC_DIR,"pykota.conf")) |
322 | | shutil.copy("conf/pykotadmin.conf.sample", os.path.join(ETC_DIR,"pykotadmin.conf")) |
323 | | except IOError, msg : |
324 | | sys.stderr.write("WARNING : Problem while installing sample configuration files in /etc/pykota/, please do it manually.\n%s\n" % msg) |
325 | | else : |
326 | | sys.stdout.write("Configuration file /etc/pykota/pykota.conf and /etc/pykota/pykotadmin.conf installed.\nDon't forget to adapt these files to your needs.\n") |
| 338 | if DEBIAN_BUILD_PACKAGE : |
| 339 | try : |
| 340 | shutil.copy("conf/pykota.conf.sample", os.path.join(ETC_DIR,"pykota.conf")) |
| 341 | shutil.copy("conf/pykotadmin.conf.sample", os.path.join(ETC_DIR,"pykotadmin.conf")) |
| 342 | except IOError, msg : |
| 343 | sys.stderr.write("WARNING : Problem while installing sample configuration files in /etc/pykota/, please do it manually.\n%s\n" % msg) |
| 344 | else : |
| 345 | if os.path.isfile("conf/pykota.conf.sample") : |
| 346 | answer = raw_input("Do you want to install\n\tconf/pykota.conf.sample as /etc/pykota/pykota.conf (y/N) ? ") |
| 347 | if answer[0:1].upper() == 'Y' : |
| 348 | try : |
| 349 | shutil.copy("conf/pykota.conf.sample", os.path.join(ETC_DIR,"pykota.conf")) |
| 350 | shutil.copy("conf/pykotadmin.conf.sample", os.path.join(ETC_DIR,"pykotadmin.conf")) |
| 351 | except IOError, msg : |
| 352 | sys.stderr.write("WARNING : Problem while installing sample configuration files in /etc/pykota/, please do it manually.\n%s\n" % msg) |
| 353 | else : |
| 354 | sys.stdout.write("Configuration file /etc/pykota/pykota.conf and /etc/pykota/pykotadmin.conf installed.\nDon't forget to adapt these files to your needs.\n") |
| 355 | else : |
| 356 | sys.stderr.write("WARNING : PyKota won't run without a configuration file !\n") |
401 | | sys.stdout.write("You can now activate the database caching mechanism\nwhich is disabled by default.\nIt is especially recommended with the LDAP backend.\n") |
402 | | sys.stdout.write("You can now disable the preservation of the complete\njob history which is enabled by default.\nIt is probably more useful with the LDAP backend.\n") |
403 | | sys.stdout.write("PLEASE LOOK AT THE SAMPLE CONFIGURATION FILE conf/pykota.conf.sample\n") |
404 | | sys.stdout.write("TO LEARN HOW TO DO\n") |
405 | | dummy = raw_input("Please press ENTER when you have read the message above. ") |
406 | | sys.stdout.write("\n") |
| 431 | if not DEBIAN_BUILD_PACKAGE : |
| 432 | sys.stdout.write("You can now activate the database caching mechanism\nwhich is disabled by default.\nIt is especially recommended with the LDAP backend.\n") |
| 433 | sys.stdout.write("You can now disable the preservation of the complete\njob history which is enabled by default.\nIt is probably more useful with the LDAP backend.\n") |
| 434 | sys.stdout.write("PLEASE LOOK AT THE SAMPLE CONFIGURATION FILE conf/pykota.conf.sample\n") |
| 435 | sys.stdout.write("TO LEARN HOW TO DO\n") |
| 436 | dummy = raw_input("Please press ENTER when you have read the message above. ") |
| 437 | sys.stdout.write("\n") |
413 | | sys.stdout.write("WARNING : IF YOU ARE UPGRADING FROM A PRE-1.19alpha17 TO 1.19alpha17 OR ABOVE\n") |
414 | | sys.stdout.write("AND USE THE POSTGRESQL BACKEND, THEN YOU HAVE TO MODIFY YOUR\n") |
415 | | sys.stdout.write("DATABASE SCHEMA USING initscripts/postgresql/upgrade-to-1.19.sql\n") |
416 | | sys.stdout.write("PLEASE READ DOCUMENTATION IN initscripts/postgresql/ TO LEARN HOW TO DO.\n") |
417 | | sys.stdout.write("YOU CAN DO THAT AFTER THE INSTALLATION IS FINISHED, OR PRESS CTRL+C NOW.\n") |
418 | | sys.stdout.write("\n\nYOU DON'T HAVE ANYTHING SPECIAL TO DO IF THIS IS YOUR FIRST INSTALLATION\nOR IF YOU ARE ALREADY RUNNING VERSION 1.19alpha17 OR ABOVE.\n\n") |
419 | | dummy = raw_input("Please press ENTER when you have read the message above. ") |
420 | | |
421 | | sys.stdout.write("\n\nWARNING : IF YOU ARE UPGRADING FROM A PRE-1.19alpha10 TO 1.19alpha10 OR ABOVE\n") |
422 | | sys.stdout.write("YOU **MUST** MODIFY YOUR /etc/pykota/pykota.conf FILE BECAUSE accounter\n") |
423 | | sys.stdout.write("AND requester DIRECTIVES SUPPORTED VALUES HAVE CHANGED.\n\n") |
424 | | sys.stdout.write("YOU CAN DO THAT AFTER THE INSTALLATION IS FINISHED, OR PRESS CTRL+C NOW.\n") |
425 | | sys.stdout.write("\n\nYOU DON'T HAVE ANYTHING SPECIAL TO DO IF THIS IS YOUR FIRST INSTALLATION\nOR IF YOU ARE ALREADY RUNNING VERSION 1.19alpha10 OR ABOVE.\n\n") |
426 | | dummy = raw_input("Please press ENTER when you have read the message above. ") |
| 446 | if not DEBIAN_BUILD_PACKAGE : |
| 447 | sys.stdout.write("WARNING : IF YOU ARE UPGRADING FROM A PRE-1.19alpha17 TO 1.19alpha17 OR ABOVE\n") |
| 448 | sys.stdout.write("AND USE THE POSTGRESQL BACKEND, THEN YOU HAVE TO MODIFY YOUR\n") |
| 449 | sys.stdout.write("DATABASE SCHEMA USING initscripts/postgresql/upgrade-to-1.19.sql\n") |
| 450 | sys.stdout.write("PLEASE READ DOCUMENTATION IN initscripts/postgresql/ TO LEARN HOW TO DO.\n") |
| 451 | sys.stdout.write("YOU CAN DO THAT AFTER THE INSTALLATION IS FINISHED, OR PRESS CTRL+C NOW.\n") |
| 452 | sys.stdout.write("\n\nYOU DON'T HAVE ANYTHING SPECIAL TO DO IF THIS IS YOUR FIRST INSTALLATION\nOR IF YOU ARE ALREADY RUNNING VERSION 1.19alpha17 OR ABOVE.\n\n") |
| 453 | dummy = raw_input("Please press ENTER when you have read the message above. ") |
| 454 | |
| 455 | sys.stdout.write("\n\nWARNING : IF YOU ARE UPGRADING FROM A PRE-1.19alpha10 TO 1.19alpha10 OR ABOVE\n") |
| 456 | sys.stdout.write("YOU **MUST** MODIFY YOUR /etc/pykota/pykota.conf FILE BECAUSE accounter\n") |
| 457 | sys.stdout.write("AND requester DIRECTIVES SUPPORTED VALUES HAVE CHANGED.\n\n") |
| 458 | sys.stdout.write("YOU CAN DO THAT AFTER THE INSTALLATION IS FINISHED, OR PRESS CTRL+C NOW.\n") |
| 459 | sys.stdout.write("\n\nYOU DON'T HAVE ANYTHING SPECIAL TO DO IF THIS IS YOUR FIRST INSTALLATION\nOR IF YOU ARE ALREADY RUNNING VERSION 1.19alpha10 OR ABOVE.\n\n") |
| 460 | dummy = raw_input("Please press ENTER when you have read the message above. ") |
429 | | modulestocheck = [ ("PygreSQL", "pg", "PygreSQL is mandatory if you want to use PostgreSQL as the quota storage backend.\nSee http://www.pygresql.org"), |
430 | | ("mxDateTime", "mx.DateTime", "eGenix' mxDateTime is mandatory for PyKota to work.\nSee http://www.egenix.com"), |
431 | | ("Python-LDAP", "ldap", "Python-LDAP is mandatory if you plan to use an LDAP\ndirectory as the quota storage backend.\nSee http://python-ldap.sf.net"), |
432 | | ("Python-OSD", "pyosd", "Python-OSD is recommended if you plan to use the X Window On Screen Display\nprint quota reminder named pykosd."), |
433 | | ("Python-SNMP", "pysnmp", "Python-SNMP is recommended if you plan to use hardware\naccounting with printers which support SNMP.\nSee http://pysnmp.sf.net"), |
434 | | ("Python-JAXML", "jaxml", "Python-JAXML is recommended if you plan to dump datas in the XML format.\nSee http://www.librelogiciel.com/software/"), |
435 | | ] |
436 | | commandstocheck = [("SNMP Tools", "snmpget", "SNMP Tools are needed if you want to use SNMP enabled printers."), ("Netatalk", "pap", "Netatalk is needed if you want to use AppleTalk enabled printers.")] |
437 | | for (name, module, helper) in modulestocheck : |
438 | | action = checkWithPrompt(name, module=module, helper=helper) |
439 | | if action == ACTION_ABORT : |
440 | | sys.stderr.write("Aborted !\n") |
441 | | sys.exit(-1) |
442 | | |
443 | | # checks if some software are there or not. |
444 | | for (name, command, helper) in commandstocheck : |
445 | | action = checkWithPrompt(name, command=command, helper=helper) |
446 | | if action == ACTION_ABORT : |
447 | | sys.stderr.write("Aborted !\n") |
448 | | sys.exit(-1) |
| 463 | if not DEBIAN_BUILD_PACKAGE : |
| 464 | modulestocheck = [ ("PygreSQL", "pg", "PygreSQL is mandatory if you want to use PostgreSQL as the quota storage backend.\nSee http://www.pygresql.org"), |
| 465 | ("mxDateTime", "mx.DateTime", "eGenix' mxDateTime is mandatory for PyKota to work.\nSee http://www.egenix.com"), |
| 466 | ("Python-LDAP", "ldap", "Python-LDAP is mandatory if you plan to use an LDAP\ndirectory as the quota storage backend.\nSee http://python-ldap.sf.net"), |
| 467 | ("Python-OSD", "pyosd", "Python-OSD is recommended if you plan to use the X Window On Screen Display\nprint quota reminder named pykosd."), |
| 468 | ("Python-SNMP", "pysnmp", "Python-SNMP is recommended if you plan to use hardware\naccounting with printers which support SNMP.\nSee http://pysnmp.sf.net"), |
| 469 | ("Python-JAXML", "jaxml", "Python-JAXML is recommended if you plan to dump datas in the XML format.\nSee http://www.librelogiciel.com/software/"), |
| 470 | ] |
| 471 | commandstocheck = [("SNMP Tools", "snmpget", "SNMP Tools are needed if you want to use SNMP enabled printers."), ("Netatalk", "pap", "Netatalk is needed if you want to use AppleTalk enabled printers.")] |
| 472 | for (name, module, helper) in modulestocheck : |
| 473 | action = checkWithPrompt(name, module=module, helper=helper) |
| 474 | if action == ACTION_ABORT : |
| 475 | sys.stderr.write("Aborted !\n") |
| 476 | sys.exit(-1) |
| 477 | |
| 478 | # checks if some software are there or not. |
| 479 | for (name, command, helper) in commandstocheck : |
| 480 | action = checkWithPrompt(name, command=command, helper=helper) |
| 481 | if action == ACTION_ABORT : |
| 482 | sys.stderr.write("Aborted !\n") |
| 483 | sys.exit(-1) |