Lines Matching full:self
32 def __init__(self, path, msg): argument
36 self.config = path
37 self.msg = msg
45 def __init__(self, path, cls, *names): argument
47 super(NotUniqueError, self).__init__(
92 def __init__(self, cast, target): argument
95 self.cast = cast
96 self.target = target
98 def __call__(self, arg): argument
99 return "{0}_cast<{1}>({2})".format(self.cast, self.target, arg)
107 def __init__(self, type): argument
108 self.type = type
110 def __call__(self, arg): argument
111 if "uint" in self.type:
113 elif "int" in self.type:
116 if self.type in self.integer_types:
117 return Cast("static", "{0}_t".format(self.type))(arg)
118 elif self.type == "byte":
120 elif self.type == "double":
123 if self.type == "string":
132 def __call__(self, arg): argument
139 def __call__(self, arg): argument
146 def __init__(self, **kw): argument
147 self.type = kw.pop("type", None)
148 super(Argument, self).__init__(**kw)
150 def argument(self, loader, indent): argument
157 def __init__(self, **kw): argument
158 self.value = kw.pop("value")
159 self.decorators = kw.pop("decorators", [])
161 self.decorators.insert(0, Literal(kw["type"]))
163 self.decorators.insert(0, Quote())
165 self.decorators.insert(0, FixBool())
167 super(TrivialArgument, self).__init__(**kw)
169 def argument(self, loader, indent): argument
170 a = str(self.value)
171 for d in self.decorators:
180 def __init__(self, **kw): argument
181 self.value = kw.pop("value")
182 self.decorators = kw.pop("decorators", [])
184 self.decorators.insert(0, Quote())
186 super(Metadata, self).__init__(**kw)
188 def argument(self, loader, indent): argument
189 a = str(self.value)
190 for d in self.decorators:
199 def __init__(self, **kw): argument
200 self.op = kw.pop("op")
201 self.bound = kw.pop("bound")
202 self.decorators = kw.pop("decorators", [])
204 self.decorators.insert(0, Literal(kw["type"]))
206 self.decorators.insert(0, Quote())
208 self.decorators.insert(0, FixBool())
210 super(OpArgument, self).__init__(**kw)
212 def argument(self, loader, indent): argument
213 a = str(self.bound)
214 for d in self.decorators:
223 def __init__(self, depth=0): argument
224 self.depth = depth
226 def __add__(self, depth): argument
227 return Indent(self.depth + depth)
229 def __call__(self, depth): argument
231 return 4 * " " * (depth + self.depth)
237 def __init__(self, *a, **kw): argument
240 self.configfile = kw.pop("configfile")
241 self.cls = kw.pop("class")
242 self.subclass = kw.pop(self.cls)
250 super(ConfigEntry, self).__init__(**kw)
251 self.name = name_save
253 def factory(self, objs): argument
259 def setup(self, objs): argument
269 def __init__(self, *a, **kw): argument
270 super(Path, self).__init__(**kw)
272 if self.name["meta"].upper() != self.name["meta"]:
274 self.configfile,
276 self.name["meta"]
280 def factory(self, objs): argument
286 "name": self.name["path"],
288 add_unique(ConfigEntry(configfile=self.configfile, **args), objs)
290 args = {"class": "meta", "meta": "element", "name": self.name["meta"]}
291 add_unique(ConfigEntry(configfile=self.configfile, **args), objs)
293 super(Path, self).factory(objs)
295 def setup(self, objs): argument
298 self.path = get_index(objs, "pathname", self.name["path"])
299 self.meta = get_index(objs, "meta", self.name["meta"])
301 super(Path, self).setup(objs)
307 def __init__(self, *a, **kw): argument
308 super(Property, self).__init__(**kw)
310 if self.name["meta"].upper() != self.name["meta"]:
312 self.configfile,
314 self.name["meta"]
318 def factory(self, objs): argument
324 "name": self.name["interface"],
326 add_unique(ConfigEntry(configfile=self.configfile, **args), objs)
331 "name": self.name["property"],
333 add_unique(ConfigEntry(configfile=self.configfile, **args), objs)
335 args = {"class": "meta", "meta": "element", "name": self.name["meta"]}
336 add_unique(ConfigEntry(configfile=self.configfile, **args), objs)
338 super(Property, self).factory(objs)
340 def setup(self, objs): argument
343 self.interface = get_index(objs, "interface", self.name["interface"])
344 self.prop = get_index(objs, "propertyname", self.name["property"])
345 self.meta = get_index(objs, "meta", self.name["meta"])
347 super(Property, self).setup(objs)
353 def __init__(self, *a, **kw): argument
354 super(Instance, self).__init__(**kw)
356 def setup(self, objs): argument
359 self.interface = get_index(
360 objs, "interface", self.name["property"]["interface"]
362 self.prop = get_index(
363 objs, "propertyname", self.name["property"]["property"]
365 self.propmeta = get_index(objs, "meta", self.name["property"]["meta"])
366 self.path = get_index(objs, "pathname", self.name["path"]["path"])
367 self.pathmeta = get_index(objs, "meta", self.name["path"]["meta"])
369 super(Instance, self).setup(objs)
375 def __init__(self, *a, **kw): argument
376 super(PathInstance, self).__init__(**kw)
378 def setup(self, objs): argument
380 self.path = self.name["path"]["path"]
381 self.pathmeta = self.name["path"]["meta"]
382 super(PathInstance, self).setup(objs)
388 def __init__(self, *a, **kw): argument
389 self.members = kw.pop("members")
390 super(Group, self).__init__(**kw)
397 def __init__(self, *a, **kw): argument
398 super(ImplicitGroup, self).__init__(**kw)
400 def factory(self, objs): argument
403 factory = Everything.classmap(self.subclass, "element")
404 for m in self.members:
406 "class": self.subclass,
407 self.subclass: "element",
411 obj = factory(configfile=self.configfile, **args)
415 super(ImplicitGroup, self).factory(objs)
421 def __init__(self, *a, **kw): argument
422 super(GroupOfPaths, self).__init__(**kw)
424 def setup(self, objs): argument
432 self.members = map(map_member, self.members)
434 super(GroupOfPaths, self).setup(objs)
440 def __init__(self, *a, **kw): argument
441 self.type = kw.pop("type")
442 self.datatype = sdbusplus.property.Property(
443 name=kw.get("name"), type=self.type
446 super(GroupOfProperties, self).__init__(**kw)
448 def setup(self, objs): argument
458 self.members = map(map_member, self.members)
460 super(GroupOfProperties, self).setup(objs)
466 def __init__(self, *a, **kw): argument
467 super(GroupOfInstances, self).__init__(**kw)
469 def setup(self, objs): argument
484 self.members = map(map_member, self.members)
486 super(GroupOfInstances, self).setup(objs)
492 def __init__(self, *a, **kw): argument
493 super(GroupOfPathInstances, self).__init__(**kw)
495 def setup(self, objs): argument
504 self.members = map(map_member, self.members)
506 super(GroupOfPathInstances, self).setup(objs)
513 def __init__(self, *a, **kw): argument
514 self.paths = kw.pop("paths")
515 self.properties = kw.pop("properties")
516 super(HasPropertyIndex, self).__init__(**kw)
518 def factory(self, objs): argument
523 objs, "pathgroup", self.paths, config=self.configfile
526 objs, "propertygroup", self.properties, config=self.configfile
541 "name": "{0} {1}".format(self.paths, self.properties),
544 group = GroupOfInstances(configfile=self.configfile, **args)
545 add_unique(group, objs, config=self.configfile)
548 super(HasPropertyIndex, self).factory(objs)
550 def setup(self, objs): argument
553 self.instances = get_index(
556 "{0} {1}".format(self.paths, self.properties),
557 config=self.configfile,
559 self.paths = get_index(
560 objs, "pathgroup", self.paths, config=self.configfile
562 self.properties = get_index(
563 objs, "propertygroup", self.properties, config=self.configfile
565 self.datatype = objs["propertygroup"][self.properties].datatype
566 self.type = objs["propertygroup"][self.properties].type
568 super(HasPropertyIndex, self).setup(objs)
575 def __init__(self, *a, **kw): argument
576 self.paths = kw.pop("paths")
577 super(HasPathIndex, self).__init__(**kw)
579 def factory(self, objs): argument
584 objs, "pathgroup", self.paths, config=self.configfile
597 "name": "{0}".format(self.paths),
600 group = GroupOfPathInstances(configfile=self.configfile, **args)
601 add_unique(group, objs, config=self.configfile)
604 super(HasPathIndex, self).factory(objs)
606 def setup(self, objs): argument
609 self.pathinstances = get_index(
612 "{0}".format(self.paths),
613 config=self.configfile,
615 self.paths = get_index(
616 objs, "pathgroup", self.paths, config=self.configfile
618 super(HasPathIndex, self).setup(objs)
624 def __init__(self, *a, **kw): argument
626 self.type = kw.pop("type")
627 self.datatype = kw.pop("datatype", None)
628 self.filters = kw.pop("filters", None)
630 super(GroupOfFilters, self).__init__(**kw)
632 def factory(self, objs): argument
635 if self.filters:
638 for f in self.filters:
639 f["type"] = self.type
640 self.filters = [OpArgument(**x) for x in self.filters]
642 super(GroupOfFilters, self).factory(objs)
648 def __init__(self, *a, **kw): argument
650 self.filters = kw.pop("filters", None)
651 self.callback = kw.pop("callback", None)
652 self.ignore_start_callback = kw.pop("ignore_start_callback", False)
653 self.ignore_start_callback = (
654 "true" if self.ignore_start_callback else "false"
656 super(PropertyWatch, self).__init__(**kw)
658 def factory(self, objs): argument
661 if self.filters:
668 self.properties,
669 config=self.configfile,
678 self.properties,
679 config=self.configfile,
689 "filters": self.filters,
692 "name": self.name,
695 group = GroupOfFilters(configfile=self.configfile, **args)
697 add_unique(group, objs, config=self.configfile)
700 super(PropertyWatch, self).factory(objs)
702 def setup(self, objs): argument
705 if self.filters:
707 self.filters = get_index(
708 objs, "filtersgroup", self.name, config=self.configfile
711 if self.callback:
712 self.callback = get_index(
713 objs, "callback", self.callback, config=self.configfile
716 super(PropertyWatch, self).setup(objs)
722 def __init__(self, *a, **kw): argument
723 self.pathcallback = kw.pop("pathcallback", None)
724 super(PathWatch, self).__init__(**kw)
726 def setup(self, objs): argument
728 if self.pathcallback:
729 self.pathcallback = get_index(
730 objs, "pathcallback", self.pathcallback, config=self.configfile
732 super(PathWatch, self).setup(objs)
738 def __init__(self, *a, **kw): argument
739 super(Callback, self).__init__(**kw)
745 def __init__(self, *a, **kw): argument
746 super(PathCallback, self).__init__(**kw)
752 def __init__(self, *a, **kw): argument
753 self.condition = kw.pop("condition")
754 self.instance = kw.pop("instance")
755 self.defer = kw.pop("defer", None)
756 super(ConditionCallback, self).__init__(**kw)
758 def factory(self, objs): argument
762 "configfile": self.configfile,
763 "members": [self.instance],
766 "name": [self.instance],
770 add_unique(entry, objs, config=self.configfile)
772 super(ConditionCallback, self).factory(objs)
774 def setup(self, objs): argument
777 self.graph = get_index(
778 objs, "callbackgroup", [self.instance], config=self.configfile
781 self.condition = get_index(
782 objs, "condition", self.name, config=self.configfile
785 super(ConditionCallback, self).setup(objs)
787 def construct(self, loader, indent): argument
788 return self.render(
789 loader, "conditional.mako.cpp", c=self, indent=indent
796 def __init__(self, *a, **kw): argument
797 self.callback = kw.pop("callback")
798 self.defer = kw.pop("defer", None)
799 super(Condition, self).__init__(**kw)
801 def factory(self, objs): argument
805 "configfile": self.configfile,
806 "condition": self.name,
809 "instance": self.callback,
810 "name": self.name,
811 "defer": self.defer,
815 add_unique(callback, objs, config=self.configfile)
818 super(Condition, self).factory(objs)
824 def __init__(self, *a, **kw): argument
825 self.countop = kw.pop("countop")
826 self.countbound = kw.pop("countbound")
827 self.op = kw.pop("op")
828 self.bound = kw.pop("bound")
829 self.oneshot = TrivialArgument(
832 super(CountCondition, self).__init__(**kw)
834 def setup(self, objs): argument
837 super(CountCondition, self).setup(objs)
838 self.bound = TrivialArgument(type=self.type, value=self.bound)
840 def construct(self, loader, indent): argument
841 return self.render(loader, "count.mako.cpp", c=self, indent=indent)
847 def __init__(self, *a, **kw): argument
848 self.op = kw.pop("op")
849 self.bound = kw.pop("bound")
850 self.oneshot = TrivialArgument(
853 super(MedianCondition, self).__init__(**kw)
855 def setup(self, objs): argument
858 super(MedianCondition, self).setup(objs)
859 self.bound = TrivialArgument(type=self.type, value=self.bound)
861 def construct(self, loader, indent): argument
862 return self.render(loader, "median.mako.cpp", c=self, indent=indent)
868 def __init__(self, *a, **kw): argument
869 self.severity = kw.pop("severity")
870 self.message = kw.pop("message")
871 super(Journal, self).__init__(**kw)
873 def construct(self, loader, indent): argument
874 return self.render(loader, "journal.mako.cpp", c=self, indent=indent)
880 def __init__(self, *a, **kw): argument
881 self.error = kw.pop("error")
882 self.metadata = [Metadata(**x) for x in kw.pop("metadata", {})]
883 super(Elog, self).__init__(**kw)
885 def construct(self, loader, indent): argument
887 fd.write(self.render(loader, "errors.mako.hpp", c=self))
888 return self.render(loader, "elog.mako.cpp", c=self, indent=indent)
894 def __init__(self, *a, **kw): argument
895 self.eventName = kw.pop("eventName")
896 self.eventMessage = kw.pop("eventMessage")
897 super(Event, self).__init__(**kw)
899 def construct(self, loader, indent): argument
900 return self.render(loader, "event.mako.cpp", c=self, indent=indent)
906 def __init__(self, *a, **kw): argument
907 self.eventType = kw.pop("eventType")
908 super(EventPath, self).__init__(**kw)
910 def construct(self, loader, indent): argument
911 return self.render(loader, "eventpath.mako.cpp", c=self, indent=indent)
917 def __init__(self, *a, **kw): argument
918 self.error = kw.pop("error")
919 self.metadata = kw.pop("metadata")
920 super(ElogWithMetadata, self).__init__(**kw)
922 def construct(self, loader, indent): argument
924 fd.write(self.render(loader, "errors.mako.hpp", c=self))
925 return self.render(
926 loader, "elog_with_metadata.mako.cpp", c=self, indent=indent
933 def __init__(self, *a, **kw): argument
934 self.callout = kw.pop("callout")
935 super(ResolveCallout, self).__init__(**kw)
937 def construct(self, loader, indent): argument
938 return self.render(
939 loader, "resolve_errors.mako.cpp", c=self, indent=indent
946 def __init__(self, *a, **kw): argument
947 self.service = kw.pop("service")
948 self.path = kw.pop("path")
949 self.interface = kw.pop("interface")
950 self.method = kw.pop("method")
951 self.args = [TrivialArgument(**x) for x in kw.pop("args", {})]
952 super(Method, self).__init__(**kw)
954 def factory(self, objs): argument
958 "name": self.service,
960 add_unique(ConfigEntry(configfile=self.configfile, **args), objs)
962 args = {"class": "pathname", "pathname": "element", "name": self.path}
963 add_unique(ConfigEntry(configfile=self.configfile, **args), objs)
968 "name": self.interface,
970 add_unique(ConfigEntry(configfile=self.configfile, **args), objs)
975 "name": self.method,
977 add_unique(ConfigEntry(configfile=self.configfile, **args), objs)
979 super(Method, self).factory(objs)
981 def setup(self, objs): argument
984 self.service = get_index(objs, "interface", self.service)
986 self.path = get_index(objs, "pathname", self.path)
988 self.interface = get_index(objs, "interface", self.interface)
990 self.method = get_index(objs, "propertyname", self.method)
992 super(Method, self).setup(objs)
994 def construct(self, loader, indent): argument
995 return self.render(loader, "method.mako.cpp", c=self, indent=indent)
1001 def __init__(self, *a, **kw): argument
1002 super(CallbackGraphEntry, self).__init__(**kw)
1004 def setup(self, objs): argument
1008 return get_index(objs, "callback", x, config=self.configfile)
1010 self.members = map(map_member, self.members)
1012 super(CallbackGraphEntry, self).setup(objs)
1018 def __init__(self, *a, **kw): argument
1019 super(PathCallbackGraphEntry, self).__init__(**kw)
1021 def setup(self, objs): argument
1025 return get_index(objs, "pathcallback", x, config=self.configfile)
1027 self.members = map(map_member, self.members)
1029 super(PathCallbackGraphEntry, self).setup(objs)
1035 def __init__(self, *a, **kw): argument
1036 self.members = kw.pop("members")
1037 super(GroupOfCallbacks, self).__init__(**kw)
1039 def factory(self, objs): argument
1043 "configfile": self.configfile,
1044 "members": self.members,
1047 "name": self.members,
1051 add_unique(entry, objs, config=self.configfile)
1053 super(GroupOfCallbacks, self).factory(objs)
1055 def setup(self, objs): argument
1058 self.graph = get_index(
1059 objs, "callbackgroup", self.members, config=self.configfile
1062 super(GroupOfCallbacks, self).setup(objs)
1064 def construct(self, loader, indent): argument
1065 return self.render(
1066 loader, "callbackgroup.mako.cpp", c=self, indent=indent
1073 def __init__(self, *a, **kw): argument
1074 self.members = kw.pop("members")
1075 super(GroupOfPathCallbacks, self).__init__(**kw)
1077 def factory(self, objs): argument
1081 "configfile": self.configfile,
1082 "members": self.members,
1085 "name": self.members,
1089 add_unique(entry, objs, config=self.configfile)
1090 super(GroupOfPathCallbacks, self).factory(objs)
1092 def setup(self, objs): argument
1095 self.graph = get_index(
1096 objs, "callbackpathgroup", self.members, config=self.configfile
1099 super(GroupOfPathCallbacks, self).setup(objs)
1101 def construct(self, loader, indent): argument
1102 return self.render(
1103 loader, "callbackpathgroup.mako.cpp", c=self, indent=indent
1231 def __init__(self, *a, **kw): argument
1232 self.pathmeta = kw.pop("path", [])
1233 self.paths = kw.pop("pathname", [])
1234 self.meta = kw.pop("meta", [])
1235 self.pathgroups = kw.pop("pathgroup", [])
1236 self.interfaces = kw.pop("interface", [])
1237 self.properties = kw.pop("property", [])
1238 self.propertynames = kw.pop("propertyname", [])
1239 self.propertygroups = kw.pop("propertygroup", [])
1240 self.instances = kw.pop("instance", [])
1241 self.pathinstances = kw.pop("pathinstance", [])
1242 self.instancegroups = kw.pop("instancegroup", [])
1243 self.pathinstancegroups = kw.pop("pathinstancegroup", [])
1244 self.watches = kw.pop("watch", [])
1245 self.pathwatches = kw.pop("pathwatch", [])
1246 self.callbacks = kw.pop("callback", [])
1247 self.pathcallbacks = kw.pop("pathcallback", [])
1248 self.callbackgroups = kw.pop("callbackgroup", [])
1249 self.pathcallbackgroups = kw.pop("pathcallbackgroup", [])
1250 self.conditions = kw.pop("condition", [])
1251 self.filters = kw.pop("filtersgroup", [])
1253 super(Everything, self).__init__(**kw)
1255 def generate_cpp(self, loader): argument
1262 self.render(
1265 meta=self.meta,
1266 properties=self.properties,
1267 propertynames=self.propertynames,
1268 interfaces=self.interfaces,
1269 paths=self.paths,
1270 pathmeta=self.pathmeta,
1271 pathgroups=self.pathgroups,
1272 propertygroups=self.propertygroups,
1273 instances=self.instances,
1274 pathinstances=self.pathinstances,
1275 watches=self.watches,
1276 pathwatches=self.pathwatches,
1277 instancegroups=self.instancegroups,
1278 pathinstancegroups=self.pathinstancegroups,
1279 callbacks=self.callbacks,
1280 pathcallbacks=self.pathcallbacks,
1281 callbackgroups=self.callbackgroups,
1282 pathcallbackgroups=self.pathcallbackgroups,
1283 conditions=self.conditions,
1284 filters=self.filters,