~dobey/ubuntu/oneiric/ubuntuone-control-panel/release-113

« back to all changes in this revision

Viewing changes to bin/ubuntuone-control-panel-qt

  • Committer: Sebastien Bacher
  • Date: 2011-07-25 13:17:38 UTC
  • mfrom: (25.1.2 ubuntuone-control-panel)
  • Revision ID: seb128@ubuntu.com-20110725131738-yuevatnd859d1phs
Tags: 1.1.1-0ubuntu1
releasing version 1.1.1-0ubuntu1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
# -*- coding: utf-8 -*-
 
3
 
 
4
# Authors: Natalia B Bidart <natalia.bidart@canonical.com>
 
5
#          Eric Casteleijn <eric.casteleijn@canonical.com>
 
6
#
 
7
# Copyright 2010 Canonical Ltd.
 
8
#
 
9
# This program is free software: you can redistribute it and/or modify it
 
10
# under the terms of the GNU General Public License version 3, as published
 
11
# by the Free Software Foundation.
 
12
#
 
13
# This program is distributed in the hope that it will be useful, but
 
14
# WITHOUT ANY WARRANTY; without even the implied warranties of
 
15
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
 
16
# PURPOSE.  See the GNU General Public License for more details.
 
17
#
 
18
# You should have received a copy of the GNU General Public License along
 
19
# with this program.  If not, see <http://www.gnu.org/licenses/>.
 
20
"""Execute the graphical interface for the Ubuntu One control panel."""
 
21
 
 
22
# Invalid name "ubuntuone-control-panel-qt", pylint: disable=C0103
 
23
 
 
24
import gettext
 
25
import sys
 
26
 
 
27
from optparse import OptionParser
 
28
 
 
29
from ubuntuone.controlpanel import TRANSLATION_DOMAIN
 
30
 
 
31
gettext.textdomain(TRANSLATION_DOMAIN)
 
32
# import the GUI after the translation domain has been set
 
33
from ubuntuone.controlpanel.gui.qt import main
 
34
 
 
35
 
 
36
def parser_options():
 
37
    """Parse command line parameters."""
 
38
    usage = "Usage: %prog [option]"
 
39
    result = OptionParser(usage=usage)
 
40
    result.add_option("", "--switch-to", dest="switch_to", type="string",
 
41
                      metavar="PANEL_NAME", default="",
 
42
                      help="Start the Ubuntu One Control Panel (QT) in the "
 
43
                           "PANEL_NAME tab. Possible values are: "
 
44
                           "dashboard, volumes, devices, applications")
 
45
    result.add_option("-a", "--alert", dest="alert", action="store_true",
 
46
                      default=False, help="Start the Ubuntu One Control Panel "
 
47
                      "(QT) alerting the user to its presence.")
 
48
    return result
 
49
 
 
50
 
 
51
if __name__ == "__main__":
 
52
    parser = parser_options()
 
53
    (options, args) = parser.parse_args(sys.argv)
 
54
    main.main(switch_to=options.switch_to, alert=options.alert)