Exemple #1
0
    def __init__(self, parser, parent, adder, atts):
        HandlerBase.__init__(self, parser, parent, adder)
        self.subject = None
        self.anonymous = 0
        if atts.has_key("about"):
            self.subject = atts["about"]
        elif atts.has_key("ID"):
            self.subject = "#" + atts["ID"]
        elif atts.has_key(ABOUT_ATTRIBUTE):
            self.subject = atts[ABOUT_ATTRIBUTE]
        elif atts.has_key(ID_ATTRIBUTE):
            self.subject = "#" + atts[ID_ATTRIBUTE]
        else:
            self.subject = ANON + generate_uri()
            self.anonymous = 1

        self.subject = absolutize(self.parser.GetBase(), self.subject)

        for att in atts.keys():
            if att == "about" or att == "ID" or \
               att == ABOUT_ATTRIBUTE or att == ID_ATTRIBUTE:
                pass
            else:
                new_att = join(split(att, "^"), "")
                self.adder(self.subject, new_att, atts[att],
                           anonymous_subject=self.anonymous, literal_object=1)
    def __init__(self, parser):
        HandlerBase.__init__(self, parser, None)
        self.data = ''
        args = "rednode, request, response, processor"
        self.codestr = '''\
def _tmp(%s):
'''  % args
Exemple #3
0
 def __init__(self, parser, parent, adder, name, atts):
     HandlerBase.__init__(self, parser, parent, adder)
     self.predicate = join(split(name, "^"), "")
     self.literal = 0
     self.anonymous_object = 0
     if atts.has_key("resource"):
         self.object = atts["resource"]
         self.object = absolutize(self.parser.GetBase(), self.object)                                                
         for att in atts.keys():
             if att == "resource":
                 pass
             else:
                 new_att = join(split(att, "^"), "")
                 self.adder(self.object, new_att, atts[att],
                            literal_object=1)
     elif atts.has_key(RESOURCE_ATTRIBUTE):
         self.object = atts[RESOURCE_ATTRIBUTE]
         self.object = absolutize(self.parser.GetBase(), self.object)
         for att in atts.keys():
             if att == RESOURCE_ATTRIBUTE:
                 pass
             else:
                 new_att = join(split(att, "^"), "")
                 self.adder(self.object, new_att,atts[att],
                            literal_object=1)
     else:
         self.object = ""
         self.literal = 1
Exemple #4
0
 def __init__(self, parser, parent, adder, atts):
     HandlerBase.__init__(self, parser, parent, adder)
     self.literal = 0
     if atts.has_key("resource"):
         self.value = atts["resource"]
         self.value = absolutize(self.parser.GetBase(), self.value)                
     elif atts.has_key(RESOURCE_ATTRIBUTE):
         self.value = atts[RESOURCE_ATTRIBUTE]
         self.value = absolutize(self.parser.GetBase(), self.value)
     else:
         self.value = ""
         self.literal = 1
 def __init__(self, parser, parent):
     HandlerBase.__init__(self, parser, parent,)
     self.data = ""
Exemple #6
0
 def __init__(self, parser, parent, adder):
     HandlerBase.__init__(self, parser, parent, adder)
Exemple #7
0
 def __init__(self, parser, parent, adder):
     AbstractHandlerBase.__init__(self, parser, parent)
     self.adder = adder
Exemple #8
0
 def end(self, name):
     self.adder(self.parent.subject, self.predicate, self.object,
                literal_object=self.literal, anonymous_object=self.anonymous_object)
     HandlerBase.end(self, name)
Exemple #9
0
 def end(self, name):
     self.parent.add_li(self.value, self.literal)
     HandlerBase.end(self, name)
Exemple #10
0
 def __init__(self, parser, parent, globals={}):
     AbstractHandlerBase.__init__(self, parser, parent)
     self.globals = globals