@@ -277,14 +277,14 @@ def __init__(self, kbo, dirs, console):
277
277
278
278
def __preproc (self , kblibs , arg_list , DEBUG = False ):
279
279
# Setting up -I and custom define options
280
- qdir = os .path .join (self .__dirs ['QMK dir' ], 'keyboards' )
281
- kb = self .__kb .name
280
+ qdir = os .path .join (self .__dirs ['QMK dir' ], 'keyboards' )
281
+ kb = self .__kb .name
282
282
if platform .system () == 'Linux' :
283
- cc = ['avr-gcc' , '-E' ]
283
+ cc = ['avr-gcc' , '-E' ]
284
284
elif platform .system () == 'Windows' :
285
- avr_gcc = os .path .join (defaults .src , 'avr-gcc' , 'bin' , 'avr-gcc.exe' )
286
- cc = [avr_gcc , '-E' ]
287
- kbdefine = 'KEYBOARD_' + '_' .join (kblibs )
285
+ avr_gcc = os .path .join (defaults .src , 'avr-gcc' , 'bin' , 'avr-gcc.exe' )
286
+ cc = [avr_gcc , '-E' ]
287
+ kbdefine = 'KEYBOARD_' + '_' .join (kblibs )
288
288
QMK_KEYBOARD_H = 'QMK_KEYBOARD_H=\" ' + kb + '.h\" '
289
289
libs = ['-D' , kbdefine , '-D' , QMK_KEYBOARD_H , '-I' + self .__dirs ['Local libs' ]]
290
290
path = qdir
@@ -342,6 +342,7 @@ def preproc_keymap(self):
342
342
# ===========================================================================================
343
343
# KB Information
344
344
# ===========================================================================================
345
+
345
346
class kb_info :
346
347
347
348
def __init__ (self , n = '' ):
@@ -372,7 +373,7 @@ def get_rev_info(self, rev):
372
373
return r
373
374
if r .name == 'n/a' :
374
375
return r
375
- #───────────────────────────────────────────────────────────────────────────────────────────
376
+ # ===========================================================================================
376
377
# KB and revision Information
377
378
# ===========================================================================================
378
379
class rev_info :
@@ -802,9 +803,7 @@ def __find_layout_names(self, kbo):
802
803
803
804
def __save_cache (self ):
804
805
path = os .path .split (self .__loc )[0 ]
805
- print (self .__loc )
806
- print (path )
807
- #======================================================================================================================
806
+
808
807
if not os .path .exists (path ):
809
808
try :
810
809
os .makedirs (path )
@@ -910,12 +909,19 @@ def __set_dirs(self):
910
909
with open (pref_yaml , 'r' ) as f :
911
910
self .dirs = yaml .load (f )
912
911
913
- self .console .note (['─────────────────────────────────────────────────────────────────' , 'Using preferences from ' + pref_yaml , '--reset to reset to defaults' ])
912
+ for key , value in self .dirs .items ():
913
+ self .dirs [key ] = os .path .normpath (value )
914
+
915
+ if platform .system () == 'Linux' :
916
+ lines = '─────────────────────────────────────────────────────────────────'
917
+ elif platform .system () == 'Windows' :
918
+ lines = '───────────────────────────────────────────────────────'
919
+ self .console .note ([lines , 'Using preferences from ' + pref_yaml , '--reset to reset to defaults' ])
914
920
915
921
except FileNotFoundError :
916
922
self .__generate_dirs ()
917
923
918
- except AttributeError :
924
+ except AttributeError :
919
925
self .__generate_dirs ()
920
926
921
927
def __generate_dirs (self ):
@@ -933,7 +939,11 @@ def __generate_dirs(self):
933
939
with open (pref_yaml , 'w' ) as f :
934
940
f .write ('# Q2K Folder Locations\n ' )
935
941
yaml .dump (dirs , f , default_flow_style = False )
936
- self .console .note (['─────────────────────────────────────────────────────────────────' , 'New pref.yaml generated @ ' + pref_yaml ])
942
+ if platform .system () == 'Linux' :
943
+ lines = '─────────────────────────────────────────────────────────────────'
944
+ elif platform .system () == 'Windows' :
945
+ lines = '───────────────────────────────────────────────────────'
946
+ self .console .note ([lines , 'New pref.yaml generated @ ' + pref_yaml ])
937
947
938
948
except FileNotFoundError :
939
949
self .console .error (['Failed to generate ' + pref_yaml ])
0 commit comments