Exemple #1
0
 def configure(self, config):
     CompositeNode.configure(self, config)
     outputs = config.get('outputs', self.outputs)
     self.outputs = filter(None, outputs)
     if not self.has_child('Fan Out'):
         multiplexor = self.nodespace.create_node(MultiPlexor)
         multiplexor.configure({'name': 'Fan Out', 'parent': self})
     multiplexor = self.get_child('Fan Out')
     multiplexor.configure({'nodes': self.outputs})
     config['output'] = multiplexor
     PeriodicDriver.configure(self, config)
Exemple #2
0
    def get_name(self):
        return self.name

    security.protect('set_name', 'Override')

    def set_name(self, name):
        self.name = name


from mpx.lib.node import as_node
try:
    test = as_node('/services/Security Test')
except KeyError:
    test = CompositeNode()
    test.configure({'name': 'Security Test', 'parent': '/services'})

try:
    node = as_node('/services/Security Test/Node')
except KeyError:
    node = Node()
    node.configure({'name': 'Node', 'parent': test})

sm = as_node('/services/Security Manager')
securednodes = []
assecurednodes = []
users = sm.user_manager.get_users()
for user in users:
    securednodes.append(query_multi_adapter((node, user), ISecure))
    assecurednodes.append(
        sm.as_secured_node('/services/Security Test/Node', user))
Exemple #3
0
 def configure(self, config):
     http_post_transporter.HTTPPostTransporter.configure(self, config)
     self.setattr('transport_type', 'http-post')
     CompositeNode.configure(self, config)
Exemple #4
0
 def configure(self, config):
     config.setdefault('subtype', 'html')
     smtp_transporter.SMTPTransporter.configure(self, config)
     self.setattr('transport_type', 'smtp')
     CompositeNode.configure(self, config)
Exemple #5
0
 def configure(self, config):
     standard.FTPTransporter.configure(self, config)
     self.setattr('transport_type', 'ftp')
     CompositeNode.configure(self, config)
Exemple #6
0
 def configure(self, config):
     secure.SFTPTransporter.configure(self, config)
     self.setattr('transport_type', 'sftp')
     CompositeNode.configure(self, config)
Exemple #7
0
    security.make_public('show_name')
    def show_name(self):
        print self.name
    security.protect('get_name', 'View')
    def get_name(self):
        return self.name
    security.protect('set_name', 'Override')
    def set_name(self, name):
        self.name = name

from mpx.lib.node import as_node
try:
    test = as_node('/services/Security Test')
except KeyError:
    test = CompositeNode()
    test.configure({'name': 'Security Test', 'parent': '/services'})

try:
    node = as_node('/services/Security Test/Node')
except KeyError:
    node = Node()
    node.configure({'name': 'Node', 'parent': test})

sm = as_node('/services/Security Manager')
securednodes = []
assecurednodes = []
users = sm.user_manager.get_users()
for user in users:
    securednodes.append(query_multi_adapter((node, user), ISecure))
    assecurednodes.append(sm.as_secured_node('/services/Security Test/Node', user))
Exemple #8
0
 def configure(self, config):
     http_post_transporter.HTTPPostTransporter.configure(self, config)
     self.setattr('transport_type', 'http-post')
     CompositeNode.configure(self, config)
Exemple #9
0
 def configure(self, config):
     secure.SFTPTransporter.configure(self, config)
     self.setattr('transport_type', 'sftp')
     CompositeNode.configure(self, config)
Exemple #10
0
 def configure(self, config):
     standard.FTPTransporter.configure(self, config)
     self.setattr('transport_type', 'ftp')
     CompositeNode.configure(self, config)
Exemple #11
0
 def configure(self, config):
     config.setdefault('subtype', 'html')
     smtp_transporter.SMTPTransporter.configure(self, config)
     self.setattr('transport_type', 'smtp')
     CompositeNode.configure(self, config)