Skip to content

Commit b71fad4

Browse files
committed
修复路径异常的bug,更加简易的命令行调用
1 parent 0842aad commit b71fad4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

AutoCython.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ def remove(path, name):
201201
try:
202202
dirname, filename = os.path.split(file_path)
203203
setup_file = 'AutoCython_' + filename
204+
if not dirname:
205+
dirname ='.'
204206
with open(os.path.join(dirname, setup_file), 'w', encoding='utf-8') as f:
205207
f.write(self._setup_file_str.format(filename))
206208

@@ -341,7 +343,7 @@ def __init__(self):
341343
self.file_path = ''
342344
self.a_file_flag = False
343345

344-
self.version = 'AutoCython V1.2.3'
346+
self.version = 'AutoCython V1.2.5'
345347
# 像这样写格式好看一点
346348
self.help_info =(
347349
"Usage: AutoCython [options] ...\n"+
@@ -376,7 +378,11 @@ def geto(self) -> (str, list, str, list):
376378
sys.exit(1)
377379

378380
if args:
379-
self.compile_path = args[0]
381+
if os.path.isfile(args[0]):
382+
self.file_path = args[0]
383+
self.a_file_flag = True
384+
else:
385+
self.compile_path = args[0]
380386

381387
for opt, arg in opts:
382388
if opt in ('-h', '-H','--help'):

0 commit comments

Comments
 (0)