Example #1
0
 def odml_tree_can_drop(self, action, dst, position, data=None):
     if data is not None:
         try:
             data = xmlparser.XMLReader().fromString(data)
         except xmlparser.ParserException:
             return False
     return self.text_can_drop(action, dst, position, data)
Example #2
0
 def test_xml_writer_version(self):
     doc = odml.Document()
     if sys.version_info < (3, 0):
         val = unicode(xmlparser.XMLWriter(doc))
     else:
         val = str(xmlparser.XMLWriter(doc))
     self.assertIn('version="%s"' % xmlparser.XML_VERSION, val)
     doc = xmlparser.XMLReader().fromString(val)
Example #3
0
 def odml_tree_receive_data(self, action, dst, position, data):
     if data is None:
         return
     obj = xmlparser.XMLReader().fromString(data)
     if action.move:
         action = tree.Action(gtk.gdk.ACTION_COPY)
         # TODO issue MOVE signal
     return self.text_receive_data(action, dst, position, obj)
    def setUp(self):
        dir_path = os.path.dirname(os.path.realpath(__file__))
        self.basepath = os.path.join(dir_path, "resources")

        self.xml_reader = xmlparser.XMLReader()
    def test_xml_writer_version(self):
        doc = odml.Document()
        val = str(xmlparser.XMLWriter(doc))

        self.assertIn('version="%s"' % FORMAT_VERSION, val)
        doc = xmlparser.XMLReader().from_string(val)
Example #6
0
    def setUp(self):
        self.base_path = RES_DIR

        self.xml_reader = xmlparser.XMLReader()
        self.xml_reader_ignore = xmlparser.XMLReader(ignore_errors=True)