Changeset 12960 for main/waeup.kofa/trunk/src/waeup/kofa/doctests
- Timestamp:
- 17 May 2015, 20:02:59 (10 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/doctests
- Files:
-
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/doctests/app.txt
r12951 r12960 57 57 <waeup.kofa.configuration.ConfigurationContainer object at 0x...> 58 58 59 We can export universities. For this we lookup an appropriate exporter60 first::61 62 >>> from waeup.kofa.interfaces import IKofaExporter63 >>> exporter = IKofaExporter(myuniversity)64 >>> exporter65 <waeup.kofa.utils.importexport.Exporter object at 0x...>66 67 Now we can trigger the export::68 69 >>> exporter.export()70 <cStringIO.StringO object at 0x...>71 72 We can also get an XML representation as file. If we do not provide a73 filepath, we will get an instance of `cStringIO.StringIO`, i.e. a74 memory file::75 76 >>> from waeup.kofa.interfaces import IKofaXMLExporter77 >>> exporter = IKofaXMLExporter(myuniversity)78 >>> f = exporter.export()79 >>> f80 <cStringIO.StringO object at 0x...>81 82 >>> print f.read()83 <?xml version="1.0" encoding="utf-8" ?>84 <pickle>85 <initialized_object id="...">86 ...87 </pickle>88 89 59 Kofa plugins 90 60 ============ -
main/waeup.kofa/trunk/src/waeup/kofa/doctests/pages.txt
r12938 r12960 150 150 151 151 >>> browser.open('http://localhost/myuniversity//@@change_language?lang=en') 152 153 We can export a university as XML::154 155 >>> browser.open('http://localhost/myuniversity/export.xml')156 >>> print browser.contents157 <?xml version="1.0" encoding="utf-8" ?>158 <pickle>159 ...160 </pickle>161 162 >>> print browser.headers163 Status: 200 Ok164 Content-Length: ...165 Content-Type: text/xml; charset=UTF-8166 X-Powered-By: Zope (www.zope.org), Python (www.python.org)167 152 168 153
Note: See TracChangeset for help on using the changeset viewer.