~evfool/update-manager/lp1013325

« back to all changes in this revision

Viewing changes to update-manager-text

  • Committer: Michael Vogt
  • Date: 2008-12-18 15:36:01 UTC
  • Revision ID: michael.vogt@ubuntu.com-20081218153601-kmluxt1cx76vm0gq
UpdateManagerText: add text UI

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
# update-manager-text - easy updating application
 
3
#  
 
4
#  Copyright (c) 2004-2008 Canonical
 
5
#                2004-2008 Michael Vogt
 
6
#  
 
7
#  Author: Michael Vogt <mvo@debian.org>
 
8
 
9
#  This program is free software; you can redistribute it and/or 
 
10
#  modify it under the terms of the GNU General Public License as 
 
11
#  published by the Free Software Foundation; either version 2 of the
 
12
#  License, or (at your option) any later version.
 
13
 
14
#  This program is distributed in the hope that it will be useful,
 
15
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
#  GNU General Public License for more details.
 
18
 
19
#  You should have received a copy of the GNU General Public License
 
20
#  along with this program; if not, write to the Free Software
 
21
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 
22
#  USA
 
23
 
 
24
from UpdateManagerText.UpdateManagerText import UpdateManagerText
 
25
import sys
 
26
 
 
27
from DistUpgrade.DistUpgradeVersion import VERSION
 
28
import gettext
 
29
from gettext import gettext as _
 
30
 
 
31
from optparse import OptionParser
 
32
 
 
33
if __name__ == "__main__":
 
34
  APP="update-manager"
 
35
  DIR="/usr/share/locale"
 
36
 
 
37
  gettext.bindtextdomain(APP, DIR)
 
38
  gettext.textdomain(APP)
 
39
 
 
40
  # Begin parsing of options
 
41
  parser = OptionParser()
 
42
  parser.add_option ("-V", "--version", action="store_true",
 
43
                     dest="show_version", default=False,
 
44
                     help=_("Show version and exit"))
 
45
  parser.add_option ("--show-description", "--show-description", 
 
46
                     action="store_true",
 
47
                     dest="show_description", default=False,
 
48
                     help=_("Show description of the package instead of "
 
49
                            "the changelog"))
 
50
 
 
51
  (options, args) = parser.parse_args()
 
52
 
 
53
  data_dir="/usr/share/update-manager/"
 
54
 
 
55
  if options.show_version:
 
56
    print "%s: version %s" % (os.path.basename(sys.argv[0]), VERSION)
 
57
    sys.exit(0)
 
58
 
 
59
  app = UpdateManagerText(data_dir)
 
60
  app.main(options)