Example #1
0
 def loadField(self, resNode):
     """
     Loads a FieldContainer from the given node and returns it as an
     instance. This method is intended for internal use only.
     resNode -- node at which the FieldContainer is located in the file.
     """
     return PyTablesPersister.loadField(self.handle, resNode)
Example #2
0
 def loadField(self, resNode):
     """
     Loads a FieldContainer from the given node and returns it as an
     instance. This method is intended for internal use only.
     resNode -- node at which the FieldContainer is located in the file.
     """
     return PyTablesPersister.loadField(self.handle, resNode)
Example #3
0
 def testGetHTTPFile(self):
     host = "pyphant.sourceforge.net"
     remote_dir = ""
     url = "http://" + host + remote_dir + "/knowledgemanager-http-test.h5"
     # Get remote file and load DataContainer
     filename, headers = urllib.urlretrieve(url)
     h5 = open_file(filename, 'r')
     for g in h5.walk_groups("/results"):
         if (len(g._v_attrs.TITLE)>0) \
                 and (r"\Psi" in g._v_attrs.shortname):
             http_fc = ptp.loadField(h5, g)
     h5.close()
     km = KnowledgeManager.getInstance()
     km.registerURL(url, temporary=True)
     km_fc = km.getDataContainer(http_fc.id)
     self.assertEqual(http_fc, km_fc)
     os.remove(filename)
Example #4
0
 def testGetHTTPFile(self):
     host = "pyphant.sourceforge.net"
     remote_dir = ""
     url = "http://" + host + remote_dir + "/knowledgemanager-http-test.h5"
     # Get remote file and load DataContainer
     filename, headers = urllib.urlretrieve(url)
     h5 = tables.openFile(filename, 'r')
     for g in h5.walkGroups("/results"):
         if (len(g._v_attrs.TITLE)>0) \
                 and (r"\Psi" in g._v_attrs.shortname):
             http_fc = ptp.loadField(h5,g)
     h5.close()
     km = KnowledgeManager.getInstance()
     km.registerURL(url, temporary=True)
     km_fc = km.getDataContainer(http_fc.id)
     self.assertEqual(http_fc, km_fc)
     os.remove(filename)