2 # -*- coding: UTF-8 -*-
3 # vim: expandtab sw=4 ts=4 sts=4:
6 Execution script for configuration
8 __author__
= 'Michal Čihař'
9 __email__
= 'michal@cihar.com'
11 Copyright © 2003 - 2010 Michal Čihař
13 This program is free software; you can redistribute it and/or modify it
14 under the terms of the GNU General Public License version 2 as published by
15 the Free Software Foundation.
17 This program is distributed in the hope that it will be useful, but WITHOUT
18 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
22 You should have received a copy of the GNU General Public License along with
23 this program; if not, write to the Free Software Foundation, Inc.,
24 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
33 import Wammu
.GammuSettings
36 # Try to import iconv_codec to allow working on chinese windows
44 Displays version information.
46 print (_('Wammu Configurator - Wammu and Gammu configurator version %s')
54 print _('Usage: %s [OPTION...]' % os
.path
.basename(__file__
))
57 print '%-20s ... %s' % (
60 print '%-20s ... %s' % (
62 _('show program version'))
63 print '%-20s ... %s' % (
65 _('force using of locales from current directory rather than system ones'))
70 Processes program options.
73 opts
, args
= getopt
.getopt(sys
.argv
[1:],
75 ['help', 'version', 'local-locales'])
76 except getopt
.GetoptError
, val
:
78 print _('Command line parsing failed with error:')
84 print _('Extra unrecognized parameters passed to program')
87 for opt
, dummy
in opts
:
88 if opt
in ('-l', '--local-locales'):
89 Wammu
.Locales
.UseLocal()
90 print _('Using local built locales!')
91 if opt
in ('-h', '--help'):
94 if opt
in ('-v', '--version'):
100 Runs configuration wizard.
102 app
= Wammu
.PhoneWizard
.WizardApp()
104 wammu_cfg
= Wammu
.WammuSettings
.WammuConfig()
106 config
= Wammu
.GammuSettings
.GammuSettings(wammu_cfg
)
108 position
= config
.SelectConfig(new
= True)
113 result
= Wammu
.PhoneWizard
.RunConfigureWizard(None, position
)
114 if result
is not None:
115 busy
= wx
.BusyInfo(_('Updating gammu configuration...'))
118 config
.SetConfig(result
['Position'],
120 result
['Connection'],
125 if __name__
== '__main__':
128 # need to be imported after locales are initialised
129 import Wammu
.PhoneWizard
130 import Wammu
.WammuSettings