Skip to content

Commit fa5b51c

Browse files
committed
include pycatia-exe.py for building with nuitka
1 parent d06a8c1 commit fa5b51c

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ pycatia-exe.build
140140
pycatia-exe.dist
141141
zip_win32_dist.py
142142
win_32/pycatia
143-
pycatia-exe.py
144143
logo*
145144
*.cgr
146145

pycatia-exe.py

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# !/usr/bin/python3.10
2+
3+
"""
4+
This script is strictly for the use of generating the pycatia.exe executable.
5+
"""
6+
7+
import argparse
8+
import sys
9+
import textwrap
10+
from pathlib import Path
11+
from pycatia.version import version
12+
13+
if __name__ == "__main__":
14+
15+
prog = "pycatia"
16+
17+
parser = argparse.ArgumentParser(
18+
formatter_class=argparse.RawDescriptionHelpFormatter,
19+
description=textwrap.dedent('''\
20+
=====================================================================
21+
pycatia
22+
=====================================================================
23+
This executable is currently provided for testing purposes only.
24+
Documentation: https://pycatia.readthedocs.io/en/latest/
25+
=====================================================================
26+
'''),
27+
prog=prog,
28+
usage="pycatia.exe file_name.py")
29+
30+
parser.add_argument("filename",
31+
type=str,
32+
help="The full path filename of the python script file.")
33+
parser.add_argument('--version', action='version', version=f'{prog} {version}')
34+
35+
filename = Path(parser.parse_args().filename)
36+
37+
if filename.exists():
38+
39+
import pycatia
40+
41+
exec(open(filename).read())
42+
else:
43+
raise FileNotFoundError(f'Could not find file "{filename}". Try using the full path name.')

0 commit comments

Comments
 (0)