Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self.members = {}
self.raw_text = ''
self.anonymous = False
Symbol.__init__(self, **kwargs)
def get_children_symbols(self):
return self.members + super().get_children_symbols()
def get_extra_links(self):
return [m.link for m in self.members]
def get_type_name(self):
return "Enumeration"
class StructSymbol(Symbol):
"""
Banana banana
"""
__tablename__ = 'structures'
def __init__(self, **kwargs):
self.members = {}
self.anonymous = False
self.members = []
self.raw_text = None
Symbol.__init__(self, **kwargs)
def get_children_symbols(self):
return self.members + super().get_children_symbols()
def get_extra_links(self):
def __init__(self, **kwargs):
self.name = None
self.description = None
self.plugins = []
self.elems = []
self.all_plugins = False
Symbol.__init__(self, **kwargs)
Banana banana
"""
__tablename__ = 'interfaces'
def __init__(self, **kwargs):
self.prerequisites = []
ClassSymbol.__init__(self, **kwargs)
def get_type_name(self):
return "Interface"
def get_children_symbols(self):
return self.prerequisites + super().get_children_symbols()
class ProxySymbol(Symbol):
"""A proxy type to handle aliased symbols"""
__tablename__ = 'proxy_symbols'
def __init__(self, **kwargs):
self.target = None
Symbol.__init__(self, **kwargs)
def get_children_symbols(self):
return [self.prop_type] + super().get_children_symbols()
class CallbackSymbol(FunctionSymbol):
"""
Banana banana
"""
__tablename__ = 'callbacks'
def get_type_name(self):
return "Callback"
class EnumSymbol(Symbol):
"""
Banana banana
"""
__tablename__ = 'enumerations'
def __init__(self, **kwargs):
self.members = {}
self.raw_text = ''
self.anonymous = False
Symbol.__init__(self, **kwargs)
def get_children_symbols(self):
return self.members + super().get_children_symbols()
def get_extra_links(self):
return [m.link for m in self.members]
def __update_dep_map(self, page, symbols):
for sym in symbols:
if not isinstance(sym, Symbol):
continue
self.__dep_map[sym.unique_name] = page
self.__update_dep_map(page, sym.get_children_symbols())
def __init__(self, **kwargs):
self.prop_type = None
Symbol.__init__(self, **kwargs)
self.members = []
self.raw_text = None
Symbol.__init__(self, **kwargs)
def get_children_symbols(self):
return self.members + super().get_children_symbols()
def get_extra_links(self):
return [m.link for m in self.members]
def get_type_name(self):
return "Structure"
# FIXME: and this is C-specific
class MacroSymbol(Symbol):
"""
Banana banana
"""
__tablename__ = 'macros'
def __init__(self, **kwargs):
self.original_text = None
Symbol.__init__(self, **kwargs)
class FunctionMacroSymbol(MacroSymbol):
"""
Banana banana
"""
__tablename__ = 'function_macros'
if self.comment is None:
return
for sym in self.get_children_symbols():
if isinstance(sym, ParameterSymbol):
sym.comment = self.comment.params.get(sym.argname)
elif isinstance(sym, FieldSymbol):
if not sym.comment or not sym.comment.description:
sym.comment = self.comment.params.get(sym.member_name)
elif isinstance(sym, EnumMemberSymbol):
if not sym.comment or not sym.comment.description:
sym.comment = self.comment.params.get(sym.unique_name)
elif isinstance(sym, ReturnItemSymbol):
tag = self.comment.tags.get('returns')
sym.comment = comment_from_tag(tag)
elif type(sym) == Symbol:
sym.comment = self.comment.params.get(sym.display_name)
if isinstance(sym, Symbol):
sym.update_children_comments()
def __get_empty_typed_symbols():
typed_symbols_list = namedtuple(
'TypedSymbolsList', ['name', 'symbols'])
empty_typed_symbols = {}
for subclass in all_subclasses(Symbol):
empty_typed_symbols[subclass] = typed_symbols_list(
subclass.get_plural_name(), [])
return empty_typed_symbols
def rename_symbol(self, unique_name, target):
sym = self.app.database.rename_symbol(unique_name, target)
# pylint: disable=unidiomatic-typecheck
if sym and type(sym) != Symbol:
self._created_symbols[sym.filename].remove(target)
self._created_symbols[sym.filename].add(sym.unique_name)