Skip to content

Commit

Permalink
🐛 HOLY SHIT MACS ARE STUPID
Browse files Browse the repository at this point in the history
... if the programmer rants of something being stupid, most of the times the programmer theyself was stupid ;)
  • Loading branch information
runxel committed Jun 8, 2019
1 parent 9aec714 commit 7fb7079
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions GDL.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ def check_system():
operating system of the user.
"""
if sys.platform.startswith('darwin'): # OSX
return "/Contents/MacOS/LP_XMLConverter.app/Contents/MacOS/LP_XMLConverter"
return "Contents/MacOS/LP_XMLConverter.app/Contents/MacOS/LP_XMLConverter"
elif sys.platform.startswith('win'): # Windows
return "/LP_XMLConverter.exe"
return "LP_XMLConverter.exe"
else:
sublime.error_message("GDL build error: Your OS is not supported.")
return
Expand Down Expand Up @@ -138,7 +138,7 @@ def show_quick_panel(self, options, done):
sublime.set_timeout(lambda: self.window.show_quick_panel(options, done), 10)

def run_hsf(self, ):
converter = self.AC_path + self.os
converter = os.path.join(self.AC_path, self.os)
cmd = [converter, "libpart2hsf", self.cmdargs, self.file_to_convert, self.project_folder] # cmd, source, dest
cmd = list(filter(None, cmd)) # filters out the empty cmdargs. otherwise Macs get hiccups. sigh.
log.debug("GDL Command run: " + " ".join(cmd))
Expand Down Expand Up @@ -199,35 +199,30 @@ def select_project(self, select):
self.on_done_proj() # go on here

def find_hsf(self):
# self.folders = []
#for fldr in os.listdir(self.project_folder):
# for fldr in os.scandir(self.project_folder):
# self.folders.append(fldr.name)
self.folders = [fldr for fldr in os.listdir(self.project_folder) if os.path.isdir(os.path.join(self.project_folder, fldr))]
print(self.folders)

if len(self.folders) <= 0:
sublime.error_message("GDL build error: No HSF found.")

if len(self.folders) > 1:
self.show_quick_panel(self.folders, self.select_hsf)
else:
self.folder_to_convert = self.project_folder + "\\" + self.folders[0]
self.folder_to_convert = os.path.join(self.project_folder,self.folders[0])
self.on_done_file() # go on here

def select_hsf(self, select):
folders = self.folders
if select < 0: # will be -1 if panel was cancelled
return
self.folder_to_convert = self.project_folder + "\\" + folders[select]
self.folder_to_convert = os.path.join(self.project_folder, folders[select])
self.on_done_file() # go on here

# Sublime Text 3 requires a short timeout between quick panels
def show_quick_panel(self, options, done):
sublime.set_timeout(lambda: self.window.show_quick_panel(options, done), 10)

def run_libpart(self):
converter = self.AC_path + self.os
converter = os.path.join(self.AC_path, self.os)
cmd = [converter, "hsf2libpart", self.cmdargs, self.folder_to_convert, self.gsm_name] # cmd, source, dest
cmd = list(filter(None, cmd)) # filters out the empty cmdargs. otherwise Macs get hiccups. sigh.
log.debug("GDL Command run: " + " ".join(cmd))
Expand Down

0 comments on commit 7fb7079

Please sign in to comment.