Skip to content

Commit f8cae13

Browse files
authored
Fix uvision group naming
The previous way of finding group names found the encompassing directory of each file. If the project is exported from the online compiler, this resulted in temporary folder names like tmpyKKWv_ showing up as group names. I propose defaulting to the project name if the file is in the project root.
1 parent 2c96001 commit f8cae13

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/export/exporters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ def progen_get_project_data(self):
121121
def make_key(src):
122122
"""turn a source file into it's group name"""
123123
key = os.path.basename(os.path.dirname(src))
124-
if not key:
125-
key = os.path.basename(os.path.normpath(self.export_dir))
124+
if not key or relpath(key, self.export_dir) == '.':
125+
key = self.project_name
126126
return key
127127

128128
def grouped(sources):

0 commit comments

Comments
 (0)