Skip to content

Commit 7fb7079

Browse files
committed
🐛 HOLY SHIT MACS ARE STUPID
... if the programmer rants of something being stupid, most of the times the programmer theyself was stupid ;)
1 parent 9aec714 commit 7fb7079

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

GDL.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ def check_system():
1414
operating system of the user.
1515
"""
1616
if sys.platform.startswith('darwin'): # OSX
17-
return "/Contents/MacOS/LP_XMLConverter.app/Contents/MacOS/LP_XMLConverter"
17+
return "Contents/MacOS/LP_XMLConverter.app/Contents/MacOS/LP_XMLConverter"
1818
elif sys.platform.startswith('win'): # Windows
19-
return "/LP_XMLConverter.exe"
19+
return "LP_XMLConverter.exe"
2020
else:
2121
sublime.error_message("GDL build error: Your OS is not supported.")
2222
return
@@ -138,7 +138,7 @@ def show_quick_panel(self, options, done):
138138
sublime.set_timeout(lambda: self.window.show_quick_panel(options, done), 10)
139139

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

201201
def find_hsf(self):
202-
# self.folders = []
203-
#for fldr in os.listdir(self.project_folder):
204-
# for fldr in os.scandir(self.project_folder):
205-
# self.folders.append(fldr.name)
206202
self.folders = [fldr for fldr in os.listdir(self.project_folder) if os.path.isdir(os.path.join(self.project_folder, fldr))]
207-
print(self.folders)
208203

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

212207
if len(self.folders) > 1:
213208
self.show_quick_panel(self.folders, self.select_hsf)
214209
else:
215-
self.folder_to_convert = self.project_folder + "\\" + self.folders[0]
210+
self.folder_to_convert = os.path.join(self.project_folder,self.folders[0])
216211
self.on_done_file() # go on here
217212

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

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

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

0 commit comments

Comments
 (0)