1.1 --- a/micropython/__init__.py Fri Jul 05 01:04:48 2013 +0200
1.2 +++ b/micropython/__init__.py Fri Jul 05 16:31:12 2013 +0200
1.3 @@ -66,7 +66,6 @@
1.4 # Remember the tables once generated.
1.5
1.6 self.objtable = None
1.7 - self.paramtable = None
1.8
1.9 # A record of nodes for which no attribute target could be found.
1.10
1.11 @@ -87,14 +86,12 @@
1.12 # Need the tables to finalise.
1.13
1.14 objtable = self.get_object_table()
1.15 - self.get_parameter_table()
1.16
1.17 self.importer.vacuum(objtable)
1.18
1.19 # Now remove unneeded things from the tables.
1.20
1.21 objtable = self.get_object_table(reset=1)
1.22 - self.get_parameter_table(reset=1)
1.23
1.24 self.importer.finalise(objtable)
1.25
1.26 @@ -162,46 +159,6 @@
1.27
1.28 return self.objtable
1.29
1.30 - def get_parameter_table(self, reset=0):
1.31 -
1.32 - "Return a table with details of parameters for functions and methods."
1.33 -
1.34 - # Need the object table to get at class details.
1.35 -
1.36 - if self.paramtable is None or reset:
1.37 - t = self.paramtable = micropython.table.ParameterTable()
1.38 -
1.39 - # Visit each module, getting function and method details.
1.40 -
1.41 - for module in self.importer.get_modules():
1.42 - for obj in module.all_objects:
1.43 - if isinstance(obj, Function):
1.44 - t.add(obj.full_name(), obj.parameters())
1.45 -
1.46 - # Classes are callable, too.
1.47 - # Take details of the appropriate __init__ method to make an
1.48 - # entry for an instantiation function for the class.
1.49 -
1.50 - elif isinstance(obj, Class):
1.51 - t.add(obj.get_instantiator().full_name(), obj.get_instantiator().parameters())
1.52 -
1.53 - # Filter out all parameter table entries not referenced by keyword
1.54 - # arguments.
1.55 -
1.56 - keyword_names = set()
1.57 -
1.58 - for module in self.importer.get_modules():
1.59 - keyword_names.update(module.keyword_names)
1.60 -
1.61 - for function_name, parameters in t.table.items():
1.62 - for name in parameters.keys():
1.63 - if name in keyword_names:
1.64 - break
1.65 - else:
1.66 - del t.table[function_name]
1.67 -
1.68 - return self.paramtable
1.69 -
1.70 class Importer:
1.71
1.72 "An import machine, searching for and loading modules."