-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patharguments.py
More file actions
59 lines (49 loc) · 2.06 KB
/
Copy patharguments.py
File metadata and controls
59 lines (49 loc) · 2.06 KB
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
58
59
# -*- coding: utf-8 -*-
#
# This file is part of Documentor
# (https://github.com/diegosarmentero/documentor).
#
# Documentor 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 3 of the License, or
# any later version.
#
# Documentor 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 Documentor; If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
import argparse
usage = ("$code_translator -p project_path [-o output_path] "
"[-t project_path]")
epilog = ("This program comes with ABSOLUTELY NO WARRANTY."
"This is free software, and you are welcome to redistribute "
"it under certain conditions; for details see LICENSE.txt.")
def parse():
"""Parse the arguments received from the command line."""
global usage
global epilog
project = None
#project_to_translate = None
output = None
try:
parser = argparse.ArgumentParser(description=usage, epilog=epilog)
parser.add_argument('-p', '--project', metavar='Project to PO',
type=str,
help='Read the source code of this project and generate po files',
default=None)
#parser.add_argument('-t', '--translate', metavar='Translate Project',
#type=str, help='Source code to translate', default=None)
parser.add_argument('-o', '--output', metavar='Output Folder', type=str,
help='Place to locate the outpur result', default=".")
opts = parser.parse_args()
project = opts.project
#project_to_translate = opts.translate
output = opts.output
except Exception as reason:
print("Args couldn't be parsed.")
print(reason)
return (project, output)