Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Apr 25, 2023. It is now read-only.

Commitcee07be

Browse files
committed
Minor bugfixes
1 parentea699be commitcee07be

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

‎handlers/python.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ def run(self, code_file):
1111
try:
1212
check_call(["bash","-c",'which -s python3'])
1313
exceptException:
14-
py_str="python3"
15-
else:
1614
py_str="python"
15+
else:
16+
py_str="python3"
1717
exit(run([py_str,code_file]).returncode)
1818

1919
defbuild(self,code,directory=None):
@@ -29,7 +29,7 @@ def run(self, code_file):
2929
try:
3030
check_call(["bash","-c",'which -s python2'])
3131
exceptException:
32-
py_str="python2"
33-
else:
3432
py_str="python"
33+
else:
34+
py_str="python2"
3535
exit(run([py_str,code_file]).returncode)

‎main.py‎

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,13 @@ def main(args=None):
2525
)
2626
parser.add_argument(
2727
"--keep",
28-
nargs=1,
2928
type=pathlib.Path,
3029
metavar="DIRECTORY",
3130
default=None,
3231
help="Store the script in the given directory",
3332
)
3433
parser.add_argument(
3534
"--filename",
36-
nargs=1,
3735
help="Give the stored file the speified name (does not do anything without --keep)",
3836
default="script",
3937
)
@@ -58,14 +56,13 @@ def main(args=None):
5856
forkey,valueinparsed_dict.items():
5957
ifvalue:
6058
parser=handlers["--"+key]
61-
break
62-
code=sys.stdin.read()
63-
ifns.keep:
64-
dir=ns.keep
65-
os.makedirs(dir,exist_ok=True)
66-
parser().build(code,str(dir.joinpath(ns.filename)))
67-
else:
68-
parser().build(code)
59+
code=sys.stdin.read()
60+
ifns.keep:
61+
dir=ns.keep
62+
os.makedirs(dir,exist_ok=True)
63+
parser().build(code,str(dir.joinpath(ns.filename))+"."+key)
64+
else:
65+
parser().build(code)
6966

7067

7168
if__name__=="__main__":

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp