summaryrefslogtreecommitdiff
path: root/tools/mdimport.py
diff options
context:
space:
mode:
authorRoland Hedberg <roland.hedberg@adm.umu.se>2013-05-24 18:02:30 +0200
committerRoland Hedberg <roland.hedberg@adm.umu.se>2013-05-24 18:02:30 +0200
commite401cf25e2ace829f3438d06efb3e6749e84014b (patch)
tree183531718d373c5c8b0f50ee3614ccece39abed5 /tools/mdimport.py
parent77e5a407a52a380cff191ffcf5d74c8cf095b27d (diff)
downloadpysaml2-e401cf25e2ace829f3438d06efb3e6749e84014b.tar.gz
In some case you want the url to be based on server_name/server_port and not http_host, now you can get what you want.develop
Diffstat (limited to 'tools/mdimport.py')
-rwxr-xr-xtools/mdimport.py24
1 files changed, 19 insertions, 5 deletions
diff --git a/tools/mdimport.py b/tools/mdimport.py
index 10cf994b..6f83d958 100755
--- a/tools/mdimport.py
+++ b/tools/mdimport.py
@@ -1,10 +1,11 @@
#!/usr/bin/env python
import sys
+import time
+from saml2.attribute_converter import ac_factory
+from saml2.mdstore import MetaDataMD, MetaDataFile
__author__ = 'rolandh'
-from saml2.mdie import from_dict
-
import xmldsig
import xmlenc
from saml2 import md
@@ -27,7 +28,20 @@ ONTS = {
xmldsig.NAMESPACE: xmldsig,
}
-_dict = eval(open(sys.argv[1]).read())
-res = from_dict(_dict, ONTS)
+start = time.time()
+for i in range(1, 10):
+ mdmd = MetaDataMD(ONTS, ac_factory("../tests/attributemaps"), "swamid2.md")
+ mdmd.load()
+
+ _ = mdmd.keys()
+
+print time.time() - start
+
+start = time.time()
+for i in range(1, 10):
+ mdf = MetaDataFile(ONTS.values(), ac_factory("../tests/attributemaps"),
+ "../tests/swamid-2.0.xml")
+ mdf.load()
+ _ = mdf.keys()
-print res \ No newline at end of file
+print time.time() - start