Esempio n. 1
0
    def parse_string(self, string, source_string=None):
        path = create_tempfile(string)

        if source_string is not None:
            source_path = create_tempfile(source_string)
            return path, self.parse(path, source_path=source_path)
        else:
            return path, self.parse(path)
Esempio n. 2
0
    def parse_string(self, string, source_string=None):
        path = create_tempfile(string)

        if source_string is not None:
            source_path = create_tempfile(source_string)
            return path, self.parse(path, source_path=source_path)
        else:
            return path, self.parse(path)
Esempio n. 3
0
 def parse_string(self, string, source_string=None, locale=None):
     path = create_tempfile(string)
     locale = locale or self.locale
     if source_string is not None:
         source_path = create_tempfile(source_string)
         return path, self.parse(path, source_path=source_path, locale=locale)
     else:
         return path, self.parse(path, locale=locale)
Esempio n. 4
0
 def parse_string(self, string, source_string=None, locale=None):
     path = create_tempfile(string)
     locale = locale or self.locale
     if source_string is not None:
         source_path = create_tempfile(source_string)
         return path, self.parse(path,
                                 source_path=source_path,
                                 locale=locale)
     else:
         return path, self.parse(path, locale=locale)
Esempio n. 5
0
    def create_nonexistant_resource(self, path):
        source_path = create_tempfile(dedent("""
            <!ENTITY SourceString "Source String">
        """))
        source_resource = silme.SilmeResource(DTDParser, source_path)

        return silme.SilmeResource(
            DTDParser, path,
            source_resource=source_resource
        )
    def create_nonexistant_resource(self, path):
        source_path = create_tempfile(dedent("""
            <!ENTITY SourceString "Source String">
        """))
        source_resource = silme.SilmeResource(DTDParser, source_path)

        return silme.SilmeResource(
            DTDParser, path,
            source_resource=source_resource
        )