/usr/bin/aptoncd is in aptoncd 0.1.98+bzr117-1.4.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | #! /usr/bin/python2.7 -tt
# -*- coding: utf-8 -*-
#####################################################################
# Rafael Proença <cypherbios@ubuntu.com>
# Laudeci Oliveira <laudeci@gmail.com>
#
# Copyright 2006 APTonCD DevTeam.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published
# by the Free Software Foundation; version 2 only.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#####################################################################
import os
import sys
import gtk
import locale
from gettext import gettext as _
import gettext
from optparse import OptionParser
from APTonCD.core import constants
from APTonCD.core import version
from APTonCD.ui import main_window
def run_main(temp_path = '', packages_path = ''):
m = main_window.MainWindow(temp_path, packages_path)
m.show()
gtk.main()
def run_create(temp_path = '', packages_path = ''):
from APTonCD.create import createWindow
create = createWindow.CreateWindow(temp_path, packages_path)
gtk.main()
def non_interactive_create(list_file, non_interactive):
from APTonCD.create import createWindow
create = createWindow.CreateWindow(packages_file_list = list_file, non_interactive = non_interactive)
if not non_interactive:
gtk.main()
def main(argv=None):
if argv is None:
argv = sys.argv
#this will validate if args are in correct way
parser = OptionParser()
parser.set_usage('aptoncd [OPTION] [FILE]\nRun aptoncd with command-line parameters.' )
parser.add_option('-v','--version', action='store_true', dest='app_version', default=False, help=_('output version information and exit.'))
parser.add_option('-l','--packages-list', action='store_true', dest='create_from_list', default=None, metavar='FILE', help=_('uses the packages listed in FILE to create a installation disc.'))
parser.add_option('-p','--cache-dir',dest='packages_path', default=constants.LOCAL_APT_FOLDER, metavar='PATH', help=_('uses PATH as folder to scan for packages instead of apt cache.'))
parser.add_option('-t','--temp-dir',dest='temp_path',default=constants.TEMP_FOLDER, metavar='PATH', help=_('uses PATH as temporary folder.'))
#parser.add_option('-i','--restore-iso', dest='restore_iso', default=None, metavar='FILE', help=_('starts aptoncd on restore .iso image mode.'))
parser.add_option('-n','--non-interactive', dest='non_interactive', action='store_true', default=False, help=_('placeholder'))
#parser.add_option('-c','--create', action='store_true', dest='create', default=False, help=_('starts aptoncd on create media-repository mode.'))
#parser.add_option('-r','--restore', action='store_true', dest='restore', default=False, help=_('starts aptoncd on restore media mode.'))
#parser.add_option('-d','--download', action='store_true', dest='download', default=False, help=_('starts aptoncd on download mode - WARNING: unstable.'))
options, args = parser.parse_args()
#if options.restore_iso:
# if options.restore_iso and options.non_interactive:
# print "Restoring iso in an automatic way without interaction..."
# print "...not really, just a placeholder. UNIMPLEMENTED: Sorry for that."
# sys.exit()
# else:
# parser.error("You must use --restore-iso in --non-interactive mode")
if options.create_from_list:
#try:
if not os.path.isfile(args[0]):
parser.error('File "%s" not found.' % args[0])
sys.exit(1)
else:
non_interactive_create(args[0], options.non_interactive)
sys.exit()
#except Exception,e:
# parser.error('File "%s" not exist.\n %s' % (args[0],str(e)))
# sys.exit(1)
elif options.packages_path and options.create_from_list:
parser.error("the --cache-dir overwrites the --packages-list option.\nYou cannot use them together")
elif not options.packages_path.startswith('/'):
parser.error(constants.MESSAGE_0065)
elif not options.temp_path.startswith('/'):
parser.error(constants.MESSAGE_0065)
if options.app_version:
print version.APP_VERSION
sys.exit()
#elif options.create:
# run_create(options.temp_path, options.packages_path)
else:
run_main(options.temp_path, options.packages_path)
if __name__ == '__main__':
main(sys.argv[1:])
locale.setlocale(locale.LC_ALL, '')
gettext.bindtextdomain(constants.I18N_APP, constants.I18N_DIR)
gettext.textdomain(constants.I18N_APP)
gtk.glade.bindtextdomain(constants.I18N_APP, constants.I18N_DIR)
gtk.glade.textdomain(constants.I18N_APP)
gettext.install(constants.I18N_APP, constants.I18N_DIR, unicode=1)
|