~ubuntu-branches/ubuntu/oneiric/alarm-clock/oneiric

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
#!/usr/bin/env python

# Alarm Clock 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; either version 2 of the License, or
# (at your option) any later version.

# Alarm Clock 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.

# You should have received a copy of the GNU General Public License
# along with Alarm Clock; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA

# Copyright 2007-2008 Tomasz Salacinski <tsalacinski@gmail.com>

import gettext
import locale
from gettext import gettext as _
import sys

locale.setlocale(locale.LC_ALL, '')
gettext.textdomain('pyalarm')
gettext.bindtextdomain('pyalarm', "/usr/share/locale")

try:
	Argument = sys.argv[1]
except:
	Argument = None

if Argument == None:
	import pyalarm
	pyalarm.StartGUI().Initialize()
else:
	Parsed = False
	if Argument == "--help" or Argument ==  "-h" or Argument == "-?":
		print _("Usage:")
		print _("  %s [--OPTION]") % sys.argv[0]
		print "\n"
		print _("Available options:")
		print _("  -?, -h, --help        Show this help")
		print _("  -v, --version         Show version")
		print _("  -t, --tray            Start minimized")
		print "\n"
		Parsed = True
	if Argument == "-v" or Argument == "--version":
		print _("Alarm Clock version %s") % "0.9.4"
		Parsed = True
	if Argument == "-t" or Argument == "--tray":
		import pyalarm
		pyalarm.StartGUI().Initialize(True)
		Parsed = True

	if Parsed == False:
		print _("Unknown parameter, use --help for help.")