Skip to content

Commit c673fb1

Browse files
committed
fix some bug
1 parent 60e5591 commit c673fb1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

binpython.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ def importpygame():
149149
if libs_warning == "1":
150150
print("Warning: Some file manipulation libraries for BINPython do not exist, such as filecmp and tempfile. Because they weren't built when they were built. If you need to fix this warning, please complete the support libraries imported in the source code when building (use pip or build it yourself), if your system does not support these libraries, you can remove or change this prompt in the source code and rebuild")
151151
print("")
152+
153+
152154
#main BINPython
153155
def binpython_welcome_text():
154156
print("BINPython " + ver + "-" + releases_ver + " (Python Version:" + platform.python_version() + ") By: Edward Hsing(Xing Yu Jie) https://github.com/xingyujie/binpython[Running on " + platform.platform() + " " + platform.version() + "]")
@@ -367,6 +369,10 @@ class cmdshell(cmd.Cmd):
367369
intro = 'Welcome to BINPython Shell. Type help or ? to list commands and help.\n'
368370
prompt = cmd_username + '@' + cmd_hostname + ':# '
369371
file = None
372+
try:
373+
os.makedirs(runpath + f"/binpython_files/cmd/")
374+
except:
375+
pass
370376
try:
371377
f = open(runpath + f"/binpython_files/cmd/cmd.py", "r")
372378
exec(f.read())
@@ -589,7 +595,7 @@ def do_listapps(self, arg):
589595
print('Can not list apps, please see the log "binpython_pkg_error.log" for details')
590596
f = open("binpython_pkg_error.log", "a")
591597
f.write('List package Error: ' + time.strftime('%m-%d-%Y %H:%M:%S',time.localtime(time.time())) + ' ' + str(error) + '\n')
592-
def do_editsouce(self, arg):
598+
def do_editsource(self, arg):
593599
'To change the software source, usage: editsouce <souceurl>. Please pay attention to the software source specification, otherwise you will get an error. <souceurl> like this: http://xxx.com/'
594600
f = open(runpath + f"/binpython_files/apps/source.config", "w")
595601
f.write(arg)
@@ -637,6 +643,7 @@ def do_initcmd(self, arg):
637643
f = open("binpython_cmd_error.log", "a")
638644
f.write('Init CMD Error: ' + time.strftime('%m-%d-%Y %H:%M:%S',time.localtime(time.time())) + ' ' + str(error) + '\n')
639645

646+
640647
if __name__ == '__main__':
641648
cmdshell().cmdloop()
642649
#cmd end

0 commit comments

Comments
 (0)