You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running your script across a few of my libraries, I noticed that the way you're detecting the class name of the library could be a bit more robust. Running your script I get:
Getting Functions....
Traceback (most recent call last):
File "../keywords_populator.py", line 350, in <module>
create_keyword_file(libData)
File "../keywords_populator.py", line 323, in create_keyword_file
get_functions(srcPath, headerFilePath, className, functionList)
File "../keywords_populator.py", line 134, in get_functions
classInfo = header.classes[cName]
KeyError: ''
Turns out that this line appears in the main header of one of my libraries before the class definition, which it gets stuck on:
So I cruised through your script and noticed the lines:
with open(headerPath, 'r') as h:
for line in h:
if "class" in line:
words = line.split(' ')
className = words[1]
Which is a rather naive way to detect class name. I added a single space after class so it said "class ", which seemed to work for my specific use case, but you might want to, instead, open the file up using the Cpp processor thing (the dependency you use) and get class name that way. That way you're not relying on a simple match for "class" but rather an actual definition.
The text was updated successfully, but these errors were encountered:
Running your script across a few of my libraries, I noticed that the way you're detecting the class name of the library could be a bit more robust. Running your script I get:
Turns out that this line appears in the main header of one of my libraries before the class definition, which it gets stuck on:
So I cruised through your script and noticed the lines:
Which is a rather naive way to detect class name. I added a single space after class so it said
"class "
, which seemed to work for my specific use case, but you might want to, instead, open the file up using the Cpp processor thing (the dependency you use) and get class name that way. That way you're not relying on a simple match for "class" but rather an actual definition.The text was updated successfully, but these errors were encountered: