1
1
#!/usr/bin/env python3
2
- import gettext
3
- import locale
2
+ """
3
+ Inliner 1.1
4
+ A tool that converts indented BASIC programs into line numbered style.
5
+
6
+ Copyright (C) 2017-2018 by Giovanni Nunes <[email protected] >
7
+
8
+ This program is free software: you can redistribute it and/or modify
9
+ it under the terms of the GNU General Public License as published by
10
+ the Free Software Foundation; either version 3 of the License, or (at
11
+ your option) any later version.
12
+
13
+ Usage:
14
+ inliner <filename> [ --start=<line> --step=<value> --upper --rem ]
15
+ inliner --help
16
+
17
+ Options:
18
+ --help Show this screen.
19
+ --rem Use the REM statement istead of the apostrophe.
20
+ --upper Put all BASIC statements in uppercase.
21
+ """
4
22
import logging
5
23
from os import path
6
24
from docopt import docopt
@@ -11,28 +29,6 @@ START = 10
11
29
STEP = 10
12
30
13
31
14
- def init_locale ():
15
- """Initalize localization support. Checks the current system's locale
16
- and tries to load it if exists. Otherwise uses the default locale.
17
- """
18
- locale .setlocale (locale .LC_ALL , '' )
19
- (loc , enc ) = locale .getlocale ()
20
-
21
- filename = path .join (
22
- 'lang' , '{}.{}' , 'LC_MESSAGES/messages.mo' ).format (loc , enc )
23
-
24
- try :
25
- logging .debug (
26
- "Opening message file '%s' for locale '%s'" , filename , loc )
27
- trans = gettext .GNUTranslations (open (filename , "rb" ))
28
-
29
- except IOError :
30
- logging .debug ("Locale not found. Using default messages" )
31
- trans = gettext .NullTranslations ()
32
-
33
- trans .install ()
34
-
35
-
36
32
def main ():
37
33
38
34
# fist line and increment between lines
@@ -62,31 +58,7 @@ def main():
62
58
63
59
64
60
if __name__ == '__main__' :
65
-
66
- # initiaize localization support
67
- init_locale ()
68
-
69
- arguments = docopt (_ ("""
70
- Inliner 1.1
71
- A tool that converts indented BASIC programs into line numbered style.
72
-
73
- Copyright (C) 2017-2018 by Giovanni Nunes <[email protected] >
74
-
75
- This program is free software: you can redistribute it and/or modify
76
- it under the terms of the GNU General Public License as published by
77
- the Free Software Foundation; either version 3 of the License, or (at
78
- your option) any later version.
79
-
80
- Usage:
81
- inliner <filename> [ --start=<line> --step=<value> --upper --rem ]
82
- inliner --help
83
-
84
- Options:
85
- --help Show this screen.
86
- --rem Use the REM statement istead of the apostrophe.
87
- --upper Put all BASIC statements in uppercase.
88
- """ ))
89
-
61
+ arguments = docopt (__doc__ )
90
62
main ()
91
63
92
64
# vim: set fileencoding=utf-8
0 commit comments