Ejemplo n.º 1
0
        'value': {
            'type': 'service',
            'name': 'response'
        }
    }, {
        'name': 'someFlag',
        'value': {
            'type': 'paramter',
            'value': True
        }
    }]
}
#pp = pprint.PrettyPrinter(indent=2)
#pp.pprint(mydict)

di.set(MyVariableSvc)

myc1 = di.get(MyVariableSvc)
myc2 = di.get(MyVariableSvc)
myc2.var = "new_var"
#c.attempt(AService).set_signature().call("some_method", True)
print(myc1)
print(myc2)
print((myc1.var))
print((myc2.var))
myc3 = di.get(MyVariableSvc)
myc3.var = "another_var"
print(myc3)
print((myc1.var))
print((myc2.var))
print((myc3.var))
Ejemplo n.º 2
0
di = DI()
mydict = {'className':'SomeClass',
          'properties':[
	          {'name':'response',
               'value':
                   {'type':'service','name':'response'}
               },
              {'name':'someFlag',
               'value':
                   {'type':'paramter','value':True}
               }
          ]}
#pp = pprint.PrettyPrinter(indent=2)
#pp.pprint(mydict)

di.set(MyVariableSvc)

myc1 = di.get(MyVariableSvc)
myc2 = di.get(MyVariableSvc)
myc2.var = "new_var"
#c.attempt(AService).set_signature().call("some_method", True)
print(myc1)
print(myc2)
print(myc1.var)
print(myc2.var)
myc3 = di.get(MyVariableSvc)
myc3.var = "another_var"
print(myc3)
print(myc1.var)
print(myc2.var)
print(myc3.var)
Ejemplo n.º 3
0
	b = None
	def __init__(self, param:VarClass):
		super(AService, self).__init__()
		self.a = param
		print("AService.__init__: %s" % param.__class__.__name__)

	def some_method(self, param:VarClass):
		self.b = param
		print("AService.some_method: %s" % param.__class__.__name__)

di = DI()
di.attempt(VarClass)
di.add_variable('Variable_name', "variable_data")
di.attempt(SuperSvc, True).input(obj__svc=VarClass, text__param="Variable_name", value="The DATA")

di.set(VarClass)
di.attempt(AService).set_signature().call("some_method", True)

print("Continer.get: %s" % di.get(AService).__class__.__name__)

id = di.get(SuperSvc)
id2 = di.get_raw(SuperSvc)

di.set(MyVariableSvc)
myc1 = di.get(MyVariableSvc)
myc2 = di.get(MyVariableSvc)
myc2.var = "new_var"

def test_answer():
	"""
	Simple test case to verify that the classes are instantiated as expected.
Ejemplo n.º 4
0
	b = None
	def __init__(self, param:VarClass):
		super(AService, self).__init__()
		self.a = param
		print(("AService.__init__: %s" % param.__class__.__name__))

	def some_method(self, param:VarClass):
		self.b = param
		print(("AService.some_method: %s" % param.__class__.__name__))

di = DI()
di.attempt(VarClass)
di.add_variable('Variable_name', "variable_data")
di.attempt(SuperSvc, True).input(obj__svc=VarClass, text__param="Variable_name", value="The DATA")

di.set(VarClass)
di.attempt(AService).set_signature().call("some_method", True)

print(("Continer.get: %s" % di.get(AService).__class__.__name__))

id = di.get(SuperSvc)
id2 = di.get_raw(SuperSvc)

di.set(MyVariableSvc)
myc1 = di.get(MyVariableSvc)
myc2 = di.get(MyVariableSvc)
myc2.var = "new_var"

def test_answer():
	"""
	Simple test case to verify that the classes are instantiated as expected.