Changeset 4920


Ignore:
Timestamp:
28 Jan 2010, 09:29:49 (15 years ago)
Author:
uli
Message:

Make unit tests run again with the new package layout.

Location:
waeup/branches/ulif-namespace/src/waeup/sirp
Files:
54 edited

Legend:

Unmodified
Added
Removed
  • waeup/branches/ulif-namespace/src/waeup/sirp/README.txt

    r4789 r4920  
    1 The waeup package
    2 ********************
     1The waeup.sirp package
     2**********************
    33
    44:Test-Layer: unit
     
    1313
    1414  >>> import grok
    15   >>> grok.testing.grok('waeup')
     15  >>> grok.testing.grok('waeup.sirp')
    1616
    1717Universities
     
    2323We can easily create universities::
    2424
    25   >>> from waeup.app import University
     25  >>> from waeup.sirp.app import University
    2626  >>> u = University()
    2727  >>> u
    28   <waeup.app.University object at 0x...>
     28  <waeup.sirp.app.University object at 0x...>
    2929
    3030Universities have a name.
     
    3737
    3838  >>> u['faculties']
    39   <waeup.university.facultycontainer.FacultyContainer object at 0x...>
     39  <waeup.sirp.university.facultycontainer.FacultyContainer object at 0x...>
    4040
    4141  >>> u['students']
    42   <waeup.student.studentcontainer.StudentContainer object at 0x...>
     42  <waeup.sirp.student.studentcontainer.StudentContainer object at 0x...>
    4343
    4444  >>> u['hostels']
    45   <waeup.hostel.hostelcontainer.HostelContainer object at 0x...>
     45  <waeup.sirp.hostel.hostelcontainer.HostelContainer object at 0x...>
    4646
    4747We can export universities. For this we lookup an appropriate exporter
    4848first::
    4949
    50   >>> from waeup.interfaces import IWAeUPExporter
     50  >>> from waeup.sirp.interfaces import IWAeUPExporter
    5151  >>> exporter = IWAeUPExporter(u)
    5252  >>> exporter
    53   <waeup.utils.importexport.Exporter object at 0x...>
     53  <waeup.sirp.utils.importexport.Exporter object at 0x...>
    5454
    5555Now we can trigger the export::
     
    6262memory file::
    6363
    64   >>> from waeup.interfaces import IWAeUPXMLExporter
     64  >>> from waeup.sirp.interfaces import IWAeUPXMLExporter
    6565  >>> exporter = IWAeUPXMLExporter(u)
    6666  >>> f = exporter.export()
     
    8484We can create faculties easily::
    8585
    86   >>> from waeup.university.faculty import Faculty
     86  >>> from waeup.sirp.university.faculty import Faculty
    8787  >>> f = Faculty()
    8888  >>> f
    89   <waeup.university.faculty.Faculty object at 0x...>
     89  <waeup.sirp.university.faculty.Faculty object at 0x...>
    9090
    9191Also faculties want to be named::
  • waeup/branches/ulif-namespace/src/waeup/sirp/__init__.py

    r4789 r4920  
    11import grok
    2 from waeup.interfaces import IWAeUPObject
     2from waeup.sirp.interfaces import IWAeUPObject
    33from zope.annotation.attribute import AttributeAnnotations
    44from zope.annotation.interfaces import IAnnotations
  • waeup/branches/ulif-namespace/src/waeup/sirp/app.py

    r4884 r4920  
    66from zope.component import createObject
    77
    8 from waeup.interfaces import (IUniversity, ICSVDataReceivers, IDataCenter,
     8from waeup.sirp.interfaces import (IUniversity, ICSVDataReceivers, IDataCenter,
    99                              IDataCenterStorageMovedEvent)
    10 from waeup.authentication import setup_authentication
    11 from waeup.datacenter import DataCenter
    12 from waeup.users import UserContainer
     10from waeup.sirp.authentication import setup_authentication
     11from waeup.sirp.datacenter import DataCenter
     12from waeup.sirp.users import UserContainer
    1313
    1414class University(grok.Application, grok.Container):
  • waeup/branches/ulif-namespace/src/waeup/sirp/app.txt

    r4789 r4920  
    1 :mod:`waeup.app` -- central components for a WAeUP portal
    2 *********************************************************
     1:mod:`waeup.sirp.app` -- central components for a WAeUP portal
     2**************************************************************
    33
    44:Test-Layer: unit
    55
    6 .. module:: waeup.app
     6.. module:: waeup.sirp.app
    77
    88.. class:: University
     
    2020     An arbitrary object containing "faculties". In the case of
    2121     `University` it is a container of type
    22      `waeup.interfaces.IFacultyContainer`.
     22     `waeup.sirp.interfaces.IFacultyContainer`.
    2323
    2424
     
    3939instance:
    4040
    41     >>> from waeup.app import University
     41    >>> from waeup.sirp.app import University
    4242    >>> myuniversity = University()
    4343    >>> myuniversity
    44     <waeup.app.University object at 0x...>
     44    <waeup.sirp.app.University object at 0x...>
    4545
    4646Instances of `University` comply with the interface
    47 `waeup.interfaces.IUniversity`:
     47`waeup.sirp.interfaces.IUniversity`:
    4848
    4949    >>> from zope.interface.verify import verifyClass
    50     >>> from waeup.interfaces import IUniversity
     50    >>> from waeup.sirp.interfaces import IUniversity
    5151    >>> verifyClass(IUniversity, University)
    5252    True
     
    5555interface:
    5656
    57     >>> from waeup.app import University
     57    >>> from waeup.sirp.app import University
    5858    >>> myuniversity = University()
    5959    >>> myuniversity.name
     
    6161
    6262    >>> 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.py

    r4789 r4920  
    1010from zope.securitypolicy.interfaces import IPrincipalRoleManager
    1111from zope.securitypolicy.principalrole import principalRoleManager
    12 from waeup.interfaces import IUserAccount
    13 import waeup.permissions
     12from waeup.sirp.interfaces import IUserAccount
     13import waeup.sirp.permissions
    1414
    1515def setup_authentication(pau):
  • waeup/branches/ulif-namespace/src/waeup/sirp/browser/__init__.py

    r4789 r4920  
    1 from waeup.browser.layout import (WAeUPPage, WAeUPLayout, WAeUPDisplayFormPage,
    2                                   WAeUPEditFormPage, WAeUPAddFormPage,
    3                                   NullValidator)
     1from waeup.sirp.browser.layout import (
     2    WAeUPPage, WAeUPLayout, WAeUPDisplayFormPage, WAeUPEditFormPage,
     3    WAeUPAddFormPage, NullValidator)
  • waeup/branches/ulif-namespace/src/waeup/sirp/browser/breadcrumbs.py

    r4789 r4920  
    66from zope.publisher.browser import TestRequest
    77
    8 from waeup import interfaces
    9 from waeup.browser.interfaces import (IBreadcrumb, IBreadcrumbIgnorable,
     8from waeup.sirp import interfaces
     9from waeup.sirp.browser.interfaces import (IBreadcrumb, IBreadcrumbIgnorable,
    1010                                      IBreadcrumbContainer)
    1111       
  • waeup/branches/ulif-namespace/src/waeup/sirp/browser/layout.py

    r4789 r4920  
    44from hurry import yui
    55from megrok.layout import Page, Layout, EditForm, DisplayForm, AddForm
    6 from waeup.interfaces import IWAeUPObject
     6from waeup.sirp.interfaces import IWAeUPObject
    77from z3c.flashmessage.interfaces import IMessageSource
    88from zope.component import queryUtility, ComponentLookupError
  • waeup/branches/ulif-namespace/src/waeup/sirp/browser/pages.py

    r4909 r4920  
    1212from hurry.query.query import Query, Text
    1313from hurry.workflow.interfaces import NoTransitionAvailableError
    14 from waeup.browser import (WAeUPPage, WAeUPEditFormPage, WAeUPAddFormPage,
     14from waeup.sirp.browser import (WAeUPPage, WAeUPEditFormPage, WAeUPAddFormPage,
    1515                           WAeUPDisplayFormPage, NullValidator)
    16 from waeup.catalog import search, search_context
    17 from waeup.datacenter import Import
    18 from waeup.interfaces import (IUniversity, IWAeUPObject, IUserContainer,
     16from waeup.sirp.catalog import search, search_context
     17from waeup.sirp.datacenter import Import
     18from waeup.sirp.interfaces import (IUniversity, IWAeUPObject, IUserContainer,
    1919                              IUserAccount, IFacultyContainer, IDataCenter,
    2020                              IFaculty, IDepartment, ICourse, ICertificate,
    2121                              ICertificateCourse, IWAeUPXMLImporter,
    2222                              IWAeUPXMLExporter)
    23 from waeup.widgets.interfaces import ITableProvider
    24 from waeup.utils.helpers import getName
     23from waeup.sirp.widgets.interfaces import ITableProvider
     24from waeup.sirp.utils.helpers import getName
    2525from zope import schema
    2626from zope.app.security.interfaces import (IAuthentication,
     
    3232from zope.session.interfaces import ISession
    3333
    34 from waeup.interfaces import IBatchProcessor
     34from waeup.sirp.interfaces import IBatchProcessor
    3535from zope.component import getAllUtilitiesRegisteredFor
    3636
  • waeup/branches/ulif-namespace/src/waeup/sirp/browser/viewlets.py

    r4858 r4920  
    66from zope.component import getMultiAdapter
    77from zope.location.interfaces import ISite
    8 from waeup.browser.pages import (UniversityPage, FacultyContainerPage,
     8from waeup.sirp.browser.pages import (UniversityPage, FacultyContainerPage,
    99                                 DatacenterPage, FacultyPage, DepartmentPage,
    1010                                 CoursePage, CertificatePage,
    1111                                 CertificateCoursePage)
    12 from waeup.browser.interfaces import IBreadcrumbContainer
    13 from waeup.interfaces import (IUniversity, IWAeUPObject, IWAeUPXMLExporter,
     12from waeup.sirp.browser.interfaces import IBreadcrumbContainer
     13from waeup.sirp.interfaces import (IUniversity, IWAeUPObject, IWAeUPXMLExporter,
    1414                              IWAeUPXMLImporter, IFacultyContainer, IFaculty,
    1515                              IDepartment, ICourse, ICertificate,
     
    164164           
    165165#
    166 # waeup.app.University viewlets...
     166# waeup.sirp.app.University viewlets...
    167167#
    168168class Login(grok.Viewlet):
  • waeup/branches/ulif-namespace/src/waeup/sirp/catalog.py

    r4789 r4920  
    44from hurry.query.query import Query, Text
    55from hurry.query import Eq
    6 from waeup.app import University
    7 from waeup.interfaces import ICourse, ICertificateCourse
    8 from waeup.student.interfaces import IStudent
     6from waeup.sirp.app import University
     7from waeup.sirp.interfaces import ICourse, ICertificateCourse
     8from waeup.sirp.student.interfaces import IStudent
    99from zope.app.catalog.interfaces import ICatalog
    1010from zope.app.intid.interfaces import IIntIds
  • waeup/branches/ulif-namespace/src/waeup/sirp/csvfile/README.txt

    r4789 r4920  
    1 :mod:`waeup.csvfile` -- generic support for handling CSV files
    2 **************************************************************
     1:mod:`waeup.sirp.csvfile` -- generic support for handling CSV files
     2*******************************************************************
    33
    44:Test-Layer: unit
    55
    6 .. module:: waeup.csvfile
     6.. module:: waeup.sirp.csvfile
    77   :synopsis: generic support for handling CSV files.
    88
     
    1010.. note::
    1111
    12    This version of the :mod:`waeup.csvfile` module doesn't support
     12   This version of the :mod:`waeup.sirp.csvfile` module doesn't support
    1313   Unicode input.  Also, there are currently some issues regarding
    1414   ASCII NUL characters.  Accordingly, all input should be UTF-8 or
     
    125125   The string can be uppercase, lowercase or mixed:
    126126
    127      >>> from waeup.csvfile import toBool
     127     >>> from waeup.sirp.csvfile import toBool
    128128     >>> toBool('y')
    129129     True
     
    149149=============
    150150
    151 To initialize the whole framework we have to grok the :mod:`waeup`
     151To initialize the whole framework we have to grok the :mod:`waeup.sirp`
    152152package first:
    153153
    154154    >>> import grok
    155     >>> grok.testing.grok('waeup')
     155    >>> grok.testing.grok('waeup.sirp')
    156156
    157157Create a file:
     
    168168object out of a path string:
    169169
    170     >>> from waeup.csvfile.interfaces import ICSVFile
     170    >>> from waeup.sirp.csvfile.interfaces import ICSVFile
    171171    >>> src = ICSVFile(path)
    172172    >>> src
    173     <waeup.csvfile.csvfile.CSVFile object at 0x...>
     173    <waeup.sirp.csvfile.csvfile.CSVFile object at 0x...>
    174174
    175175Create a receiver:
    176176
    177     >>> from waeup.csvfile.interfaces import ICSVDataReceiver
     177    >>> from waeup.sirp.csvfile.interfaces import ICSVDataReceiver
    178178    >>> class Receiver(object):
    179179    ...   grok.implements(ICSVDataReceiver)
     
    186186
    187187    >>> from zope.component import getMultiAdapter
    188     >>> from waeup.csvfile.interfaces import ICSVDataConnector
     188    >>> from waeup.sirp.csvfile.interfaces import ICSVDataConnector
    189189    >>> conn = getMultiAdapter((src, recv), ICSVDataConnector)
    190190    Traceback (most recent call last):
    191191    ...
    192     ComponentLookupError: ((<waeup.csvfile.csvfile.CSVFile object at 0x...>,
     192    ComponentLookupError: ((<waeup.sirp.csvfile.csvfile.CSVFile object at 0x...>,
    193193                            <Receiver object at 0x...>),
    194         <InterfaceClass waeup.csvfile.interfaces.ICSVDataConnector>, u'')
     194        <InterfaceClass waeup.sirp.csvfile.interfaces.ICSVDataConnector>, u'')
    195195
    196196Okay, create a connector:
     
    241241for an adapter to the path string:
    242242
    243     >>> from waeup.csvfile.interfaces import ICSVFile
     243    >>> from waeup.sirp.csvfile.interfaces import ICSVFile
    244244    >>> wrapper = ICSVFile(path)
    245245    >>> wrapper
    246     <waeup.csvfile.csvfile.CSVFile object at 0x...>
     246    <waeup.sirp.csvfile.csvfile.CSVFile object at 0x...>
    247247
    248248This wrapper can return the CSV data as a sequence of dicts:
     
    271271use the :func:`getCSVFile` function:
    272272
    273     >>> from waeup.csvfile.csvfile import getCSVFile
     273    >>> from waeup.sirp.csvfile.csvfile import getCSVFile
    274274    >>> wrapper = getCSVFile(path)
    275275    >>> wrapper
    276     <waeup.csvfile.csvfile.CSVFile object at 0x...>
     276    <waeup.sirp.csvfile.csvfile.CSVFile object at 0x...>
    277277
    278278As we currently have only one type of wrapper, we get this. Let's
    279279create another wrapper, that requires a column 'col1':
    280280
    281     >>> from waeup.csvfile.interfaces import ICSVFile
    282     >>> from waeup.csvfile import CSVFile
     281    >>> from waeup.sirp.csvfile.interfaces import ICSVFile
     282    >>> from waeup.sirp.csvfile import CSVFile
    283283    >>> class ICSVFileWithCol1(ICSVFile):
    284284    ...   """A CSV file that contains a 'col1' column.
     
    341341in constructor, whether this requirement is met:
    342342
    343     >>> from waeup.csvfile.interfaces import ICSVFile
    344     >>> from waeup.csvfile import CSVFile
     343    >>> from waeup.sirp.csvfile.interfaces import ICSVFile
     344    >>> from waeup.sirp.csvfile import CSVFile
    345345    >>> class ICSVFile13(ICSVFile):
    346346    ...   """A CSV file that contains a 'special_col' column.
     
    370370We create a wrapper that requires 'col1' and 'col2':
    371371
    372     >>> from waeup.csvfile.interfaces import ICSVFile
    373     >>> from waeup.csvfile import CSVFile
     372    >>> from waeup.sirp.csvfile.interfaces import ICSVFile
     373    >>> from waeup.sirp.csvfile import CSVFile
    374374    >>> class ICSVFile12(ICSVFile):
    375375    ...   """A CSV file that contains a 'special_col' column.
     
    390390  path (i.e. __init__ raises some kind of exception): score is -1:
    391391
    392     >>> from waeup.csvfile.csvfile import getScore
     392    >>> from waeup.sirp.csvfile.csvfile import getScore
    393393    >>> getScore('nonexistant', CSVFile)
    394394    -1
     
    426426
    427427    >>> import grok
    428     >>> from waeup.csvfile.interfaces import ICSVFile
    429     >>> from waeup.csvfile import CSVFile
     428    >>> from waeup.sirp.csvfile.interfaces import ICSVFile
     429    >>> from waeup.sirp.csvfile import CSVFile
    430430
    431431    >>> class ICustomCSVFile(ICSVFile):
     
    501501Now we create a wrapper, that requires that field:
    502502
    503     >>> from waeup.csvfile.interfaces import ICSVFile
    504     >>> from waeup.csvfile import CSVFile
     503    >>> from waeup.sirp.csvfile.interfaces import ICSVFile
     504    >>> from waeup.sirp.csvfile import CSVFile
    505505    >>> class ICSVFileWithSpecialCol(ICSVFile):
    506506    ...   """A CSV file that contains a 'special_col' column.
     
    629629before, using the :func:`getCSVFile` function:
    630630
    631     >>> from waeup.csvfile import getCSVFile
     631    >>> from waeup.sirp.csvfile import getCSVFile
    632632    >>> myfile = getCSVFile(path)
    633633    >>> ICSVFile12.providedBy(myfile)
  • waeup/branches/ulif-namespace/src/waeup/sirp/csvfile/__init__.py

    r4789 r4920  
    11# Make this a package.
    2 from waeup.csvfile.csvfile import getCSVFile, CSVFile
    3 from waeup.csvfile.util import toBool
     2from waeup.sirp.csvfile.csvfile import getCSVFile, CSVFile
     3from waeup.sirp.csvfile.util import toBool
  • waeup/branches/ulif-namespace/src/waeup/sirp/csvfile/csvfile.py

    r4789 r4920  
    66import csv
    77import grok
    8 from waeup.csvfile.interfaces import ICSVFile
     8from waeup.sirp.csvfile.interfaces import ICSVFile
    99
    1010class CSVFile(grok.Adapter):
  • waeup/branches/ulif-namespace/src/waeup/sirp/csvfile/meta.py

    r4789 r4920  
    1 """Meta configuration for waeup.csvfile components.
     1"""Meta configuration for waeup.sirp.csvfile components.
    22"""
    33import martian
    4 import waeup.csvfile.csvfile
    5 from waeup.csvfile import CSVFile
     4import waeup.sirp.csvfile.csvfile
     5from waeup.sirp.csvfile import CSVFile
    66
    77# This grokker fills the registry on startup, with any class that is
     
    1010    martian.component(CSVFile)
    1111    def execute(self, klass, **kw):
    12         waeup.csvfile.csvfile.csvwrappers.append(klass)
     12        waeup.sirp.csvfile.csvfile.csvwrappers.append(klass)
    1313        return True
  • waeup/branches/ulif-namespace/src/waeup/sirp/datacenter.py

    r4908 r4920  
    1212from zope.component import getMultiAdapter
    1313from zope.component.interfaces import ObjectEvent
    14 from waeup.csvfile import getCSVFile
    15 from waeup.interfaces import (IDataCenter, IWAeUPCSVImporter,
     14from waeup.sirp.csvfile import getCSVFile
     15from waeup.sirp.interfaces import (IDataCenter, IWAeUPCSVImporter,
    1616                              ICSVDataReceivers, IDataCenterFile,
    1717                              IDataCenterStorageMovedEvent)
    18 from waeup.utils.helpers import copyFileSystemTree
     18from waeup.sirp.utils.helpers import copyFileSystemTree
    1919
    2020class DataCenter(grok.Container):
  • waeup/branches/ulif-namespace/src/waeup/sirp/datacenter.txt

    r4907 r4920  
    1111A data center can be created easily:
    1212
    13     >>> from waeup.datacenter import DataCenter
     13    >>> from waeup.sirp.datacenter import DataCenter
    1414    >>> mydatacenter = DataCenter()
    1515    >>> mydatacenter
    16     <waeup.datacenter.DataCenter object at 0x...>
     16    <waeup.sirp.datacenter.DataCenter object at 0x...>
    1717
    1818Each data center has a location in file system where files are stored:
     
    2020    >>> storagepath = mydatacenter.storage
    2121    >>> storagepath
    22     '/.../src/waeup/files'
     22    '/.../waeup/sirp/files'
    2323
    2424
     
    7777
    7878    >>> mydatacenter.getFiles()
    79     [<waeup.datacenter.DataCenterFile object at 0x...>]
     79    [<waeup.sirp.datacenter.DataCenterFile object at 0x...>]
    8080
    8181As we can see, the actual file is wrapped by a convenience wrapper,
     
    282282
    283283    >>> import grok
    284     >>> from waeup.interfaces import ICSVDataReceivers
    285     >>> from waeup.datacenter import DataCenter
     284    >>> from waeup.sirp.interfaces import ICSVDataReceivers
     285    >>> from waeup.sirp.datacenter import DataCenter
    286286    >>> class SomeContainer(grok.Container):
    287287    ...   grok.implements(ICSVDataReceivers)
     
    302302to import data into instances of MyCSVReceiver:
    303303
    304     >>> from waeup.csvfile.interfaces import ICSVFile
    305     >>> from waeup.interfaces import IWAeUPCSVImporter
    306     >>> from waeup.utils.importexport import CSVImporter
     304    >>> from waeup.sirp.csvfile.interfaces import ICSVFile
     305    >>> from waeup.sirp.interfaces import IWAeUPCSVImporter
     306    >>> from waeup.sirp.utils.importexport import CSVImporter
    307307    >>> class MyCSVImporter(CSVImporter):
    308308    ...   grok.adapts(ICSVFile, MyCSVReceiver)
  • waeup/branches/ulif-namespace/src/waeup/sirp/hostel/hostel.py

    r4789 r4920  
    11import grok
    2 from waeup.interfaces import IHostel
     2from waeup.sirp.interfaces import IHostel
    33
    44class Hostel(grok.Container):
  • waeup/branches/ulif-namespace/src/waeup/sirp/hostel/hostelcontainer.py

    r4789 r4920  
    22from zope.component.interfaces import IFactory
    33from zope.interface import implementedBy
    4 from waeup.interfaces import IHostelContainer, IHostel
     4from waeup.sirp.interfaces import IHostelContainer, IHostel
    55
    66class HostelContainer(grok.Container):
  • waeup/branches/ulif-namespace/src/waeup/sirp/hostel/hostelcontainer.txt

    r4789 r4920  
    1 waeup.hostel.HostelContainer
    2 ****************************
     1waeup.sirp.hostel.HostelContainer
     2*********************************
    33
    44Containers for hostels.
     
    1111We can easily create `HostelContainers`::
    1212
    13     >>> from waeup.hostel.hostelcontainer import HostelContainer
     13    >>> from waeup.sirp.hostel.hostelcontainer import HostelContainer
    1414    >>> mycontainer = HostelContainer()
    1515
    1616Hostel containers provide ``IHostelContainer``:
    1717
    18     >>> from waeup.interfaces import IHostelContainer
     18    >>> from waeup.sirp.interfaces import IHostelContainer
    1919    >>> IHostelContainer.providedBy(mycontainer)
    2020    True
     
    3131    >>> from zope.component import createObject
    3232    >>> createObject(u'waeup.HostelContainer')
    33     <waeup.hostel.hostelcontainer.HostelContainer object at 0x...>
     33    <waeup.sirp.hostel.hostelcontainer.HostelContainer object at 0x...>
    3434
    3535This way we get a thing that implements IHostelContainer without
     
    5757Okay, so we have to get a hostel first::
    5858
    59     >>> from waeup.hostel.hostel import Hostel
     59    >>> from waeup.sirp.hostel.hostel import Hostel
    6060    >>> myhostel = Hostel()
    6161
  • waeup/branches/ulif-namespace/src/waeup/sirp/interfaces.py

    r4882 r4920  
    88from zope import schema
    99from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm
    10 from waeup.permissions import RoleSource
     10from waeup.sirp.permissions import RoleSource
    1111
    1212class FatalCSVError(Exception):
  • waeup/branches/ulif-namespace/src/waeup/sirp/permissions.txt

    r4789 r4920  
    1616We can get all roles defined in a WAeUP portal:
    1717
    18     >>> from waeup.permissions import getRoles
     18    >>> from waeup.sirp.permissions import getRoles
    1919    >>> getRoles()
    2020    ['waeup.PortalManager', 'waeup.PortalUser']
  • waeup/branches/ulif-namespace/src/waeup/sirp/student/student.py

    r4789 r4920  
    11import grok
    22from grok import index
    3 from waeup.student.interfaces import IStudent
     3from waeup.sirp.student.interfaces import IStudent
    44
    55def fromCsv(a):
  • waeup/branches/ulif-namespace/src/waeup/sirp/student/studentcontainer.py

    r4789 r4920  
    33from zope.component.interfaces import IFactory
    44from zope.interface import implementedBy
    5 from waeup.interfaces import IStudentContainer
    6 from waeup.utils import importexport as csv
     5from waeup.sirp.interfaces import IStudentContainer
     6from waeup.sirp.utils import importexport as csv
    77
    88class StudentContainer(grok.Container):
  • waeup/branches/ulif-namespace/src/waeup/sirp/tables.py

    r4789 r4920  
    22"""
    33import grok
    4 from waeup.interfaces import (IUniversity, IFacultyContainer, IFaculty,
     4from waeup.sirp.interfaces import (IUniversity, IFacultyContainer, IFaculty,
    55                              IDepartment, ICourseContainer)
    6 from waeup.widgets.interfaces import ITableProvider
    7 from waeup.widgets.table import YUITable as Table
    8 from waeup.widgets.table import Col
     6from waeup.sirp.widgets.interfaces import ITableProvider
     7from waeup.sirp.widgets.table import YUITable as Table
     8from waeup.sirp.widgets.table import Col
    99from zope.security.management import checkPermission
    1010
  • waeup/branches/ulif-namespace/src/waeup/sirp/testing.py

    r4789 r4920  
    11import os.path
    2 import waeup
     2import waeup.sirp
    33from zope.app.testing.functional import ZCMLLayer
    44
    55ftesting_zcml = os.path.join(
    6     os.path.dirname(waeup.__file__), 'ftesting.zcml')
     6    os.path.dirname(waeup.sirp.__file__), 'ftesting.zcml')
    77FunctionalLayer = ZCMLLayer(ftesting_zcml, __name__, 'FunctionalLayer',
    88                            allow_teardown=True)
  • waeup/branches/ulif-namespace/src/waeup/sirp/tests/test_waeup.py

    r4789 r4920  
    22## test_waeuptest.py
    33"""
    4 Test setup for the waeup package.
     4Test setup for the waeup.sirp package.
    55"""
    66import grok
    77import zope.component.eventtesting
    8 from waeup.testing import FunctionalLayer
     8from waeup.sirp.testing import FunctionalLayer
    99
    1010def setUpZope(test):
     
    1313# Register all tests in the waeup_ng package
    1414test_suite = grok.testing.register_all_tests(
    15     'waeup', usetup=setUpZope,
     15    'waeup.sirp', usetup=setUpZope,
    1616    layer=FunctionalLayer)
  • waeup/branches/ulif-namespace/src/waeup/sirp/university/certificate.py

    r4864 r4920  
    77from zope.component.interfaces import IFactory, ComponentLookupError
    88from zope.interface import implementedBy
    9 from waeup.interfaces import ICertificate, ICertificateCourse, ICourse
     9from waeup.sirp.interfaces import ICertificate, ICertificateCourse, ICourse
    1010
    1111class Certificate(grok.Container):
  • waeup/branches/ulif-namespace/src/waeup/sirp/university/certificate.txt

    r4867 r4920  
    1 :mod:`waeup.university.certificate` -- Certificates for WAeUP
    2 *************************************************************
    3 
    4 .. module:: waeup.university.certificate
     1:mod:`waeup.sirp.university.certificate` -- Certificates for WAeUP
     2******************************************************************
     3
     4.. module:: waeup.sirp.university.certificate
    55
    66Components that represent and manage certificates.
     
    3131   All parameters are optional:
    3232
    33      >>> from waeup.university.certificate import Certificate
     33     >>> from waeup.sirp.university.certificate import Certificate
    3434     >>> mycertificate = Certificate()
    3535
    3636   Certificates have the attributes required by the `ICertificate` interface:
    3737
    38      >>> from waeup.interfaces import ICertificate
     38     >>> from waeup.sirp.interfaces import ICertificate
    3939     >>> ICertificate.providedBy(mycertificate)
    4040     True
     
    164164
    165165      Add a reference to a course. A course is an object implementing
    166       :class:`waeup.interfaces.ICourse`.
     166      :class:`waeup.sirp.interfaces.ICourse`.
    167167
    168168      Please don't be confused by the term 'reference'. This just
    169       means an ordinary :class:`waeup.university.course.Course` object
     169      means an ordinary :class:`waeup.sirp.university.course.Course` object
    170170      in almost all cases. As this object will normaly be one stored
    171171      in a department, the course here will simply become a reference
     
    226226     >>> mycertificate = createObject(u'waeup.Certificate')
    227227     >>> mycertificate
    228      <waeup.university.certificate.Certificate object at 0x...>
     228     <waeup.sirp.university.certificate.Certificate object at 0x...>
    229229
    230230   The factory complies with the specifications from the
     
    233233     >>> from zope.interface.verify import verifyClass
    234234     >>> from zope.component.interfaces import IFactory
    235      >>> from waeup.university.certificate import CertificateFactory
     235     >>> from waeup.sirp.university.certificate import CertificateFactory
    236236     >>> verifyClass(IFactory, CertificateFactory)
    237237     True
     
    242242     >>> certificate_factory = CertificateFactory()
    243243     >>> certificate_factory.getInterfaces()
    244      <implementedBy waeup.university.certificate.Certificate>
     244     <implementedBy waeup.sirp.university.certificate.Certificate>
    245245
    246246
     
    260260     >>> mycertificatecourse = createObject(u'waeup.CertificateCourse')
    261261     >>> mycertificatecourse
    262      <waeup.university.certificate.CertificateCourse object at 0x...>
     262     <waeup.sirp.university.certificate.CertificateCourse object at 0x...>
    263263
    264264   The factory complies with the specifications from the
     
    267267     >>> from zope.interface.verify import verifyClass
    268268     >>> from zope.component.interfaces import IFactory
    269      >>> from waeup.university.certificate import CertificateCourseFactory
     269     >>> from waeup.sirp.university.certificate import CertificateCourseFactory
    270270     >>> verifyClass(IFactory, CertificateCourseFactory)
    271271     True
     
    276276     >>> certcourse_factory = CertificateCourseFactory()
    277277     >>> certcourse_factory.getInterfaces()
    278      <implementedBy waeup.university.certificate.CertificateCourse>
     278     <implementedBy waeup.sirp.university.certificate.CertificateCourse>
    279279
    280280
     
    311311We can create certificates:
    312312
    313     >>> from waeup.university.certificate import Certificate
     313    >>> from waeup.sirp.university.certificate import Certificate
    314314    >>> mycertificate = Certificate()
    315315    >>> mycertificate
    316     <waeup.university.certificate.Certificate object at 0x...>
     316    <waeup.sirp.university.certificate.Certificate object at 0x...>
    317317
    318318Another way to create certificates is by asking for a factory called
     
    323323    >>> mycertificate = createObject(u'waeup.Certificate')
    324324    >>> mycertificate
    325     <waeup.university.certificate.Certificate object at 0x...>
     325    <waeup.sirp.university.certificate.Certificate object at 0x...>
    326326
    327327CertificateCourses
     
    331331:class:`ICertificateCourse` interface:
    332332
    333     >>> from waeup.interfaces import ICertificateCourse
    334     >>> from waeup.university.certificate import CertificateCourse
     333    >>> from waeup.sirp.interfaces import ICertificateCourse
     334    >>> from waeup.sirp.university.certificate import CertificateCourse
    335335    >>> mycertcourse = CertificateCourse(None, 200, False)
    336336    >>> ICertificateCourse.providedBy(mycertcourse)
     
    347347    >>> mycertcourse = createObject(u'waeup.CertificateCourse')
    348348    >>> mycertcourse
    349     <waeup.university.certificate.CertificateCourse object at 0x...>
     349    <waeup.sirp.university.certificate.CertificateCourse object at 0x...>
    350350
    351351.. _removecertificatecourses:
  • waeup/branches/ulif-namespace/src/waeup/sirp/university/certificatecontainer.py

    r4789 r4920  
    22"""
    33import grok
    4 from waeup.interfaces import ICertificateContainer, ICertificate
     4from waeup.sirp.interfaces import ICertificateContainer, ICertificate
    55from zope.component.interfaces import IFactory
    66from zope.interface import implementedBy
  • waeup/branches/ulif-namespace/src/waeup/sirp/university/certificatecontainer.txt

    r4789 r4920  
    1 :mod:`waeup.university.certificatecontainer` -- Certificate containers
    2 **********************************************************************
     1:mod:`waeup.sirp.university.certificatecontainer` -- Certificate containers
     2***************************************************************************
    33
    4 .. module:: waeup.university.certificatecontainer
     4.. module:: waeup.sirp.university.certificatecontainer
    55
    66Containers for certificates.
     
    3232   :class:`CertificateContainer` instances are instances of
    3333   :class:`grok.Container` that hold and manage instances of
    34    :class:`waeup.university.certificate.Certificate`.
     34   :class:`waeup.sirp.university.certificate.Certificate`.
    3535
    36      >>> from waeup.university.certificatecontainer import CertificateContainer
     36     >>> from waeup.sirp.university.certificatecontainer import CertificateContainer
    3737     >>> mycontainer = CertificateContainer()
    3838     >>> mycontainer
    39      <waeup.university.certificatecontainer.CertificateContainer object at 0x...>
     39     <waeup.sirp.university.certificatecontainer.CertificateContainer object at 0x...>
    4040
    4141   Certificate containers provide `ICertificateContainer`:
    4242
    43      >>> from waeup.interfaces import ICertificateContainer
     43     >>> from waeup.sirp.interfaces import ICertificateContainer
    4444     >>> ICertificateContainer.providedBy(mycontainer)
    4545     True
     
    6363
    6464      *certificate* must be an instance of
    65       :class:`waeup.university.certificate.Certificate`:
     65      :class:`waeup.sirp.university.certificate.Certificate`:
    6666
    67         >>> from waeup.university.certificatecontainer import (
     67        >>> from waeup.sirp.university.certificatecontainer import (
    6868        ...   CertificateContainer)
    6969        >>> mycontainer = CertificateContainer()
     
    7575      The key of added items is the ``code`` attribute:
    7676
    77         >>> from waeup.university.certificate import Certificate
     77        >>> from waeup.sirp.university.certificate import Certificate
    7878        >>> mycertificate = Certificate(code='CERTIFICATE1')
    7979        >>> mycontainer.addCertificate(mycertificate)
     
    110110     >>> mycertificatecontainer = createObject(u'waeup.CertificateContainer')
    111111     >>> mycertificatecontainer
    112      <waeup.university.certificatecontainer.CertificateContainer object at 0x...>
     112     <waeup.sirp.university.certificatecontainer.CertificateContainer object at 0x...>
    113113
    114114   The factory complies with the specifications from the
     
    117117     >>> from zope.interface.verify import verifyClass
    118118     >>> from zope.component.interfaces import IFactory
    119      >>> from waeup.university.certificatecontainer import (
     119     >>> from waeup.sirp.university.certificatecontainer import (
    120120     ...   CertificateContainerFactory)
    121121     >>> verifyClass(IFactory, CertificateContainerFactory)
     
    127127     >>> certificatecontainer_factory = CertificateContainerFactory()
    128128     >>> certificatecontainer_factory.getInterfaces()
    129      <implementedBy waeup.university.certificatecontainer.CertificateContainer>
     129     <implementedBy waeup.sirp.university.certificatecontainer.CertificateContainer>
    130130
    131131
     
    138138We can easily create `CertificateContainers`:
    139139
    140     >>> from waeup.university.certificatecontainer import CertificateContainer
     140    >>> from waeup.sirp.university.certificatecontainer import CertificateContainer
    141141    >>> mycontainer = CertificateContainer()
    142142
     
    149149    >>> from zope.component import createObject
    150150    >>> createObject(u'waeup.CertificateContainer')
    151     <waeup.university.certificatecontainer.CertificateContainer object at 0x...>
     151    <waeup.sirp.university.certificatecontainer.CertificateContainer object at 0x...>
    152152
    153153This way we get a thing that implements ICertificateContainer without
  • waeup/branches/ulif-namespace/src/waeup/sirp/university/course.py

    r4789 r4920  
    44from zope.interface import implementedBy
    55from zope.component.interfaces import IFactory
    6 from waeup.interfaces import ICourse
     6from waeup.sirp.interfaces import ICourse
    77
    88class Course(grok.Model):
  • waeup/branches/ulif-namespace/src/waeup/sirp/university/course.txt

    r4789 r4920  
    1 :mod:`waeup.university.course` -- Courses
    2 *****************************************
     1:mod:`waeup.sirp.university.course` -- Courses
     2**********************************************
    33
    4 .. module:: waeup.university.course
     4.. module:: waeup.sirp.university.course
    55
    66Components that represent courses.
     
    3030   All parameters are optional:
    3131
    32      >>> from waeup.university.course import Course
     32     >>> from waeup.sirp.university.course import Course
    3333     >>> mycourse = Course()
    3434     >>> mycourse
    35      <waeup.university.course.Course object at 0x...>
     35     <waeup.sirp.university.course.Course object at 0x...>
    3636
    3737   Course instances have the attributes required by the
    38    :class:`waeup.interfaces.ICourse` interface:
     38   :class:`waeup.sirp.interfaces.ICourse` interface:
    3939
    40      >>> from waeup.interfaces import ICourse
     40     >>> from waeup.sirp.interfaces import ICourse
    4141     >>> ICourse.providedBy(mycourse)
    4242     True
     
    115115     >>> mycourse = createObject(u'waeup.Course')
    116116     >>> mycourse
    117      <waeup.university.course.Course object at 0x...>
     117     <waeup.sirp.university.course.Course object at 0x...>
    118118
    119119   The factory complies with the specifications from the
     
    122122     >>> from zope.interface.verify import verifyClass
    123123     >>> from zope.component.interfaces import IFactory
    124      >>> from waeup.university.course import CourseFactory
     124     >>> from waeup.sirp.university.course import CourseFactory
    125125     >>> verifyClass(IFactory, CourseFactory)
    126126     True
     
    131131     >>> course_factory = CourseFactory()
    132132     >>> course_factory.getInterfaces()
    133      <implementedBy waeup.university.course.Course>
     133     <implementedBy waeup.sirp.university.course.Course>
    134134
    135135Examples
     
    142142class and calling the constructor:
    143143
    144     >>> from waeup.university.course import Course
     144    >>> from waeup.sirp.university.course import Course
    145145    >>> mycourse = Course()
    146146    >>> mycourse
    147     <waeup.university.course.Course object at 0x...>
     147    <waeup.sirp.university.course.Course object at 0x...>
    148148
    149149Another way to create courses is by asking for a factory called
     
    154154    >>> mycourse = createObject(u'waeup.Course')
    155155    >>> mycourse
    156     <waeup.university.course.Course object at 0x...>
     156    <waeup.sirp.university.course.Course object at 0x...>
    157157
  • waeup/branches/ulif-namespace/src/waeup/sirp/university/coursecontainer.py

    r4789 r4920  
    44from zope.interface import implementedBy
    55from zope.component.interfaces import IFactory
    6 from waeup.interfaces import ICourseContainer, ICourse
     6from waeup.sirp.interfaces import ICourseContainer, ICourse
    77
    88class CourseContainer(grok.Container):
  • waeup/branches/ulif-namespace/src/waeup/sirp/university/coursecontainer.txt

    r4789 r4920  
    1 :mod:`waeup.university.coursecontainer` -- Course containers
    2 ************************************************************
     1:mod:`waeup.sirp.university.coursecontainer` -- Course containers
     2*****************************************************************
    33
    4 .. module:: waeup.university.coursecontainer
     4.. module:: waeup.sirp.university.coursecontainer
    55
    66Containers for courses.
     
    3232   :class:`CourseContainer` instances are instances of
    3333   :class:`grok.Container` that hold and manage instances of
    34    :class:`waeup.university.course.Course`.
     34   :class:`waeup.sirp.university.course.Course`.
    3535
    36      >>> from waeup.university.coursecontainer import CourseContainer
     36     >>> from waeup.sirp.university.coursecontainer import CourseContainer
    3737     >>> mycontainer = CourseContainer()
    3838     >>> mycontainer
    39      <waeup.university.coursecontainer.CourseContainer object at 0x...>
     39     <waeup.sirp.university.coursecontainer.CourseContainer object at 0x...>
    4040
    4141   Course containers provide `ICourseContainer`:
    4242
    43      >>> from waeup.interfaces import ICourseContainer
     43     >>> from waeup.sirp.interfaces import ICourseContainer
    4444     >>> ICourseContainer.providedBy(mycontainer)
    4545     True
     
    6363
    6464      *course* must be an instance of
    65       :class:`waeup.university.course.Course`:
     65      :class:`waeup.sirp.university.course.Course`:
    6666
    67         >>> from waeup.university.coursecontainer import CourseContainer
     67        >>> from waeup.sirp.university.coursecontainer import CourseContainer
    6868        >>> mycontainer = CourseContainer()
    6969        >>> mycontainer.addCourse('blah')
     
    7474      The key of added items is the ``code`` attribute:
    7575
    76         >>> from waeup.university.course import Course
     76        >>> from waeup.sirp.university.course import Course
    7777        >>> mycourse = Course(code='COURSE1')
    7878        >>> mycontainer.addCourse(mycourse)
     
    109109     >>> mycoursecontainer = createObject(u'waeup.CourseContainer')
    110110     >>> mycoursecontainer
    111      <waeup.university.coursecontainer.CourseContainer object at 0x...>
     111     <waeup.sirp.university.coursecontainer.CourseContainer object at 0x...>
    112112
    113113   The factory complies with the specifications from the
     
    116116     >>> from zope.interface.verify import verifyClass
    117117     >>> from zope.component.interfaces import IFactory
    118      >>> from waeup.university.coursecontainer import CourseContainerFactory
     118     >>> from waeup.sirp.university.coursecontainer import CourseContainerFactory
    119119     >>> verifyClass(IFactory, CourseContainerFactory)
    120120     True
     
    125125     >>> coursecontainer_factory = CourseContainerFactory()
    126126     >>> coursecontainer_factory.getInterfaces()
    127      <implementedBy waeup.university.coursecontainer.CourseContainer>
     127     <implementedBy waeup.sirp.university.coursecontainer.CourseContainer>
    128128
    129129
     
    136136We can easily create `CourseContainers`:
    137137
    138     >>> from waeup.university.coursecontainer import CourseContainer
     138    >>> from waeup.sirp.university.coursecontainer import CourseContainer
    139139    >>> mycontainer = CourseContainer()
    140140
     
    147147    >>> from zope.component import createObject
    148148    >>> createObject(u'waeup.CourseContainer')
    149     <waeup.university.coursecontainer.CourseContainer object at 0x...>
     149    <waeup.sirp.university.coursecontainer.CourseContainer object at 0x...>
    150150
    151151This way we get a thing that implements ICourseContainer without
  • waeup/branches/ulif-namespace/src/waeup/sirp/university/department.py

    r4789 r4920  
    55from zope.component.interfaces import IFactory
    66from zope.interface import implementedBy
    7 from waeup.interfaces import IDepartment
     7from waeup.sirp.interfaces import IDepartment
    88
    99class Department(grok.Container):
  • waeup/branches/ulif-namespace/src/waeup/sirp/university/department.txt

    r4789 r4920  
    1 :mod:`waeup.university.department` -- Departments
    2 *************************************************
     1:mod:`waeup.sirp.university.department` -- Departments
     2******************************************************
    33
    4 .. module:: waeup.university.department
     4.. module:: waeup.sirp.university.department
    55
    66Components that represent university departments.
     
    2626   Create a representation of a university department:
    2727
    28      >>> from waeup.university.department import Department
     28     >>> from waeup.sirp.university.department import Department
    2929     >>> mydept = Department()
    3030     >>> mydept
    31      <waeup.university.department.Department object at 0x...>
     31     <waeup.sirp.university.department.Department object at 0x...>
    3232
    3333   Another way to create :class:`Department` instances is by asking
    34    for a factory called ``waeup.Department``. This way we can create a
     34   for a factory called ``waeup.sirp.Department``. This way we can create a
    3535   department without importing a class:
    3636
     
    3838     >>> mydept = createObject(u'waeup.Department')
    3939     >>> mydept
    40      <waeup.university.department.Department object at 0x...>
     40     <waeup.sirp.university.department.Department object at 0x...>
    4141
    4242   :class:`Department` instances have the attributes required by the
    4343   `IDepartment` interface:
    4444
    45      >>> from waeup.interfaces import IDepartment
     45     >>> from waeup.sirp.interfaces import IDepartment
    4646     >>> IDepartment.providedBy(mydept)
    4747     True
     
    9292
    9393        >>> mydept.courses
    94         <waeup.university.coursecontainer.CourseContainer object at 0x...>
     94        <waeup.sirp.university.coursecontainer.CourseContainer object at 0x...>
    9595
    9696
     
    103103
    104104        >>> mydept.certificates
    105         <waeup...certificatecontainer.CertificateContainer object at 0x...>
     105        <waeup.sirp...certificatecontainer.CertificateContainer object at 0x...>
    106106
    107107Utilities
     
    123123     >>> mydepartment = createObject(u'waeup.Department')
    124124     >>> mydepartment
    125      <waeup.university.department.Department object at 0x...>
     125     <waeup.sirp.university.department.Department object at 0x...>
    126126
    127127   The factory complies with the specifications from the
     
    130130     >>> from zope.interface.verify import verifyClass
    131131     >>> from zope.component.interfaces import IFactory
    132      >>> from waeup.university.department import DepartmentFactory
     132     >>> from waeup.sirp.university.department import DepartmentFactory
    133133     >>> verifyClass(IFactory, DepartmentFactory)
    134134     True
     
    139139     >>> department_factory = DepartmentFactory()
    140140     >>> 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.py

    r4789 r4920  
    55from zope.component.interfaces import IFactory
    66from zope.interface import implementedBy
    7 from waeup.interfaces import IFaculty, IDepartment
     7from waeup.sirp.interfaces import IFaculty, IDepartment
    88
    99class Faculty(grok.Container):
  • waeup/branches/ulif-namespace/src/waeup/sirp/university/faculty.txt

    r4789 r4920  
    1 :mod:`waeup.university.faculty` -- Faculties
    2 ********************************************
    3 
    4 .. module:: waeup.university.faculty
     1:mod:`waeup.sirp.university.faculty` -- Faculties
     2*************************************************
     3
     4.. module:: waeup.sirp.university.faculty
    55
    66Components that represent university faculties.
     
    2525   Create a representation of a university faculty:
    2626
    27      >>> from waeup.university.faculty import Faculty
     27     >>> from waeup.sirp.university.faculty import Faculty
    2828     >>> myfac = Faculty()
    2929     >>> myfac
    30      <waeup.university.faculty.Faculty object at 0x...>
     30     <waeup.sirp.university.faculty.Faculty object at 0x...>
    3131
    3232   Another way to create :class:`Faculty` instances is by asking
     
    3737     >>> myfac = createObject(u'waeup.Faculty')
    3838     >>> myfac
    39      <waeup.university.faculty.Faculty object at 0x...>
     39     <waeup.sirp.university.faculty.Faculty object at 0x...>
    4040
    4141   :class:`Faculty` instances have the attributes required by the
    4242   `IFaculty` interface:
    4343
    44      >>> from waeup.interfaces import IFaculty
     44     >>> from waeup.sirp.interfaces import IFaculty
    4545     >>> IFaculty.providedBy(myfac)
    4646     True
     
    6666      Regular departments are accepted:
    6767
    68         >>> from waeup.university.department import Department
     68        >>> from waeup.sirp.university.department import Department
    6969        >>> myfac.addDepartment(Department(title='Physics',
    7070        ...                                code='DP'))
    7171
    7272        >>> list(myfac.items())
    73         [(u'DP', <waeup.university.department.Department object at 0x...>)]
     73        [(u'DP', <waeup.sirp.university.department.Department object at 0x...>)]
    7474
    7575   .. method:: clear()
     
    132132     >>> myfaculty = createObject(u'waeup.Faculty')
    133133     >>> myfaculty
    134      <waeup.university.faculty.Faculty object at 0x...>
     134     <waeup.sirp.university.faculty.Faculty object at 0x...>
    135135
    136136   The factory complies with the specifications from the
     
    139139     >>> from zope.interface.verify import verifyClass
    140140     >>> from zope.component.interfaces import IFactory
    141      >>> from waeup.university.faculty import FacultyFactory
     141     >>> from waeup.sirp.university.faculty import FacultyFactory
    142142     >>> verifyClass(IFactory, FacultyFactory)
    143143     True
     
    148148     >>> faculty_factory = FacultyFactory()
    149149     >>> faculty_factory.getInterfaces()
    150      <implementedBy waeup.university.faculty.Faculty>
     150     <implementedBy waeup.sirp.university.faculty.Faculty>
    151151
    152152
     
    156156We can create faculties:
    157157
    158     >>> from waeup.university.faculty import Faculty
     158    >>> from waeup.sirp.university.faculty import Faculty
    159159    >>> myfaculty = Faculty()
    160160    >>> myfaculty
    161     <waeup.university.faculty.Faculty object at 0x...>
     161    <waeup.sirp.university.faculty.Faculty object at 0x...>
    162162
    163163Another way to create faculties is by asking for a factory called
     
    168168    >>> myfaculty = createObject(u'waeup.Faculty')
    169169    >>> myfaculty
    170     <waeup.university.faculty.Faculty object at 0x...>
     170    <waeup.sirp.university.faculty.Faculty object at 0x...>
    171171
    172172Faculty attributes
     
    175175Faculties have the attributes required by the `IFaculty` interface:
    176176
    177     >>> from waeup.interfaces import IFaculty
     177    >>> from waeup.sirp.interfaces import IFaculty
    178178    >>> IFaculty.providedBy(myfaculty)
    179179    True
  • waeup/branches/ulif-namespace/src/waeup/sirp/university/facultycontainer.py

    r4789 r4920  
    22from zope.component.interfaces import IFactory
    33from zope.interface import implementedBy
    4 from waeup.interfaces import IFacultyContainer, IFaculty
     4from waeup.sirp.interfaces import IFacultyContainer, IFaculty
    55
    66class FacultyContainer(grok.Container):
  • waeup/branches/ulif-namespace/src/waeup/sirp/university/facultycontainer.txt

    r4789 r4920  
    1111We can easily create `FacultyContainers`::
    1212
    13     >>> from waeup.university.facultycontainer import FacultyContainer
     13    >>> from waeup.sirp.university.facultycontainer import FacultyContainer
    1414    >>> mycontainer = FacultyContainer()
    1515
    1616Faculty containers provide `IFacultyContainer`:
    1717
    18     >>> from waeup.interfaces import IFacultyContainer
     18    >>> from waeup.sirp.interfaces import IFacultyContainer
    1919    >>> IFacultyContainer.providedBy(mycontainer)
    2020    True
     
    3131    >>> from zope.component import createObject
    3232    >>> createObject(u'waeup.FacultyContainer')
    33     <waeup.university.facultycontainer.FacultyContainer object at 0x...>
     33    <waeup.sirp.university.facultycontainer.FacultyContainer object at 0x...>
    3434
    3535This way we get a thing that implements IFacultyContainer without
     
    5757Okay, so we have to get a faculty first::
    5858
    59     >>> from waeup.university.faculty import Faculty
     59    >>> from waeup.sirp.university.faculty import Faculty
    6060    >>> myfaculty = Faculty()
    6161
  • waeup/branches/ulif-namespace/src/waeup/sirp/users.py

    r4789 r4920  
    22"""
    33import grok
    4 from waeup.authentication import Account
    5 from waeup.interfaces import IUserContainer
     4from waeup.sirp.authentication import Account
     5from waeup.sirp.interfaces import IUserContainer
    66
    77class UserContainer(grok.Container):
  • waeup/branches/ulif-namespace/src/waeup/sirp/users.txt

    r4789 r4920  
    1616us:
    1717
    18     >>> from waeup.users import UserContainer
     18    >>> from waeup.sirp.users import UserContainer
    1919    >>> myusers = UserContainer()
    2020
     
    3333    >>> bob = myusers['bob']
    3434    >>> bob
    35     <waeup.authentication.Account object at 0x...>
     35    <waeup.sirp.authentication.Account object at 0x...>
    3636
    3737    >>> bob.name
  • waeup/branches/ulif-namespace/src/waeup/sirp/utils/batching.py

    r4911 r4920  
    1515from zope.schema import getFields
    1616from zope.schema.interfaces import IText
    17 from waeup.interfaces import (IBatchProcessor, IFacultyContainer, IFaculty,
     17from waeup.sirp.interfaces import (IBatchProcessor, IFacultyContainer, IFaculty,
    1818                              ICourse, IDepartment, ICertificate,
    1919                              ICertificateCourse, ISchemaTypeConverter,
  • waeup/branches/ulif-namespace/src/waeup/sirp/utils/converters.py

    r4858 r4920  
    99    from zope.browser.interfaces import ITerms
    1010from zope.schema.interfaces import IBool, IText, IInt, IChoice
    11 from waeup.interfaces import ISchemaTypeConverter
     11from waeup.sirp.interfaces import ISchemaTypeConverter
    1212
    1313# If a string has this value, it is considered as 'missing_value' or None.
  • waeup/branches/ulif-namespace/src/waeup/sirp/utils/converters.txt

    r4858 r4920  
    1 :mod:`waeup.utils.converters` -- Converters
    2 *******************************************
    3 
    4 .. module:: waeup.utils.converters
     1:mod:`waeup.sirp.utils.converters` -- Converters
     2************************************************
     3
     4.. module:: waeup.sirp.utils.converters
    55
    66Converters for :mod:`zope.schema` based data.
     
    2525   'non-values'. Current setting is:
    2626
    27       >>> from waeup.utils.converters import NONE_STRING_VALUE
     27      >>> from waeup.sirp.utils.converters import NONE_STRING_VALUE
    2828      >>> NONE_STRING_VALUE
    2929      ''
     
    3636========
    3737
    38 The :mod:`waeup.utils.converters` module is basically a collection of
     38The :mod:`waeup.sirp.utils.converters` module is basically a collection of
    3939adapters for field types of :mod:`zope.schema`.
    4040
     
    5252   `zope.schema.Choice` or similar.
    5353
    54    .. method:: provides(waeup.interfaces.ISchemaTypeConverter)
     54   .. method:: provides(waeup.sirp.interfaces.ISchemaTypeConverter)
    5555
    5656   .. method:: _convertValueFromString(string)
     
    115115   .. method:: adapts(zope.schema.IText)
    116116
    117    .. method:: provides(waeup.interfaces.ISchemaTypeConverter)
     117   .. method:: provides(waeup.sirp.interfaces.ISchemaTypeConverter)
    118118
    119119   .. method:: fromString(string[, strict=True])
     
    154154   .. method:: adapts(zope.schema.IBool)
    155155
    156    .. method:: provides(waeup.interfaces.ISchemaTypeConverter)
     156   .. method:: provides(waeup.sirp.interfaces.ISchemaTypeConverter)
    157157
    158158   .. method:: fromString(string[, strict=True])
     
    195195   .. method:: adapts(zope.schema.IInt)
    196196
    197    .. method:: provides(waeup.interfaces.ISchemaTypeConverter)
     197   .. method:: provides(waeup.sirp.interfaces.ISchemaTypeConverter)
    198198
    199199   .. method:: fromString(string[, strict=True])
     
    236236   .. method:: adapts(zope.schema.IChoice)
    237237
    238    .. method:: provides(waeup.interfaces.ISchemaTypeConverter)
     238   .. method:: provides(waeup.sirp.interfaces.ISchemaTypeConverter)
    239239
    240240   .. method:: fromString(string[, strict=False])
     
    290290:class:`TextConverter` instance:
    291291
    292     >>> from waeup.utils.converters import TextConverter
     292    >>> from waeup.sirp.utils.converters import TextConverter
    293293    >>> converter = TextConverter(field)
    294294
    295295Or we can just grab a registered adapter:
    296296
    297     >>> from waeup.interfaces import ISchemaTypeConverter
     297    >>> from waeup.sirp.interfaces import ISchemaTypeConverter
    298298    >>> converter = ISchemaTypeConverter(field)
    299299
     
    301301
    302302    >>> converter
    303     <waeup.utils.converters.TextConverter object at 0x...>
     303    <waeup.sirp.utils.converters.TextConverter object at 0x...>
    304304
    305305Now we can convert strings to this type:
     
    378378:class:`BoolConverter` instance:
    379379
    380     >>> from waeup.utils.converters import BoolConverter
     380    >>> from waeup.sirp.utils.converters import BoolConverter
    381381    >>> converter = BoolConverter(field)
    382382
    383383Or we can just grab a registered adapter:
    384384
    385     >>> from waeup.interfaces import ISchemaTypeConverter
     385    >>> from waeup.sirp.interfaces import ISchemaTypeConverter
    386386    >>> converter = ISchemaTypeConverter(field)
    387387
     
    389389
    390390    >>> converter
    391     <waeup.utils.converters.BoolConverter object at 0x...>
     391    <waeup.sirp.utils.converters.BoolConverter object at 0x...>
    392392
    393393Now we can convert strings to this type:
     
    490490:class:`IntConverter` instance:
    491491
    492     >>> from waeup.utils.converters import IntConverter
     492    >>> from waeup.sirp.utils.converters import IntConverter
    493493    >>> converter = IntConverter(field)
    494494
    495495Or we can just grab a registered adapter:
    496496
    497     >>> from waeup.interfaces import ISchemaTypeConverter
     497    >>> from waeup.sirp.interfaces import ISchemaTypeConverter
    498498    >>> converter = ISchemaTypeConverter(field)
    499499
     
    501501
    502502    >>> converter
    503     <waeup.utils.converters.IntConverter object at 0x...>
     503    <waeup.sirp.utils.converters.IntConverter object at 0x...>
    504504
    505505Now we can convert strings to this type:
     
    593593:class:`ChoiceConverter` instance:
    594594
    595     >>> from waeup.utils.converters import ChoiceConverter
     595    >>> from waeup.sirp.utils.converters import ChoiceConverter
    596596    >>> converter = ChoiceConverter(field)
    597597
    598598Or we can just grab a registered adapter:
    599599
    600     >>> from waeup.interfaces import ISchemaTypeConverter
     600    >>> from waeup.sirp.interfaces import ISchemaTypeConverter
    601601    >>> converter = ISchemaTypeConverter(field)
    602602
     
    604604
    605605    >>> converter
    606     <waeup.utils.converters.ChoiceConverter object at 0x...>
     606    <waeup.sirp.utils.converters.ChoiceConverter object at 0x...>
    607607
    608608Now we can convert strings to this type:
     
    668668    '1'
    669669
    670     >>> from waeup.interfaces import ICourse
     670    >>> from waeup.sirp.interfaces import ICourse
    671671    >>> from zope.schema import getFields
    672672    >>> field = getFields(ICourse)['semester']
     
    720720
    721721We get a converter for this field in the usual way. The
    722 :meth:`waeup.utils.converters.fromString()` method will return one of
     722:meth:`waeup.sirp.utils.converters.fromString()` method will return one of
    723723the objects if we feed it with ``'Wilma'`` or ``'Fred'``:
    724724
  • waeup/branches/ulif-namespace/src/waeup/sirp/utils/csvimport.py

    r4789 r4920  
    22"""
    33import grok
    4 from waeup.csvfile import CSVFile, toBool
    5 from waeup.csvfile.interfaces import ICSVFile
    6 from waeup.interfaces import IFacultyContainer, IWAeUPCSVImporter
    7 from waeup.utils.importexport import CSVImporter
     4from waeup.sirp.csvfile import CSVFile, toBool
     5from waeup.sirp.csvfile.interfaces import ICSVFile
     6from waeup.sirp.interfaces import IFacultyContainer, IWAeUPCSVImporter
     7from waeup.sirp.utils.importexport import CSVImporter
    88from zope.app.catalog.interfaces import ICatalog
    99from zope.component import createObject, getUtility
  • waeup/branches/ulif-namespace/src/waeup/sirp/utils/csvimport.txt

    r4789 r4920  
    1 :mod:`waeup.utils.csvimport` -- CSV file importers
    2 **************************************************
     1:mod:`waeup.sirp.utils.csvimport` -- CSV file importers
     2*******************************************************
    33
    4 .. module:: waeup.utils.csvimport
     4.. module:: waeup.sirp.utils.csvimport
    55
    66Components for importing CSV files.
     
    2121data afterwards:
    2222
    23     >>> from waeup.university.facultycontainer import FacultyContainer
     23    >>> from waeup.sirp.university.facultycontainer import FacultyContainer
    2424    >>> mycontainer = FacultyContainer()
    2525
     
    3535We get a suitable importer by asking for a multi-adapter to
    3636our file and IWAeUPCSVExporter (see section above, the importexport
    37 module and the `waeup.csvfile` README for details):
     37module and the `waeup.sirp.csvfile` README for details):
    3838
    39     >>> from waeup.csvfile import getCSVFile
    40     >>> from waeup.interfaces import IWAeUPCSVImporter
     39    >>> from waeup.sirp.csvfile import getCSVFile
     40    >>> from waeup.sirp.interfaces import IWAeUPCSVImporter
    4141    >>> from zope.component import getMultiAdapter
    4242    >>> importer = getMultiAdapter((getCSVFile('myfaculties.csv'),
     
    4444    ...                            IWAeUPCSVImporter)
    4545    >>> importer
    46     <waeup.utils.csvimport.FacultyCSVImporter object at 0x...>
     46    <waeup.sirp.utils.csvimport.FacultyCSVImporter object at 0x...>
    4747
    4848This importer complies with the IWAeUPCSVImporter interface:
    4949
    50     >>> from waeup.utils.csvimport import FacultyCSVImporter
     50    >>> from waeup.sirp.utils.csvimport import FacultyCSVImporter
    5151    >>> IWAeUPCSVImporter.implementedBy(FacultyCSVImporter)
    5252    True
  • waeup/branches/ulif-namespace/src/waeup/sirp/utils/helpers.txt

    r4789 r4920  
    1 :mod:`waeup.utils.helpers` -- Helpers for the WAeUP SRP
    2 *******************************************************
    3 
    4 .. module:: waeup.utils.helpers
     1:mod:`waeup.sirp.utils.helpers` -- Helpers for the WAeUP SRP
     2************************************************************
     3
     4.. module:: waeup.sirp.utils.helpers
    55
    66Helper functions for the WAeUP SRP.
     
    1616
    1717     >>> import os
    18      >>> from waeup.utils.helpers import removeFileOrDirectory
     18     >>> from waeup.sirp.utils.helpers import removeFileOrDirectory
    1919     >>> open('blah', 'wb').write('nonsense')
    2020     >>> 'blah' in os.listdir('.')
     
    6767     >>> open(os.path.join('src', 'blah'), 'wb').write('nonsense')
    6868
    69      >>> from waeup.utils.helpers import copyFileSystemTree
     69     >>> from waeup.sirp.utils.helpers import copyFileSystemTree
    7070     >>> result = copyFileSystemTree('src', 'dst')
    7171
     
    172172   returned with all preceeding/following stuff stripped:
    173173
    174      >>> from waeup.utils.helpers import getInnerHTMLPart
     174     >>> from waeup.sirp.utils.helpers import getInnerHTMLPart
    175175     >>> print getInnerHTMLPart("""<html>
    176176     ... <head>
  • waeup/branches/ulif-namespace/src/waeup/sirp/utils/importexport.py

    r4789 r4920  
    77from xml.dom.minidom import Document, getDOMImplementation
    88from zope.interface import Interface
    9 from waeup.csvfile.interfaces import ICSVFile
    10 from waeup.interfaces import (IWAeUPObject, IWAeUPExporter, IWAeUPXMLExporter,
     9from waeup.sirp.csvfile.interfaces import ICSVFile
     10from waeup.sirp.interfaces import (IWAeUPObject, IWAeUPExporter, IWAeUPXMLExporter,
    1111                              IWAeUPXMLImporter, IWAeUPCSVImporter)
    1212
  • waeup/branches/ulif-namespace/src/waeup/sirp/utils/importexport.txt

    r4789 r4920  
    3333We can export faculties. First we create a faculty::
    3434
    35     >>> from waeup.university.faculty import Faculty
     35    >>> from waeup.sirp.university.faculty import Faculty
    3636    >>> myfaculty = Faculty()
    3737    >>> myfaculty.name = 'My very faculty.'
     
    4343an exporter::
    4444
    45     >>> from waeup.interfaces import IWAeUPXMLExporter
     45    >>> from waeup.sirp.interfaces import IWAeUPXMLExporter
    4646    >>> exporter = IWAeUPXMLExporter(myfaculty)
    4747    >>> exporter
    48     <waeup.utils.importexport.XMLExporter object at 0x...>
     48    <waeup.sirp.utils.importexport.XMLExporter object at 0x...>
    4949
    5050All exporters provide an ``export(<obj>)`` method::
     
    8585afterwards::
    8686
    87     >>> from waeup.university.faculty import Faculty
     87    >>> from waeup.sirp.university.faculty import Faculty
    8888    >>> myfaculty = Faculty()
    8989    >>> myfaculty.name = 'My very faculty.'
     
    9191We create an XML dump of this object::
    9292
    93     >>> from waeup.interfaces import IWAeUPXMLExporter
     93    >>> from waeup.sirp.interfaces import IWAeUPXMLExporter
    9494    >>> exporter = IWAeUPXMLExporter(myfaculty)
    9595    >>> result = exporter.export('myexport.xml')
     
    101101Now we create an importer for that file::
    102102
    103     >>> from waeup.interfaces import IWAeUPXMLImporter
     103    >>> from waeup.sirp.interfaces import IWAeUPXMLImporter
    104104    >>> importer = IWAeUPXMLImporter(myfaculty)
    105105
     
    114114
    115115    >>> new_obj
    116     <waeup.university.faculty.Faculty object at 0x...>
     116    <waeup.sirp.university.faculty.Faculty object at 0x...>
    117117
    118118    >>> new_obj.name
     
    135135
    136136    >>> new_obj
    137     <waeup.university.faculty.Faculty object at 0x...>
     137    <waeup.sirp.university.faculty.Faculty object at 0x...>
    138138
    139139Clean up::
     
    158158
    159159CSV sources build a plugin framework inside the WAeUP portal (that
    160 might be factored out one day). See `waeup.csvfile` to learn more
     160might be factored out one day). See `waeup.sirp.csvfile` to learn more
    161161about that.
    162162
    163 A `waeup.csvfile.CSVFile` plugin cares for a special kind of CSV file.
     163A `waeup.sirp.csvfile.CSVFile` plugin cares for a special kind of CSV file.
    164164
    165165To make clear what that means, we start by creating a simple CSV
     
    186186a file:
    187187
    188     >>> from waeup.csvfile import getCSVFile
     188    >>> from waeup.sirp.csvfile import getCSVFile
    189189    >>> mysource = getCSVFile('mycavedata.csv')
    190190    >>> mysource
    191     <waeup.csvfile.csvfile.CSVFile object at 0x...>
     191    <waeup.sirp.csvfile.csvfile.CSVFile object at 0x...>
    192192
    193193We define caves like this:
     
    218218importer, that imports data to the container:
    219219
    220     >>> from waeup.csvfile.interfaces import ICSVFile
    221     >>> from waeup.utils.importexport import CSVImporter
    222     >>> from waeup.interfaces import IWAeUPCSVImporter
     220    >>> from waeup.sirp.csvfile.interfaces import ICSVFile
     221    >>> from waeup.sirp.utils.importexport import CSVImporter
     222    >>> from waeup.sirp.interfaces import IWAeUPCSVImporter
    223223    >>> class CaveImporter(CSVImporter):
    224224    ...   # Tell, what kinds of objects we connect...
     
    268268  adapting this instead of ICSVData.
    269269
    270   In the `waeup.csvfile` subpackage's README it is shown, how this can
     270  In the `waeup.sirp.csvfile` subpackage's README it is shown, how this can
    271271  be accomplished.
    272272
  • waeup/branches/ulif-namespace/src/waeup/sirp/widgets/table.py

    r4789 r4920  
    44from hurry import yui
    55from zope.interface import Interface
    6 from waeup.widgets.interfaces import ITableProvider
     6from waeup.sirp.widgets.interfaces import ITableProvider
    77
    88def varName(string):
  • waeup/branches/ulif-namespace/src/waeup/sirp/widgets/table.txt

    r4789 r4920  
    1 waeup.widgets
    2 *************
     1waeup.sirp.widgets
     2******************
    33
    44Widgets for the WAeUP SRP.
     
    1010======
    1111
    12     >>> from waeup.widgets.table import Col, Table
     12    >>> from waeup.sirp.widgets.table import Col, Table
    1313    >>> id = Col(
    1414    ...       header='Id', width=100, sortable=True, type='int',
     
    4545
    4646
    47     >>> from waeup.widgets.table import YUITable
     47    >>> from waeup.sirp.widgets.table import YUITable
    4848    >>> table = YUITable('My YUI Table', cols=(id, mycol1, mycol2))
    4949    >>> print table.getJSTableCode()
     
    7575of object. The YUIStaticTableView looks up such an adapter for a given
    7676context to find a table to manage. The adapter has to implement
    77 `ITableProvider` from `waeup.widgets.interfaces` and should provide a
     77`ITableProvider` from `waeup.sirp.widgets.interfaces` and should provide a
    7878`getTables` method.
    7979
     
    8282    >>> import grok
    8383    >>> grok.testing.grok('waeup')
    84     >>> from waeup.widgets.interfaces import ITableProvider
     84    >>> from waeup.sirp.widgets.interfaces import ITableProvider
    8585    >>> class TableAdapter(grok.Adapter):
    8686    ...   grok.context(SomeContent)
     
    102102    ...                        name='yuistatictables.js')
    103103    >>> view
    104     <waeup.widgets.table.YUIStaticTableView object at 0x...>
     104    <waeup.sirp.widgets.table.YUIStaticTableView object at 0x...>
    105105
    106106When we call the view we get pure JavaScript:
     
    126126    ...                        name='yuistatictables.js')
    127127    >>> view
    128     <waeup.widgets.table.YUIStaticTableView object at 0x...>
     128    <waeup.sirp.widgets.table.YUIStaticTableView object at 0x...>
    129129
    130130But if we call this adapter, we will get an empty result, because
  • waeup/branches/ulif-namespace/src/waeup/sirp/workflow.py

    r4789 r4920  
    77from hurry.workflow.interfaces import IWorkflow, IWorkflowState, IWorkflowInfo
    88from hurry.workflow.interfaces import IWorkflowVersions
    9 from waeup.interfaces import IWAeUPObject
     9from waeup.sirp.interfaces import IWAeUPObject
    1010
    1111UNCHECKED = 'unchecked'
Note: See TracChangeset for help on using the changeset viewer.