Commit 43e8850a authored by carlosperate's avatar carlosperate

Updates to the python code to work on Mac OS X.

parent a0761c1f
...@@ -296,8 +296,8 @@ def browse_file(): ...@@ -296,8 +296,8 @@ def browse_file():
root.deiconify() root.deiconify()
root.lift() root.lift()
root.focus_force() root.focus_force()
types = [('All Files', '*')] root.update()
file_path = tkFileDialog.askopenfilename(filetypes=types) file_path = tkFileDialog.askopenfilename()
root.destroy() root.destroy()
return file_path return file_path
......
...@@ -87,8 +87,14 @@ class ServerCompilerSettings(object): ...@@ -87,8 +87,14 @@ class ServerCompilerSettings(object):
return self.__compiler_dir__ return self.__compiler_dir__
def set_compiler_dir(self, new_compiler_dir): def set_compiler_dir(self, new_compiler_dir):
""" The compiler dir must be full path to an .exe file. """ """ The compiler dir must a valid file or directory """
if os.path.isfile(new_compiler_dir): # Mac only check, as apps are packaged directories
if sys.platform == 'darwin':
new_compiler_dir += '/Contents/MacOS/JavaApplicationStub'
print('\nCompiler file in Mac OS located within the app ' +
'directory: /Contents/MacOS/JavaApplicationStub')
# Check directory
if os.path.exists(new_compiler_dir):
self.__compiler_dir__ = new_compiler_dir self.__compiler_dir__ = new_compiler_dir
print('\nCompiler directory set to:\n\t%s' % self.__compiler_dir__) print('\nCompiler directory set to:\n\t%s' % self.__compiler_dir__)
self.save_settings() self.save_settings()
...@@ -111,7 +117,7 @@ class ServerCompilerSettings(object): ...@@ -111,7 +117,7 @@ class ServerCompilerSettings(object):
def set_compiler_dir_from_file(self, new_compiler_dir): def set_compiler_dir_from_file(self, new_compiler_dir):
""" The compiler dir must be full path to an existing file. """ """ The compiler dir must be full path to an existing file. """
if os.path.isfile(new_compiler_dir): if os.path.exists(new_compiler_dir):
self.__compiler_dir__ = new_compiler_dir self.__compiler_dir__ = new_compiler_dir
else: else:
print('\nThe provided compiler path in the settings file is not ' + print('\nThe provided compiler path in the settings file is not ' +
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment