Skip to content

Commit 2fb7d10

Browse files
committed
🐛 mac should work now
1 parent e70d561 commit 2fb7d10

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

GDL.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
# -*- coding: utf-8 -*-
2+
13
import os
24
import sublime
35
import sublime_plugin
46
import sys
7+
import logging as log
58

69
PACKAGE_SETTINGS = "GDL.sublime-settings"
710
DEFAULT_AC_PATH = "C:/Program Files/GRAPHISOFT/ARCHICAD 23"
@@ -11,9 +14,9 @@ def check_system():
1114
operating system of the user.
1215
"""
1316
if sys.platform.startswith('darwin'): # OSX
14-
return "app"
17+
return "Contents/MacOS/LP_XMLConverter.app/Contents/MacOS/LP_XMLConverter"
1518
elif sys.platform.startswith('win'): # Windows
16-
return "exe"
19+
return "/LP_XMLConverter.exe"
1720
else:
1821
sublime.error_message("GDL build error: Your OS is not supported.")
1922
return
@@ -34,7 +37,7 @@ def get_project_data(view, invoke): # invoke is either 'to-hsf' or 'to-gsm'
3437
"""
3538
project_data = view.window().project_data()
3639
if not project_data:
37-
sublime.error_message("You must create a project first! (Project > Save Project As)")
40+
sublime.error_message("You must create a project first! (Project > Save Project As...)")
3841
return
3942

4043
project_settings = project_data.get('cmdargs', {})
@@ -49,6 +52,10 @@ def get_project_data(view, invoke): # invoke is either 'to-hsf' or 'to-gsm'
4952
sublime.error_message("Something went wrong.")
5053
return
5154

55+
# class AutocompleteCaps(sublime_plugin.EventListener):
56+
# def on_query_completions(self, view, prefix, locations):
57+
# return suggestions
58+
5259
# go to
5360
# http://gdl.graphisoft.com/tips-and-tricks/how-to-use-the-lp_xmlconverter-tool
5461
# for detailed information
@@ -131,8 +138,9 @@ def show_quick_panel(self, options, done):
131138
sublime.set_timeout(lambda: self.window.show_quick_panel(options, done), 10)
132139

133140
def run_hsf(self, ):
134-
converter = self.AC_path + "/LP_XMLConverter." + self.os
141+
converter = self.AC_path + self.os
135142
cmd = [converter, "libpart2hsf", self.cmdargs, self.file_to_convert, self.project_folder] # cmd, source, dest
143+
log.debug("GDL Command run: " + " ".join(cmd))
136144
execCMD = {"cmd": cmd}
137145

138146
self.window.run_command("exec", execCMD)
@@ -218,8 +226,9 @@ def show_quick_panel(self, options, done):
218226
sublime.set_timeout(lambda: self.window.show_quick_panel(options, done), 10)
219227

220228
def run_libpart(self):
221-
converter = self.AC_path + "/LP_XMLConverter.exe"
229+
converter = self.AC_path + self.os
222230
cmd = [converter, "hsf2libpart", self.cmdargs, self.folder_to_convert, self.gsm_name] # cmd, source, dest
231+
log.debug("GDL Command run: " + " ".join(cmd))
223232
execCMD = {"cmd": cmd}
224233

225234
self.window.run_command("exec", execCMD)

GDL.sublime-settings

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,8 @@
77
"rulers": [80,120],
88

99
// Path to the current Archicad, where the LP_XMLConverter resides
10-
"AC_path": "C:/Program Files/GRAPHISOFT/ARCHICAD 23",
10+
// example Win:
11+
"AC_path": "C:/Program Files/GRAPHISOFT/ARCHICAD 23"
12+
// example Mac:
13+
// "/Applications/GRAPHISOFT/AC23B3/ARCHICAD 23.app"
1114
}

0 commit comments

Comments
 (0)