243 """ |
244 """ |
244 ClbrBaseClasses.Attribute.__init__(self, module, name, file, lineno) |
245 ClbrBaseClasses.Attribute.__init__(self, module, name, file, lineno) |
245 VisibilityMixin.__init__(self) |
246 VisibilityMixin.__init__(self) |
246 |
247 |
247 |
248 |
|
249 @dataclass |
248 class Publics: |
250 class Publics: |
249 """ |
251 """ |
250 Class to represent the list of public identifiers. |
252 Class to represent the list of public identifiers. |
251 """ |
253 """ |
252 |
254 |
253 def __init__(self, module, file, lineno, idents): |
255 module: str |
254 """ |
256 file: str |
255 Constructor |
257 lineno: int |
256 |
258 identifiers: list[str] |
257 @param module name of the module containing this function |
259 name: str = "__all__" |
258 @param file filename containing this class |
|
259 @param lineno linenumber of the class definition |
|
260 @param idents list of public identifiers |
|
261 """ |
|
262 self.module = module |
|
263 self.name = "__all__" |
|
264 self.file = file |
|
265 self.lineno = lineno |
|
266 self.identifiers = [ |
|
267 e.replace('"', "").replace("'", "").strip() for e in idents.split(",") |
|
268 ] |
|
269 |
260 |
270 |
261 |
271 class Imports: |
262 class Imports: |
272 """ |
263 """ |
273 Class to represent the list of imported modules. |
264 Class to represent the list of imported modules. |
680 |
671 |
681 elif m.start("Publics") >= 0: |
672 elif m.start("Publics") >= 0: |
682 idents = m.group("Identifiers") |
673 idents = m.group("Identifiers") |
683 lineno += src.count("\n", last_lineno_pos, start) |
674 lineno += src.count("\n", last_lineno_pos, start) |
684 last_lineno_pos = start |
675 last_lineno_pos = start |
685 pubs = Publics(module, file, lineno, idents) |
676 pubs = Publics( |
|
677 module=module, |
|
678 file=file, |
|
679 lineno=lineno, |
|
680 identifiers=[ |
|
681 e.replace('"', "").replace("'", "").strip() |
|
682 for e in idents.split(",") |
|
683 ] |
|
684 ) |
686 dictionary["__all__"] = pubs |
685 dictionary["__all__"] = pubs |
687 |
686 |
688 elif m.start("Import") >= 0: |
687 elif m.start("Import") >= 0: |
689 # - import module |
688 # - import module |
690 names = [ |
689 names = [ |