Changeset 4797 for waeup/branches/ulif-namespace
- Timestamp:
- 11 Jan 2010, 23:18:18 (15 years ago)
- Location:
- waeup/branches/ulif-namespace/src/waeup/sirp
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-namespace/src/waeup/sirp/README.txt
r4789 r4797 23 23 We can easily create universities:: 24 24 25 >>> from waeup. app import University25 >>> from waeup.sirp.app import University 26 26 >>> u = University() 27 27 >>> u 28 <waeup. app.University object at 0x...>28 <waeup.sirp.app.University object at 0x...> 29 29 30 30 Universities have a name. … … 37 37 38 38 >>> u['faculties'] 39 <waeup. university.facultycontainer.FacultyContainer object at 0x...>39 <waeup.sirp.university.facultycontainer.FacultyContainer object at 0x...> 40 40 41 41 >>> u['students'] 42 <waeup.s tudent.studentcontainer.StudentContainer object at 0x...>42 <waeup.sirp.student.studentcontainer.StudentContainer object at 0x...> 43 43 44 44 >>> u['hostels'] 45 <waeup. hostel.hostelcontainer.HostelContainer object at 0x...>45 <waeup.sirp.hostel.hostelcontainer.HostelContainer object at 0x...> 46 46 47 47 We can export universities. For this we lookup an appropriate exporter 48 48 first:: 49 49 50 >>> from waeup. interfaces import IWAeUPExporter50 >>> from waeup.sirp.interfaces import IWAeUPExporter 51 51 >>> exporter = IWAeUPExporter(u) 52 52 >>> exporter 53 <waeup. utils.importexport.Exporter object at 0x...>53 <waeup.sirp.utils.importexport.Exporter object at 0x...> 54 54 55 55 Now we can trigger the export:: … … 62 62 memory file:: 63 63 64 >>> from waeup. interfaces import IWAeUPXMLExporter64 >>> from waeup.sirp.interfaces import IWAeUPXMLExporter 65 65 >>> exporter = IWAeUPXMLExporter(u) 66 66 >>> f = exporter.export() … … 84 84 We can create faculties easily:: 85 85 86 >>> from waeup. university.faculty import Faculty86 >>> from waeup.sirp.university.faculty import Faculty 87 87 >>> f = Faculty() 88 88 >>> f 89 <waeup. university.faculty.Faculty object at 0x...>89 <waeup.sirp.university.faculty.Faculty object at 0x...> 90 90 91 91 Also faculties want to be named:: -
waeup/branches/ulif-namespace/src/waeup/sirp/app.txt
r4789 r4797 1 :mod:`waeup. app` -- central components for a WAeUP portal2 ********************************************************* 1 :mod:`waeup.sirp.app` -- central components for a WAeUP portal 2 ************************************************************** 3 3 4 4 :Test-Layer: unit 5 5 6 .. module:: waeup. app6 .. module:: waeup.sirp.app 7 7 8 8 .. class:: University … … 20 20 An arbitrary object containing "faculties". In the case of 21 21 `University` it is a container of type 22 `waeup. interfaces.IFacultyContainer`.22 `waeup.sirp.interfaces.IFacultyContainer`. 23 23 24 24 … … 39 39 instance: 40 40 41 >>> from waeup. app import University41 >>> from waeup.sirp.app import University 42 42 >>> myuniversity = University() 43 43 >>> myuniversity 44 <waeup. app.University object at 0x...>44 <waeup.sirp.app.University object at 0x...> 45 45 46 46 Instances of `University` comply with the interface 47 `waeup. interfaces.IUniversity`:47 `waeup.sirp.interfaces.IUniversity`: 48 48 49 49 >>> from zope.interface.verify import verifyClass 50 >>> from waeup. interfaces import IUniversity50 >>> from waeup.sirp.interfaces import IUniversity 51 51 >>> verifyClass(IUniversity, University) 52 52 True … … 55 55 interface: 56 56 57 >>> from waeup. app import University57 >>> from waeup.sirp.app import University 58 58 >>> myuniversity = University() 59 59 >>> myuniversity.name … … 61 61 62 62 >>> myuniversity['faculties'] 63 <waeup. university.facultycontainer.FacultyContainer object at 0x...>63 <waeup.sirp.university.facultycontainer.FacultyContainer object at 0x...> -
waeup/branches/ulif-namespace/src/waeup/sirp/authentication.txt
r4789 r4797 12 12 Before we can check access we have to create an app: 13 13 14 >>> from waeup. app import University14 >>> from waeup.sirp.app import University 15 15 >>> root = getRootFolder() 16 16 >>> u = University() … … 36 36 user credentials and some metadata persistently: 37 37 38 >>> from waeup. authentication import Account38 >>> from waeup.sirp.authentication import Account 39 39 >>> alice = Account('alice', 'alicesecret') 40 40 >>> root['app']['users'].addAccount(alice) -
waeup/branches/ulif-namespace/src/waeup/sirp/browser.txt
r4789 r4797 25 25 [] 26 26 27 >>> from waeup. app import University27 >>> from waeup.sirp.app import University 28 28 >>> u = University() 29 29 >>> root['myuniversity'] = u … … 265 265 Courses are stored in :class:`ICourseContainer` instances with their 266 266 code as key. CourseContainers are normally availabe as `course` 267 attribute of :class:`waeup. university.department.Department`267 attribute of :class:`waeup.sirp.university.department.Department` 268 268 instances. 269 269 … … 413 413 with their code as key. CertificateContainers are normally availabe as 414 414 `certificates` attribute of 415 :class:`waeup. university.department.Department` instances.415 :class:`waeup.sirp.university.department.Department` instances. 416 416 417 417 To ease the life of users we do not require to browse the … … 729 729 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 730 730 ... 731 <b>Storage path:</b> <span>/.../waeup/ files</span>731 <b>Storage path:</b> <span>/.../waeup/sirp/files</span> 732 732 ... 733 733 -
waeup/branches/ulif-namespace/src/waeup/sirp/browser/breadcrumbs.txt
r4789 r4797 13 13 We create a university to check the breadcrumb functionality. 14 14 15 >>> from waeup. app import University15 >>> from waeup.sirp.app import University 16 16 >>> root = getRootFolder() 17 17 >>> root['app'] = University() … … 24 24 viewname: 25 25 26 >>> from waeup. browser.breadcrumbs import getBreadcrumbList26 >>> from waeup.sirp.browser.breadcrumbs import getBreadcrumbList 27 27 >>> blist1 = getBreadcrumbList(app, 'index') 28 28 >>> blist1 29 [<waeup. browser.breadcrumbs.UniversityBreadcrumb object at 0x...>]29 [<waeup.sirp.browser.breadcrumbs.UniversityBreadcrumb object at 0x...>] 30 30 31 31 A slightly more extensive list for the datacenter: … … 34 34 >>> from pprint import pprint 35 35 >>> pprint(blist2) 36 [<waeup. browser.breadcrumbs.UniversityBreadcrumb object at 0x...>,37 <waeup. browser.breadcrumbs.AdministrationBreadcrumb object at 0x...>,38 <waeup. browser.breadcrumbs.DataCenterBreadcrumb object at 0x...>]36 [<waeup.sirp.browser.breadcrumbs.UniversityBreadcrumb object at 0x...>, 37 <waeup.sirp.browser.breadcrumbs.AdministrationBreadcrumb object at 0x...>, 38 <waeup.sirp.browser.breadcrumbs.DataCenterBreadcrumb object at 0x...>] 39 39 40 40 We get a breadcrumb for university, administration area and data … … 49 49 50 50 >>> pprint([(x.context, x.viewname) for x in blist2]) 51 [(<waeup. app.University object at 0x...>, 'index'),52 (<waeup. app.University object at 0x...>, 'administration'),53 (<waeup. datacenter.DataCenter object at 0x...>, 'index')]51 [(<waeup.sirp.app.University object at 0x...>, 'index'), 52 (<waeup.sirp.app.University object at 0x...>, 'administration'), 53 (<waeup.sirp.datacenter.DataCenter object at 0x...>, 'index')] 54 54 55 55 The administration area breadcrumb might be a surprise, as there is no … … 91 91 Now we can get the breadcrumbs for this view: 92 92 93 >>> from waeup. browser.breadcrumbs import getBreadcrumbListForView93 >>> from waeup.sirp.browser.breadcrumbs import getBreadcrumbListForView 94 94 >>> blist3 = getBreadcrumbListForView(page) 95 95 >>> [x.title for x in blist3] … … 111 111 The returned breadcrumb container supports iteration: 112 112 113 >>> from waeup. browser.interfaces import IBreadcrumbContainer113 >>> from waeup.sirp.browser.interfaces import IBreadcrumbContainer 114 114 >>> mybccontainer = IBreadcrumbContainer(page) 115 115 >>> [x.title for x in mybccontainer] … … 133 133 134 134 >>> from zope.component import getAdapter 135 >>> from waeup. browser.interfaces import IBreadcrumb135 >>> from waeup.sirp.browser.interfaces import IBreadcrumb 136 136 >>> b1 = getAdapter(app, IBreadcrumb, 'index') 137 137 >>> b1 138 <waeup. browser.breadcrumbs.UniversityBreadcrumb object at 0x...>138 <waeup.sirp.browser.breadcrumbs.UniversityBreadcrumb object at 0x...> 139 139 140 140 Breadcrumb objects provide a title: … … 158 158 >>> b2 = getAdapter(app['datacenter'], IBreadcrumb, 'index') 159 159 >>> b2 160 <waeup. browser.breadcrumbs.DataCenterBreadcrumb object at 0x...>160 <waeup.sirp.browser.breadcrumbs.DataCenterBreadcrumb object at 0x...> 161 161 162 162 >>> b2.title … … 170 170 171 171 >>> b2.parent 172 (<waeup. app.University object at 0x...>, 'administration')172 (<waeup.sirp.app.University object at 0x...>, 'administration') 173 173 174 174 This result denotes a new context object (the University instance we … … 186 186 >>> b3 = getAdapter(context, IBreadcrumb, viewname) 187 187 >>> b3 188 <waeup. ..breadcrumbs.AdministrationBreadcrumb object at 0x...>188 <waeup.sirp...breadcrumbs.AdministrationBreadcrumb object at 0x...> 189 189 190 190 As you can see, we get an AdministrationBreadcrumb, although the … … 199 199 >>> context, viewname = b3.parent 200 200 >>> context, viewname 201 (<waeup. app.University object at 0x...>, 'index')201 (<waeup.sirp.app.University object at 0x...>, 'index') 202 202 203 203 We create last breadcrumb: -
waeup/branches/ulif-namespace/src/waeup/sirp/csvfile/README.txt
r4789 r4797 1 :mod:`waeup. csvfile` -- generic support for handling CSV files2 ************************************************************** 1 :mod:`waeup.sirp.csvfile` -- generic support for handling CSV files 2 ******************************************************************* 3 3 4 4 :Test-Layer: unit 5 5 6 .. module:: waeup. csvfile6 .. module:: waeup.sirp.csvfile 7 7 :synopsis: generic support for handling CSV files. 8 8 … … 10 10 .. note:: 11 11 12 This version of the :mod:`waeup. csvfile` module doesn't support12 This version of the :mod:`waeup.sirp.csvfile` module doesn't support 13 13 Unicode input. Also, there are currently some issues regarding 14 14 ASCII NUL characters. Accordingly, all input should be UTF-8 or … … 125 125 The string can be uppercase, lowercase or mixed: 126 126 127 >>> from waeup. csvfile import toBool127 >>> from waeup.sirp.csvfile import toBool 128 128 >>> toBool('y') 129 129 True … … 168 168 object out of a path string: 169 169 170 >>> from waeup. csvfile.interfaces import ICSVFile170 >>> from waeup.sirp.csvfile.interfaces import ICSVFile 171 171 >>> src = ICSVFile(path) 172 172 >>> src 173 <waeup. csvfile.csvfile.CSVFile object at 0x...>173 <waeup.sirp.csvfile.csvfile.CSVFile object at 0x...> 174 174 175 175 Create a receiver: 176 176 177 >>> from waeup. csvfile.interfaces import ICSVDataReceiver177 >>> from waeup.sirp.csvfile.interfaces import ICSVDataReceiver 178 178 >>> class Receiver(object): 179 179 ... grok.implements(ICSVDataReceiver) … … 186 186 187 187 >>> from zope.component import getMultiAdapter 188 >>> from waeup. csvfile.interfaces import ICSVDataConnector188 >>> from waeup.sirp.csvfile.interfaces import ICSVDataConnector 189 189 >>> conn = getMultiAdapter((src, recv), ICSVDataConnector) 190 190 Traceback (most recent call last): 191 191 ... 192 ComponentLookupError: ((<waeup. csvfile.csvfile.CSVFile object at 0x...>,192 ComponentLookupError: ((<waeup.sirp.csvfile.csvfile.CSVFile object at 0x...>, 193 193 <Receiver object at 0x...>), 194 <InterfaceClass waeup. csvfile.interfaces.ICSVDataConnector>, u'')194 <InterfaceClass waeup.sirp.csvfile.interfaces.ICSVDataConnector>, u'') 195 195 196 196 Okay, create a connector: … … 241 241 for an adapter to the path string: 242 242 243 >>> from waeup. csvfile.interfaces import ICSVFile243 >>> from waeup.sirp.csvfile.interfaces import ICSVFile 244 244 >>> wrapper = ICSVFile(path) 245 245 >>> wrapper 246 <waeup. csvfile.csvfile.CSVFile object at 0x...>246 <waeup.sirp.csvfile.csvfile.CSVFile object at 0x...> 247 247 248 248 This wrapper can return the CSV data as a sequence of dicts: … … 271 271 use the :func:`getCSVFile` function: 272 272 273 >>> from waeup. csvfile.csvfile import getCSVFile273 >>> from waeup.sirp.csvfile.csvfile import getCSVFile 274 274 >>> wrapper = getCSVFile(path) 275 275 >>> wrapper 276 <waeup. csvfile.csvfile.CSVFile object at 0x...>276 <waeup.sirp.csvfile.csvfile.CSVFile object at 0x...> 277 277 278 278 As we currently have only one type of wrapper, we get this. Let's 279 279 create another wrapper, that requires a column 'col1': 280 280 281 >>> from waeup. csvfile.interfaces import ICSVFile282 >>> from waeup. csvfile import CSVFile281 >>> from waeup.sirp.csvfile.interfaces import ICSVFile 282 >>> from waeup.sirp.csvfile import CSVFile 283 283 >>> class ICSVFileWithCol1(ICSVFile): 284 284 ... """A CSV file that contains a 'col1' column. … … 341 341 in constructor, whether this requirement is met: 342 342 343 >>> from waeup. csvfile.interfaces import ICSVFile344 >>> from waeup. csvfile import CSVFile343 >>> from waeup.sirp.csvfile.interfaces import ICSVFile 344 >>> from waeup.sirp.csvfile import CSVFile 345 345 >>> class ICSVFile13(ICSVFile): 346 346 ... """A CSV file that contains a 'special_col' column. … … 370 370 We create a wrapper that requires 'col1' and 'col2': 371 371 372 >>> from waeup. csvfile.interfaces import ICSVFile373 >>> from waeup. csvfile import CSVFile372 >>> from waeup.sirp.csvfile.interfaces import ICSVFile 373 >>> from waeup.sirp.csvfile import CSVFile 374 374 >>> class ICSVFile12(ICSVFile): 375 375 ... """A CSV file that contains a 'special_col' column. … … 390 390 path (i.e. __init__ raises some kind of exception): score is -1: 391 391 392 >>> from waeup. csvfile.csvfile import getScore392 >>> from waeup.sirp.csvfile.csvfile import getScore 393 393 >>> getScore('nonexistant', CSVFile) 394 394 -1 … … 426 426 427 427 >>> import grok 428 >>> from waeup. csvfile.interfaces import ICSVFile429 >>> from waeup. csvfile import CSVFile428 >>> from waeup.sirp.csvfile.interfaces import ICSVFile 429 >>> from waeup.sirp.csvfile import CSVFile 430 430 431 431 >>> class ICustomCSVFile(ICSVFile): … … 501 501 Now we create a wrapper, that requires that field: 502 502 503 >>> from waeup. csvfile.interfaces import ICSVFile504 >>> from waeup. csvfile import CSVFile503 >>> from waeup.sirp.csvfile.interfaces import ICSVFile 504 >>> from waeup.sirp.csvfile import CSVFile 505 505 >>> class ICSVFileWithSpecialCol(ICSVFile): 506 506 ... """A CSV file that contains a 'special_col' column. … … 629 629 before, using the :func:`getCSVFile` function: 630 630 631 >>> from waeup. csvfile import getCSVFile631 >>> from waeup.sirp.csvfile import getCSVFile 632 632 >>> myfile = getCSVFile(path) 633 633 >>> ICSVFile12.providedBy(myfile) -
waeup/branches/ulif-namespace/src/waeup/sirp/datacenter.txt
r4789 r4797 11 11 A data center can be created easily: 12 12 13 >>> from waeup. datacenter import DataCenter13 >>> from waeup.sirp.datacenter import DataCenter 14 14 >>> mydatacenter = DataCenter() 15 15 >>> mydatacenter 16 <waeup. datacenter.DataCenter object at 0x...>16 <waeup.sirp.datacenter.DataCenter object at 0x...> 17 17 18 18 Each data center has a location in file system where files are stored: … … 20 20 >>> storagepath = mydatacenter.storage 21 21 >>> storagepath 22 '/.../src/waeup/ files'22 '/.../src/waeup/sirp/files' 23 23 24 24 … … 77 77 78 78 >>> mydatacenter.getFiles() 79 [<waeup. datacenter.DataCenterFile object at 0x...>]79 [<waeup.sirp.datacenter.DataCenterFile object at 0x...>] 80 80 81 81 As we can see, the actual file is wrapped by a convenience wrapper, … … 122 122 123 123 >>> import grok 124 >>> from waeup. interfaces import ICSVDataReceivers125 >>> from waeup. datacenter import DataCenter124 >>> from waeup.sirp.interfaces import ICSVDataReceivers 125 >>> from waeup.sirp.datacenter import DataCenter 126 126 >>> class SomeContainer(grok.Container): 127 127 ... grok.implements(ICSVDataReceivers) … … 142 142 to import data into instances of MyCSVReceiver: 143 143 144 >>> from waeup. csvfile.interfaces import ICSVFile145 >>> from waeup. interfaces import IWAeUPCSVImporter146 >>> from waeup. utils.importexport import CSVImporter144 >>> from waeup.sirp.csvfile.interfaces import ICSVFile 145 >>> from waeup.sirp.interfaces import IWAeUPCSVImporter 146 >>> from waeup.sirp.utils.importexport import CSVImporter 147 147 >>> class MyCSVImporter(CSVImporter): 148 148 ... grok.adapts(ICSVFile, MyCSVReceiver) -
waeup/branches/ulif-namespace/src/waeup/sirp/ftesting.zcml
r4789 r4797 2 2 xmlns="http://namespaces.zope.org/zope" 3 3 i18n_domain="waeup" 4 package="waeup "4 package="waeup.sirp" 5 5 > 6 6 7 7 <include package="grok" /> 8 <include package="waeup " />8 <include package="waeup.sirp" /> 9 9 10 10 <!-- Typical functional testing security setup --> -
waeup/branches/ulif-namespace/src/waeup/sirp/hostel/hostelcontainer.txt
r4789 r4797 1 waeup. hostel.HostelContainer2 **************************** 1 waeup.sirp.hostel.HostelContainer 2 ********************************* 3 3 4 4 Containers for hostels. … … 11 11 We can easily create `HostelContainers`:: 12 12 13 >>> from waeup. hostel.hostelcontainer import HostelContainer13 >>> from waeup.sirp.hostel.hostelcontainer import HostelContainer 14 14 >>> mycontainer = HostelContainer() 15 15 16 16 Hostel containers provide ``IHostelContainer``: 17 17 18 >>> from waeup. interfaces import IHostelContainer18 >>> from waeup.sirp.interfaces import IHostelContainer 19 19 >>> IHostelContainer.providedBy(mycontainer) 20 20 True … … 31 31 >>> from zope.component import createObject 32 32 >>> createObject(u'waeup.HostelContainer') 33 <waeup. hostel.hostelcontainer.HostelContainer object at 0x...>33 <waeup.sirp.hostel.hostelcontainer.HostelContainer object at 0x...> 34 34 35 35 This way we get a thing that implements IHostelContainer without … … 57 57 Okay, so we have to get a hostel first:: 58 58 59 >>> from waeup. hostel.hostel import Hostel59 >>> from waeup.sirp.hostel.hostel import Hostel 60 60 >>> myhostel = Hostel() 61 61 -
waeup/branches/ulif-namespace/src/waeup/sirp/permissions.txt
r4789 r4797 16 16 We can get all roles defined in a WAeUP portal: 17 17 18 >>> from waeup. permissions import getRoles18 >>> from waeup.sirp.permissions import getRoles 19 19 >>> getRoles() 20 20 ['waeup.PortalManager', 'waeup.PortalUser'] -
waeup/branches/ulif-namespace/src/waeup/sirp/testing.py
r4789 r4797 1 1 import os.path 2 import waeup 2 import waeup.sirp 3 3 from zope.app.testing.functional import ZCMLLayer 4 4 5 5 ftesting_zcml = os.path.join( 6 os.path.dirname(waeup. __file__), 'ftesting.zcml')6 os.path.dirname(waeup.sirp.__file__), 'ftesting.zcml') 7 7 FunctionalLayer = ZCMLLayer(ftesting_zcml, __name__, 'FunctionalLayer', 8 8 allow_teardown=True) -
waeup/branches/ulif-namespace/src/waeup/sirp/university/certificate.txt
r4789 r4797 1 :mod:`waeup. university.certificate` -- Certificates for WAeUP2 ************************************************************* 3 4 .. module:: waeup. university.certificate1 :mod:`waeup.sirp.university.certificate` -- Certificates for WAeUP 2 ****************************************************************** 3 4 .. module:: waeup.sirp.university.certificate 5 5 6 6 Components that represent and manage certificates. … … 31 31 All parameters are optional: 32 32 33 >>> from waeup. university.certificate import Certificate33 >>> from waeup.sirp.university.certificate import Certificate 34 34 >>> mycertificate = Certificate() 35 35 36 36 Certificates have the attributes required by the `ICertificate` interface: 37 37 38 >>> from waeup. interfaces import ICertificate38 >>> from waeup.sirp.interfaces import ICertificate 39 39 >>> ICertificate.providedBy(mycertificate) 40 40 True … … 174 174 175 175 Add a reference to a course. A course is an object implementing 176 :class:`waeup. interfaces.ICourse`.176 :class:`waeup.sirp.interfaces.ICourse`. 177 177 178 178 Please don't be confused by the term 'reference'. This just 179 means an ordinary :class:`waeup. university.course.Course` object179 means an ordinary :class:`waeup.sirp.university.course.Course` object 180 180 in almost all cases. As this object will normaly be one stored 181 181 in a department, the course here will simply become a reference … … 236 236 >>> mycertificate = createObject(u'waeup.Certificate') 237 237 >>> mycertificate 238 <waeup. university.certificate.Certificate object at 0x...>238 <waeup.sirp.university.certificate.Certificate object at 0x...> 239 239 240 240 The factory complies with the specifications from the … … 243 243 >>> from zope.interface.verify import verifyClass 244 244 >>> from zope.component.interfaces import IFactory 245 >>> from waeup. university.certificate import CertificateFactory245 >>> from waeup.sirp.university.certificate import CertificateFactory 246 246 >>> verifyClass(IFactory, CertificateFactory) 247 247 True … … 252 252 >>> certificate_factory = CertificateFactory() 253 253 >>> certificate_factory.getInterfaces() 254 <implementedBy waeup. university.certificate.Certificate>254 <implementedBy waeup.sirp.university.certificate.Certificate> 255 255 256 256 … … 270 270 >>> mycertificatecourse = createObject(u'waeup.CertificateCourse') 271 271 >>> mycertificatecourse 272 <waeup. university.certificate.CertificateCourse object at 0x...>272 <waeup.sirp.university.certificate.CertificateCourse object at 0x...> 273 273 274 274 The factory complies with the specifications from the … … 277 277 >>> from zope.interface.verify import verifyClass 278 278 >>> from zope.component.interfaces import IFactory 279 >>> from waeup. university.certificate import CertificateCourseFactory279 >>> from waeup.sirp.university.certificate import CertificateCourseFactory 280 280 >>> verifyClass(IFactory, CertificateCourseFactory) 281 281 True … … 286 286 >>> certcourse_factory = CertificateCourseFactory() 287 287 >>> certcourse_factory.getInterfaces() 288 <implementedBy waeup. university.certificate.CertificateCourse>288 <implementedBy waeup.sirp.university.certificate.CertificateCourse> 289 289 290 290 … … 321 321 We can create certificates: 322 322 323 >>> from waeup. university.certificate import Certificate323 >>> from waeup.sirp.university.certificate import Certificate 324 324 >>> mycertificate = Certificate() 325 325 >>> mycertificate 326 <waeup. university.certificate.Certificate object at 0x...>326 <waeup.sirp.university.certificate.Certificate object at 0x...> 327 327 328 328 Another way to create certificates is by asking for a factory called … … 333 333 >>> mycertificate = createObject(u'waeup.Certificate') 334 334 >>> mycertificate 335 <waeup. university.certificate.Certificate object at 0x...>335 <waeup.sirp.university.certificate.Certificate object at 0x...> 336 336 337 337 CertificateCourses … … 341 341 :class:`ICertificateCourse` interface: 342 342 343 >>> from waeup. interfaces import ICertificateCourse344 >>> from waeup. university.certificate import CertificateCourse343 >>> from waeup.sirp.interfaces import ICertificateCourse 344 >>> from waeup.sirp.university.certificate import CertificateCourse 345 345 >>> mycertcourse = CertificateCourse(None, 200, False) 346 346 >>> ICertificateCourse.providedBy(mycertcourse) … … 357 357 >>> mycertcourse = createObject(u'waeup.CertificateCourse') 358 358 >>> mycertcourse 359 <waeup. university.certificate.CertificateCourse object at 0x...>359 <waeup.sirp.university.certificate.CertificateCourse object at 0x...> 360 360 361 361 .. _removecertificatecourses: -
waeup/branches/ulif-namespace/src/waeup/sirp/university/certificatecontainer.txt
r4789 r4797 1 :mod:`waeup. university.certificatecontainer` -- Certificate containers2 ********************************************************************** 1 :mod:`waeup.sirp.university.certificatecontainer` -- Certificate containers 2 *************************************************************************** 3 3 4 .. module:: waeup. university.certificatecontainer4 .. module:: waeup.sirp.university.certificatecontainer 5 5 6 6 Containers for certificates. … … 32 32 :class:`CertificateContainer` instances are instances of 33 33 :class:`grok.Container` that hold and manage instances of 34 :class:`waeup. university.certificate.Certificate`.34 :class:`waeup.sirp.university.certificate.Certificate`. 35 35 36 >>> from waeup. university.certificatecontainer import CertificateContainer36 >>> from waeup.sirp.university.certificatecontainer import CertificateContainer 37 37 >>> mycontainer = CertificateContainer() 38 38 >>> mycontainer 39 <waeup. university.certificatecontainer.CertificateContainer object at 0x...>39 <waeup.sirp.university.certificatecontainer.CertificateContainer object at 0x...> 40 40 41 41 Certificate containers provide `ICertificateContainer`: 42 42 43 >>> from waeup. interfaces import ICertificateContainer43 >>> from waeup.sirp.interfaces import ICertificateContainer 44 44 >>> ICertificateContainer.providedBy(mycontainer) 45 45 True … … 63 63 64 64 *certificate* must be an instance of 65 :class:`waeup. university.certificate.Certificate`:65 :class:`waeup.sirp.university.certificate.Certificate`: 66 66 67 >>> from waeup. university.certificatecontainer import (67 >>> from waeup.sirp.university.certificatecontainer import ( 68 68 ... CertificateContainer) 69 69 >>> mycontainer = CertificateContainer() … … 75 75 The key of added items is the ``code`` attribute: 76 76 77 >>> from waeup. university.certificate import Certificate77 >>> from waeup.sirp.university.certificate import Certificate 78 78 >>> mycertificate = Certificate(code='CERTIFICATE1') 79 79 >>> mycontainer.addCertificate(mycertificate) … … 110 110 >>> mycertificatecontainer = createObject(u'waeup.CertificateContainer') 111 111 >>> mycertificatecontainer 112 <waeup. university.certificatecontainer.CertificateContainer object at 0x...>112 <waeup.sirp.university.certificatecontainer.CertificateContainer object at 0x...> 113 113 114 114 The factory complies with the specifications from the … … 117 117 >>> from zope.interface.verify import verifyClass 118 118 >>> from zope.component.interfaces import IFactory 119 >>> from waeup. university.certificatecontainer import (119 >>> from waeup.sirp.university.certificatecontainer import ( 120 120 ... CertificateContainerFactory) 121 121 >>> verifyClass(IFactory, CertificateContainerFactory) … … 127 127 >>> certificatecontainer_factory = CertificateContainerFactory() 128 128 >>> certificatecontainer_factory.getInterfaces() 129 <implementedBy waeup. university.certificatecontainer.CertificateContainer>129 <implementedBy waeup.sirp.university.certificatecontainer.CertificateContainer> 130 130 131 131 … … 138 138 We can easily create `CertificateContainers`: 139 139 140 >>> from waeup. university.certificatecontainer import CertificateContainer140 >>> from waeup.sirp.university.certificatecontainer import CertificateContainer 141 141 >>> mycontainer = CertificateContainer() 142 142 … … 149 149 >>> from zope.component import createObject 150 150 >>> createObject(u'waeup.CertificateContainer') 151 <waeup. university.certificatecontainer.CertificateContainer object at 0x...>151 <waeup.sirp.university.certificatecontainer.CertificateContainer object at 0x...> 152 152 153 153 This way we get a thing that implements ICertificateContainer without -
waeup/branches/ulif-namespace/src/waeup/sirp/university/course.txt
r4789 r4797 1 :mod:`waeup. university.course` -- Courses2 ***************************************** 1 :mod:`waeup.sirp.university.course` -- Courses 2 ********************************************** 3 3 4 .. module:: waeup. university.course4 .. module:: waeup.sirp.university.course 5 5 6 6 Components that represent courses. … … 30 30 All parameters are optional: 31 31 32 >>> from waeup. university.course import Course32 >>> from waeup.sirp.university.course import Course 33 33 >>> mycourse = Course() 34 34 >>> mycourse 35 <waeup. university.course.Course object at 0x...>35 <waeup.sirp.university.course.Course object at 0x...> 36 36 37 37 Course instances have the attributes required by the 38 :class:`waeup. interfaces.ICourse` interface:38 :class:`waeup.sirp.interfaces.ICourse` interface: 39 39 40 >>> from waeup. interfaces import ICourse40 >>> from waeup.sirp.interfaces import ICourse 41 41 >>> ICourse.providedBy(mycourse) 42 42 True … … 105 105 .. class:: CourseFactory() 106 106 107 .. attribute:: grok.name(u'waeup. Course')107 .. attribute:: grok.name(u'waeup.sirp.Course') 108 108 109 109 .. attribute:: grok.implements(IFactory) … … 115 115 >>> mycourse = createObject(u'waeup.Course') 116 116 >>> mycourse 117 <waeup. university.course.Course object at 0x...>117 <waeup.sirp.university.course.Course object at 0x...> 118 118 119 119 The factory complies with the specifications from the … … 122 122 >>> from zope.interface.verify import verifyClass 123 123 >>> from zope.component.interfaces import IFactory 124 >>> from waeup. university.course import CourseFactory124 >>> from waeup.sirp.university.course import CourseFactory 125 125 >>> verifyClass(IFactory, CourseFactory) 126 126 True … … 131 131 >>> course_factory = CourseFactory() 132 132 >>> course_factory.getInterfaces() 133 <implementedBy waeup. university.course.Course>133 <implementedBy waeup.sirp.university.course.Course> 134 134 135 135 Examples … … 142 142 class and calling the constructor: 143 143 144 >>> from waeup. university.course import Course144 >>> from waeup.sirp.university.course import Course 145 145 >>> mycourse = Course() 146 146 >>> mycourse 147 <waeup. university.course.Course object at 0x...>147 <waeup.sirp.university.course.Course object at 0x...> 148 148 149 149 Another way to create courses is by asking for a factory called 150 ``waeup. Course``. This way we can create a factory without importing a150 ``waeup.sirp.Course``. This way we can create a factory without importing a 151 151 class: 152 152 … … 154 154 >>> mycourse = createObject(u'waeup.Course') 155 155 >>> mycourse 156 <waeup. university.course.Course object at 0x...>156 <waeup.sirp.university.course.Course object at 0x...> 157 157 -
waeup/branches/ulif-namespace/src/waeup/sirp/university/coursecontainer.txt
r4789 r4797 1 :mod:`waeup. university.coursecontainer` -- Course containers2 ************************************************************ 1 :mod:`waeup.sirp.university.coursecontainer` -- Course containers 2 ***************************************************************** 3 3 4 .. module:: waeup. university.coursecontainer4 .. module:: waeup.sirp.university.coursecontainer 5 5 6 6 Containers for courses. … … 32 32 :class:`CourseContainer` instances are instances of 33 33 :class:`grok.Container` that hold and manage instances of 34 :class:`waeup. university.course.Course`.34 :class:`waeup.sirp.university.course.Course`. 35 35 36 >>> from waeup. university.coursecontainer import CourseContainer36 >>> from waeup.sirp.university.coursecontainer import CourseContainer 37 37 >>> mycontainer = CourseContainer() 38 38 >>> mycontainer 39 <waeup. university.coursecontainer.CourseContainer object at 0x...>39 <waeup.sirp.university.coursecontainer.CourseContainer object at 0x...> 40 40 41 41 Course containers provide `ICourseContainer`: 42 42 43 >>> from waeup. interfaces import ICourseContainer43 >>> from waeup.sirp.interfaces import ICourseContainer 44 44 >>> ICourseContainer.providedBy(mycontainer) 45 45 True … … 63 63 64 64 *course* must be an instance of 65 :class:`waeup. university.course.Course`:65 :class:`waeup.sirp.university.course.Course`: 66 66 67 >>> from waeup. university.coursecontainer import CourseContainer67 >>> from waeup.sirp.university.coursecontainer import CourseContainer 68 68 >>> mycontainer = CourseContainer() 69 69 >>> mycontainer.addCourse('blah') … … 74 74 The key of added items is the ``code`` attribute: 75 75 76 >>> from waeup. university.course import Course76 >>> from waeup.sirp.university.course import Course 77 77 >>> mycourse = Course(code='COURSE1') 78 78 >>> mycontainer.addCourse(mycourse) … … 109 109 >>> mycoursecontainer = createObject(u'waeup.CourseContainer') 110 110 >>> mycoursecontainer 111 <waeup. university.coursecontainer.CourseContainer object at 0x...>111 <waeup.sirp.university.coursecontainer.CourseContainer object at 0x...> 112 112 113 113 The factory complies with the specifications from the … … 116 116 >>> from zope.interface.verify import verifyClass 117 117 >>> from zope.component.interfaces import IFactory 118 >>> from waeup. university.coursecontainer import CourseContainerFactory118 >>> from waeup.sirp.university.coursecontainer import CourseContainerFactory 119 119 >>> verifyClass(IFactory, CourseContainerFactory) 120 120 True … … 125 125 >>> coursecontainer_factory = CourseContainerFactory() 126 126 >>> coursecontainer_factory.getInterfaces() 127 <implementedBy waeup. university.coursecontainer.CourseContainer>127 <implementedBy waeup.sirp.university.coursecontainer.CourseContainer> 128 128 129 129 … … 136 136 We can easily create `CourseContainers`: 137 137 138 >>> from waeup. university.coursecontainer import CourseContainer138 >>> from waeup.sirp.university.coursecontainer import CourseContainer 139 139 >>> mycontainer = CourseContainer() 140 140 … … 147 147 >>> from zope.component import createObject 148 148 >>> createObject(u'waeup.CourseContainer') 149 <waeup. university.coursecontainer.CourseContainer object at 0x...>149 <waeup.sirp.university.coursecontainer.CourseContainer object at 0x...> 150 150 151 151 This way we get a thing that implements ICourseContainer without -
waeup/branches/ulif-namespace/src/waeup/sirp/university/courserefs.txt
r4789 r4797 18 18 As correct deletion of references needs support of catalogs (we lookup 19 19 catalogs to find references), we need a fully blown ZODB here, 20 including an instance of :class:`waeup. app.University`, as this is our20 including an instance of :class:`waeup.sirp.app.University`, as this is our 21 21 `ISite` object where the catalogs are stored. 22 22 … … 25 25 and course certificates: 26 26 27 >>> from waeup. app import University27 >>> from waeup.sirp.app import University 28 28 >>> root = getRootFolder() 29 29 >>> root['app'] = University() -
waeup/branches/ulif-namespace/src/waeup/sirp/university/department.txt
r4789 r4797 1 :mod:`waeup. university.department` -- Departments2 ************************************************* 1 :mod:`waeup.sirp.university.department` -- Departments 2 ****************************************************** 3 3 4 .. module:: waeup. university.department4 .. module:: waeup.sirp.university.department 5 5 6 6 Components that represent university departments. … … 26 26 Create a representation of a university department: 27 27 28 >>> from waeup. university.department import Department28 >>> from waeup.sirp.university.department import Department 29 29 >>> mydept = Department() 30 30 >>> mydept 31 <waeup. university.department.Department object at 0x...>31 <waeup.sirp.university.department.Department object at 0x...> 32 32 33 33 Another way to create :class:`Department` instances is by asking … … 38 38 >>> mydept = createObject(u'waeup.Department') 39 39 >>> mydept 40 <waeup. university.department.Department object at 0x...>40 <waeup.sirp.university.department.Department object at 0x...> 41 41 42 42 :class:`Department` instances have the attributes required by the 43 43 `IDepartment` interface: 44 44 45 >>> from waeup. interfaces import IDepartment45 >>> from waeup.sirp.interfaces import IDepartment 46 46 >>> IDepartment.providedBy(mydept) 47 47 True … … 92 92 93 93 >>> mydept.courses 94 <waeup. university.coursecontainer.CourseContainer object at 0x...>94 <waeup.sirp.university.coursecontainer.CourseContainer object at 0x...> 95 95 96 96 … … 103 103 104 104 >>> mydept.certificates 105 <waeup. ..certificatecontainer.CertificateContainer object at 0x...>105 <waeup.sirp...certificatecontainer.CertificateContainer object at 0x...> 106 106 107 107 Utilities … … 123 123 >>> mydepartment = createObject(u'waeup.Department') 124 124 >>> mydepartment 125 <waeup. university.department.Department object at 0x...>125 <waeup.sirp.university.department.Department object at 0x...> 126 126 127 127 The factory complies with the specifications from the … … 130 130 >>> from zope.interface.verify import verifyClass 131 131 >>> from zope.component.interfaces import IFactory 132 >>> from waeup. university.department import DepartmentFactory132 >>> from waeup.sirp.university.department import DepartmentFactory 133 133 >>> verifyClass(IFactory, DepartmentFactory) 134 134 True … … 139 139 >>> department_factory = DepartmentFactory() 140 140 >>> department_factory.getInterfaces() 141 <implementedBy waeup. university.department.Department>141 <implementedBy waeup.sirp.university.department.Department> -
waeup/branches/ulif-namespace/src/waeup/sirp/university/faculty.txt
r4789 r4797 1 :mod:`waeup. university.faculty` -- Faculties2 ******************************************** 3 4 .. module:: waeup. university.faculty1 :mod:`waeup.sirp.university.faculty` -- Faculties 2 ************************************************* 3 4 .. module:: waeup.sirp.university.faculty 5 5 6 6 Components that represent university faculties. … … 25 25 Create a representation of a university faculty: 26 26 27 >>> from waeup. university.faculty import Faculty27 >>> from waeup.sirp.university.faculty import Faculty 28 28 >>> myfac = Faculty() 29 29 >>> myfac 30 <waeup. university.faculty.Faculty object at 0x...>30 <waeup.sirp.university.faculty.Faculty object at 0x...> 31 31 32 32 Another way to create :class:`Faculty` instances is by asking … … 37 37 >>> myfac = createObject(u'waeup.Faculty') 38 38 >>> myfac 39 <waeup. university.faculty.Faculty object at 0x...>39 <waeup.sirp.university.faculty.Faculty object at 0x...> 40 40 41 41 :class:`Faculty` instances have the attributes required by the 42 42 `IFaculty` interface: 43 43 44 >>> from waeup. interfaces import IFaculty44 >>> from waeup.sirp.interfaces import IFaculty 45 45 >>> IFaculty.providedBy(myfac) 46 46 True … … 66 66 Regular departments are accepted: 67 67 68 >>> from waeup. university.department import Department68 >>> from waeup.sirp.university.department import Department 69 69 >>> myfac.addDepartment(Department(title='Physics', 70 70 ... code='DP')) 71 71 72 72 >>> list(myfac.items()) 73 [(u'DP', <waeup. university.department.Department object at 0x...>)]73 [(u'DP', <waeup.sirp.university.department.Department object at 0x...>)] 74 74 75 75 .. method:: clear() … … 132 132 >>> myfaculty = createObject(u'waeup.Faculty') 133 133 >>> myfaculty 134 <waeup. university.faculty.Faculty object at 0x...>134 <waeup.sirp.university.faculty.Faculty object at 0x...> 135 135 136 136 The factory complies with the specifications from the … … 139 139 >>> from zope.interface.verify import verifyClass 140 140 >>> from zope.component.interfaces import IFactory 141 >>> from waeup. university.faculty import FacultyFactory141 >>> from waeup.sirp.university.faculty import FacultyFactory 142 142 >>> verifyClass(IFactory, FacultyFactory) 143 143 True … … 148 148 >>> faculty_factory = FacultyFactory() 149 149 >>> faculty_factory.getInterfaces() 150 <implementedBy waeup. university.faculty.Faculty>150 <implementedBy waeup.sirp.university.faculty.Faculty> 151 151 152 152 … … 156 156 We can create faculties: 157 157 158 >>> from waeup. university.faculty import Faculty158 >>> from waeup.sirp.university.faculty import Faculty 159 159 >>> myfaculty = Faculty() 160 160 >>> myfaculty 161 <waeup. university.faculty.Faculty object at 0x...>161 <waeup.sirp.university.faculty.Faculty object at 0x...> 162 162 163 163 Another way to create faculties is by asking for a factory called 164 ``waeup. Faculty``. Now we can create a factory without importing a164 ``waeup.sirp.Faculty``. Now we can create a factory without importing a 165 165 class: 166 166 … … 168 168 >>> myfaculty = createObject(u'waeup.Faculty') 169 169 >>> myfaculty 170 <waeup. university.faculty.Faculty object at 0x...>170 <waeup.sirp.university.faculty.Faculty object at 0x...> 171 171 172 172 Faculty attributes … … 175 175 Faculties have the attributes required by the `IFaculty` interface: 176 176 177 >>> from waeup. interfaces import IFaculty177 >>> from waeup.sirp.interfaces import IFaculty 178 178 >>> IFaculty.providedBy(myfaculty) 179 179 True -
waeup/branches/ulif-namespace/src/waeup/sirp/university/facultycontainer.txt
r4789 r4797 11 11 We can easily create `FacultyContainers`:: 12 12 13 >>> from waeup. university.facultycontainer import FacultyContainer13 >>> from waeup.sirp.university.facultycontainer import FacultyContainer 14 14 >>> mycontainer = FacultyContainer() 15 15 16 16 Faculty containers provide `IFacultyContainer`: 17 17 18 >>> from waeup. interfaces import IFacultyContainer18 >>> from waeup.sirp.interfaces import IFacultyContainer 19 19 >>> IFacultyContainer.providedBy(mycontainer) 20 20 True … … 31 31 >>> from zope.component import createObject 32 32 >>> createObject(u'waeup.FacultyContainer') 33 <waeup. university.facultycontainer.FacultyContainer object at 0x...>33 <waeup.sirp.university.facultycontainer.FacultyContainer object at 0x...> 34 34 35 35 This way we get a thing that implements IFacultyContainer without … … 57 57 Okay, so we have to get a faculty first:: 58 58 59 >>> from waeup. university.faculty import Faculty59 >>> from waeup.sirp.university.faculty import Faculty 60 60 >>> myfaculty = Faculty() 61 61 -
waeup/branches/ulif-namespace/src/waeup/sirp/users.txt
r4789 r4797 16 16 us: 17 17 18 >>> from waeup. users import UserContainer18 >>> from waeup.sirp.users import UserContainer 19 19 >>> myusers = UserContainer() 20 20 … … 33 33 >>> bob = myusers['bob'] 34 34 >>> bob 35 <waeup. authentication.Account object at 0x...>35 <waeup.sirp.authentication.Account object at 0x...> 36 36 37 37 >>> bob.name -
waeup/branches/ulif-namespace/src/waeup/sirp/utils/csvimport.txt
r4789 r4797 1 :mod:`waeup. utils.csvimport` -- CSV file importers2 ************************************************** 1 :mod:`waeup.sirp.utils.csvimport` -- CSV file importers 2 ******************************************************* 3 3 4 .. module:: waeup. utils.csvimport4 .. module:: waeup.sirp.utils.csvimport 5 5 6 6 Components for importing CSV files. … … 21 21 data afterwards: 22 22 23 >>> from waeup. university.facultycontainer import FacultyContainer23 >>> from waeup.sirp.university.facultycontainer import FacultyContainer 24 24 >>> mycontainer = FacultyContainer() 25 25 … … 35 35 We get a suitable importer by asking for a multi-adapter to 36 36 our file and IWAeUPCSVExporter (see section above, the importexport 37 module and the `waeup. csvfile` README for details):37 module and the `waeup.sirp.csvfile` README for details): 38 38 39 >>> from waeup. csvfile import getCSVFile40 >>> from waeup. interfaces import IWAeUPCSVImporter39 >>> from waeup.sirp.csvfile import getCSVFile 40 >>> from waeup.sirp.interfaces import IWAeUPCSVImporter 41 41 >>> from zope.component import getMultiAdapter 42 42 >>> importer = getMultiAdapter((getCSVFile('myfaculties.csv'), … … 44 44 ... IWAeUPCSVImporter) 45 45 >>> importer 46 <waeup. utils.csvimport.FacultyCSVImporter object at 0x...>46 <waeup.sirp.utils.csvimport.FacultyCSVImporter object at 0x...> 47 47 48 48 This importer complies with the IWAeUPCSVImporter interface: 49 49 50 >>> from waeup. utils.csvimport import FacultyCSVImporter50 >>> from waeup.sirp.utils.csvimport import FacultyCSVImporter 51 51 >>> IWAeUPCSVImporter.implementedBy(FacultyCSVImporter) 52 52 True -
waeup/branches/ulif-namespace/src/waeup/sirp/utils/helpers.txt
r4789 r4797 1 :mod:`waeup. utils.helpers` -- Helpers for the WAeUP SRP2 ******************************************************* 3 4 .. module:: waeup. utils.helpers1 :mod:`waeup.sirp.utils.helpers` -- Helpers for the WAeUP SRP 2 ************************************************************ 3 4 .. module:: waeup.sirp.utils.helpers 5 5 6 6 Helper functions for the WAeUP SRP. … … 16 16 17 17 >>> import os 18 >>> from waeup. utils.helpers import removeFileOrDirectory18 >>> from waeup.sirp.utils.helpers import removeFileOrDirectory 19 19 >>> open('blah', 'wb').write('nonsense') 20 20 >>> 'blah' in os.listdir('.') … … 67 67 >>> open(os.path.join('src', 'blah'), 'wb').write('nonsense') 68 68 69 >>> from waeup. utils.helpers import copyFileSystemTree69 >>> from waeup.sirp.utils.helpers import copyFileSystemTree 70 70 >>> result = copyFileSystemTree('src', 'dst') 71 71 … … 172 172 returned with all preceeding/following stuff stripped: 173 173 174 >>> from waeup. utils.helpers import getInnerHTMLPart174 >>> from waeup.sirp.utils.helpers import getInnerHTMLPart 175 175 >>> print getInnerHTMLPart("""<html> 176 176 ... <head> -
waeup/branches/ulif-namespace/src/waeup/sirp/utils/importexport.txt
r4789 r4797 33 33 We can export faculties. First we create a faculty:: 34 34 35 >>> from waeup. university.faculty import Faculty35 >>> from waeup.sirp.university.faculty import Faculty 36 36 >>> myfaculty = Faculty() 37 37 >>> myfaculty.name = 'My very faculty.' … … 43 43 an exporter:: 44 44 45 >>> from waeup. interfaces import IWAeUPXMLExporter45 >>> from waeup.sirp.interfaces import IWAeUPXMLExporter 46 46 >>> exporter = IWAeUPXMLExporter(myfaculty) 47 47 >>> exporter 48 <waeup. utils.importexport.XMLExporter object at 0x...>48 <waeup.sirp.utils.importexport.XMLExporter object at 0x...> 49 49 50 50 All exporters provide an ``export(<obj>)`` method:: … … 85 85 afterwards:: 86 86 87 >>> from waeup. university.faculty import Faculty87 >>> from waeup.sirp.university.faculty import Faculty 88 88 >>> myfaculty = Faculty() 89 89 >>> myfaculty.name = 'My very faculty.' … … 91 91 We create an XML dump of this object:: 92 92 93 >>> from waeup. interfaces import IWAeUPXMLExporter93 >>> from waeup.sirp.interfaces import IWAeUPXMLExporter 94 94 >>> exporter = IWAeUPXMLExporter(myfaculty) 95 95 >>> result = exporter.export('myexport.xml') … … 101 101 Now we create an importer for that file:: 102 102 103 >>> from waeup. interfaces import IWAeUPXMLImporter103 >>> from waeup.sirp.interfaces import IWAeUPXMLImporter 104 104 >>> importer = IWAeUPXMLImporter(myfaculty) 105 105 … … 114 114 115 115 >>> new_obj 116 <waeup. university.faculty.Faculty object at 0x...>116 <waeup.sirp.university.faculty.Faculty object at 0x...> 117 117 118 118 >>> new_obj.name … … 135 135 136 136 >>> new_obj 137 <waeup. university.faculty.Faculty object at 0x...>137 <waeup.sirp.university.faculty.Faculty object at 0x...> 138 138 139 139 Clean up:: … … 158 158 159 159 CSV sources build a plugin framework inside the WAeUP portal (that 160 might be factored out one day). See `waeup. csvfile` to learn more160 might be factored out one day). See `waeup.sirp.csvfile` to learn more 161 161 about that. 162 162 163 A `waeup. csvfile.CSVFile` plugin cares for a special kind of CSV file.163 A `waeup.sirp.csvfile.CSVFile` plugin cares for a special kind of CSV file. 164 164 165 165 To make clear what that means, we start by creating a simple CSV … … 186 186 a file: 187 187 188 >>> from waeup. csvfile import getCSVFile188 >>> from waeup.sirp.csvfile import getCSVFile 189 189 >>> mysource = getCSVFile('mycavedata.csv') 190 190 >>> mysource 191 <waeup. csvfile.csvfile.CSVFile object at 0x...>191 <waeup.sirp.csvfile.csvfile.CSVFile object at 0x...> 192 192 193 193 We define caves like this: … … 218 218 importer, that imports data to the container: 219 219 220 >>> from waeup. csvfile.interfaces import ICSVFile221 >>> from waeup. utils.importexport import CSVImporter222 >>> from waeup. interfaces import IWAeUPCSVImporter220 >>> from waeup.sirp.csvfile.interfaces import ICSVFile 221 >>> from waeup.sirp.utils.importexport import CSVImporter 222 >>> from waeup.sirp.interfaces import IWAeUPCSVImporter 223 223 >>> class CaveImporter(CSVImporter): 224 224 ... # Tell, what kinds of objects we connect... … … 268 268 adapting this instead of ICSVData. 269 269 270 In the `waeup. csvfile` subpackage's README it is shown, how this can270 In the `waeup.sirp.csvfile` subpackage's README it is shown, how this can 271 271 be accomplished. 272 272 -
waeup/branches/ulif-namespace/src/waeup/sirp/widgets/table.txt
r4789 r4797 1 waeup. widgets2 ************* 1 waeup.sirp.widgets 2 ****************** 3 3 4 4 Widgets for the WAeUP SRP. … … 10 10 ====== 11 11 12 >>> from waeup. widgets.table import Col, Table12 >>> from waeup.sirp.widgets.table import Col, Table 13 13 >>> id = Col( 14 14 ... header='Id', width=100, sortable=True, type='int', … … 45 45 46 46 47 >>> from waeup. widgets.table import YUITable47 >>> from waeup.sirp.widgets.table import YUITable 48 48 >>> table = YUITable('My YUI Table', cols=(id, mycol1, mycol2)) 49 49 >>> print table.getJSTableCode() … … 75 75 of object. The YUIStaticTableView looks up such an adapter for a given 76 76 context to find a table to manage. The adapter has to implement 77 `ITableProvider` from `waeup. widgets.interfaces` and should provide a77 `ITableProvider` from `waeup.sirp.widgets.interfaces` and should provide a 78 78 `getTables` method. 79 79 … … 82 82 >>> import grok 83 83 >>> grok.testing.grok('waeup') 84 >>> from waeup. widgets.interfaces import ITableProvider84 >>> from waeup.sirp.widgets.interfaces import ITableProvider 85 85 >>> class TableAdapter(grok.Adapter): 86 86 ... grok.context(SomeContent) … … 102 102 ... name='yuistatictables.js') 103 103 >>> view 104 <waeup. widgets.table.YUIStaticTableView object at 0x...>104 <waeup.sirp.widgets.table.YUIStaticTableView object at 0x...> 105 105 106 106 When we call the view we get pure JavaScript: … … 126 126 ... name='yuistatictables.js') 127 127 >>> view 128 <waeup. widgets.table.YUIStaticTableView object at 0x...>128 <waeup.sirp.widgets.table.YUIStaticTableView object at 0x...> 129 129 130 130 But if we call this adapter, we will get an empty result, because
Note: See TracChangeset for help on using the changeset viewer.