Changeset 4059 for waeup/branches
- Timestamp:
- 3 Apr 2009, 10:57:19 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-rewrite/src/waeup/utils/importexport.txt
r4052 r4059 103 103 >>> from waeup.interfaces import IWAeUPXMLImporter 104 104 >>> importer = IWAeUPXMLImporter(myfaculty) 105 106 Importing from filenames 107 ------------------------ 108 109 We can use a filepath to import from the denoted file:: 110 105 111 >>> new_obj = importer.doImport('myexport.xml') 106 112 … … 117 123 >>> new_obj is myfaculty 118 124 False 125 126 Importing from filelike objects 127 ------------------------------- 128 129 We can also pass a file-like object instead of a filepath:: 130 131 >>> filelike_obj = open('myexport.xml', 'rb') 132 >>> new_obj = importer.doImport(filelike_obj) 133 134 The object created is indeed a faculty:: 135 136 >>> new_obj 137 <waeup.university.faculty.Faculty object at 0x...> 138 139 Clean up:: 140 141 >>> import os 142 >>> os.unlink('myexport.xml')
Note: See TracChangeset for help on using the changeset viewer.