This file is indexed.

/usr/share/pyshared/zope.sqlalchemy-0.6.1.egg-info/PKG-INFO is in python-zope.sqlalchemy 0.6.1-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
Metadata-Version: 1.1
Name: zope.sqlalchemy
Version: 0.6.1
Summary: Minimal Zope/SQLAlchemy transaction integration
Home-page: http://pypi.python.org/pypi/zope.sqlalchemy
Author: Laurence Rowe
Author-email: laurence@lrowe.co.uk
License: ZPL 2.1
Description: ***************
        zope.sqlalchemy
        ***************
        
        .. contents::
           :local:
        
        Introduction
        ============
        
        The aim of this package is to unify the plethora of existing packages
        integrating SQLAlchemy with Zope's transaction management. As such it seeks
        only to provide a data manager and makes no attempt to define a `zopeish` way
        to configure engines.
        
        For WSGI applications, Zope style automatic transaction management is
        available with `repoze.tm2`_, a part of `Repoze BFG`_ and `Turbogears 2`_.
        
        You need to understand `SQLAlchemy`_ for this package and this README to make 
        any sense.
        
        .. _repoze.tm2: http://docs.repoze.org/tm2/
        
        .. _Repoze BFG: http://bfg.repoze.org/
        
        .. _Turbogears 2: http://turbogears.org/
        
        .. _SQLAlchemy: http://sqlalchemy.org/docs/
        
        Running the tests
        =================
        
        This package is distributed as a buildout. Using your desired python run:
        
        $ python bootstrap.py
        
        This will download the dependent packages and setup the test script, which may
        be run with:
        
        $ ./bin/test
        
        or with the standard setuptools test command:
        
        $ ./bin/py setup.py test
        
        To enable testing with your own database set the TEST_DSN environment variable
        to your sqlalchemy database dsn. Two-phase commit behaviour may be tested by
        setting the TEST_TWOPHASE variable to a non empty string. e.g:
        
        $ TEST_DSN=postgres://test:test@localhost/test TEST_TWOPHASE=True bin/test
        
        Example
        =======
        
        This example is lifted directly from the SQLAlchemy declarative documentation.
        First the necessary imports.
        
            >>> from sqlalchemy import *
            >>> from sqlalchemy.ext.declarative import declarative_base
            >>> from sqlalchemy.orm import scoped_session, sessionmaker, relation
            >>> from zope.sqlalchemy import ZopeTransactionExtension
            >>> import transaction
        
        Now to define the mapper classes.
        
            >>> Base = declarative_base()
            >>> class User(Base):
            ...     __tablename__ = 'test_users'
            ...     id = Column('id', Integer, primary_key=True)
            ...     name = Column('name', String(50))
            ...     addresses = relation("Address", backref="user")
            >>> class Address(Base):
            ...     __tablename__ = 'test_addresses'
            ...     id = Column('id', Integer, primary_key=True)
            ...     email = Column('email', String(50))
            ...     user_id = Column('user_id', Integer, ForeignKey('test_users.id'))
        
        Create an engine and setup the tables. Note that for this example to work a 
        recent version of sqlite/pysqlite is required. 3.4.0 seems to be sufficient.
        
            >>> engine = create_engine(TEST_DSN, convert_unicode=True)
            >>> Base.metadata.create_all(engine)
        
        Now to create the session itself. As zope is a threaded web server we must use
        scoped sessions. Zope and SQLAlchemy sessions are tied together by using the
        ZopeTransactionExtension from this package.
        
            >>> Session = scoped_session(sessionmaker(bind=engine,
            ... twophase=TEST_TWOPHASE, extension=ZopeTransactionExtension()))
        
        Call the scoped session factory to retrieve a session. You may call this as
        many times as you like within a transaction and you will always retrieve the
        same session. At present there are no users in the database.
        
            >>> session = Session()
            >>> session.query(User).all()
            []
        
        We can now create a new user and commit the changes using Zope's transaction
        machinary, just as Zope's publisher would.
        
            >>> session.add(User(id=1, name='bob'))
            >>> transaction.commit()
        
        Engine level connections are outside the scope of the transaction integration.
        
            >>> engine.connect().execute('SELECT * FROM test_users').fetchall()
            [(1, ...'bob')]
        
        A new transaction requires a new session. Let's add an address.
        
            >>> session = Session()
            >>> bob = session.query(User).all()[0]
            >>> bob.name
            u'bob'
            >>> bob.addresses
            []
            >>> bob.addresses.append(Address(id=1, email='bob@bob.bob'))
            >>> transaction.commit()
            >>> session = Session()
            >>> bob = session.query(User).all()[0]
            >>> bob.addresses
            [<Address object at ...>]
            >>> bob.addresses[0].email
            u'bob@bob.bob'
            >>> bob.addresses[0].email = 'wrong@wrong'    
        
        To rollback a transaction, use transaction.abort().
        
            >>> transaction.abort()
            >>> session = Session()
            >>> bob = session.query(User).all()[0]
            >>> bob.addresses[0].email
            u'bob@bob.bob'
            >>> transaction.abort()
        
        By default, zope.sqlalchemy puts sessions in an 'active' state when they are
        first used. ORM write operations automatically move the session into a
        'changed' state. This avoids unnecessary database commits. Sometimes it
        is necessary to interact with the database directly through SQL. It is not
        possible to guess whether such an operation is a read or a write. Therefore we
        must manually mark the session as changed when manual SQL statements write
        to the DB.
        
            >>> session = Session()
            >>> conn = session.connection()
            >>> users = Base.metadata.tables['test_users']
            >>> conn.execute(users.update(users.c.name=='bob'), name='ben')
            <sqlalchemy.engine.base.ResultProxy object at ...>
            >>> from zope.sqlalchemy import mark_changed
            >>> mark_changed(session)
            >>> transaction.commit()
            >>> session = Session()
            >>> session.query(User).all()[0].name
            u'ben'
            >>> transaction.abort()
        
        If this is a problem you may tell the extension to place the session in the
        'changed' state initially.
        
            >>> Session.configure(extension=ZopeTransactionExtension('changed'))
            >>> Session.remove()
            >>> session = Session()
            >>> conn = session.connection()
            >>> conn.execute(users.update(users.c.name=='ben'), name='bob')
            <sqlalchemy.engine.base.ResultProxy object at ...>
            >>> transaction.commit()
            >>> session = Session()
            >>> session.query(User).all()[0].name
            u'bob'
            >>> transaction.abort()
        
        Development version
        ===================
        
        `SVN version <svn://svn.zope.org/repos/main/zope.sqlalchemy/trunk#egg=zope.sqlalchemy-dev>`_
        
        
        
        Changes
        =======
        
        0.6.1 (2011-01-08)
        ------------------
        
        * Update datamanager.mark_changed to handle sessions which have not yet logged
          a (ORM) query.
        
        
        0.6 (2010-07-24)
        ----------------
        
        * Implement should_retry for sqlalchemy.orm.exc.ConcurrentModificationError
          and serialization errors from PostgreSQL and Oracle.
          (Specify transaction>=1.1 to use this functionality.)
        
        * Include license files.
        
        * Add ``transaction_manager`` attribute to data managers for compliance with
          IDataManager interface.
        
        0.5 (2010-06-07)
        ----------------
        
        * Remove redundant session.flush() / session.clear() on savepoint operations.
          These were only needed with SQLAlchemy 0.4.x. 
        
        * SQLAlchemy 0.6.x support. Require SQLAlchemy >= 0.5.1.
        
        * Add support for running ``python setup.py test``.
        
        * Pull in pysqlite explicitly as a test dependency.
        
        * Setup sqlalchemy mappers in test setup and clear them in tear down. This
          makes the tests more robust and clears up the global state after. It
          caused the tests to fail when other tests in the same run called
          clear_mappers.
        
        0.4 (2009-01-20)
        ----------------
        
        Bugs fixed:
        
        * Only raise errors in tpc_abort if we have committed.
        
        * Remove the session id from the SESSION_STATE just before we de-reference the
          session (i.e. all work is already successfuly completed). This fixes cases
          where the transaction commit failed but SESSION_STATE was already cleared.  In
          those cases, the transaction was wedeged as abort would always error.  This
          happened on PostgreSQL where invalid SQL was used and the error caught.
        
        * Call session.flush() unconditionally in tpc_begin.
        
        * Change error message on session.commit() to be friendlier to non zope users.
        
        Feature changes:
        
        * Support for bulk update and delete with SQLAlchemy 0.5.1
        
        0.3 (2008-07-29)
        ----------------
        
        Bugs fixed:
        
        * New objects added to a session did not cause a transaction join, so were not
          committed at the end of the transaction unless the database was accessed.
          SQLAlchemy 0.4.7 or 0.5beta3 now required.
        
        Feature changes:
        
        * For correctness and consistency with ZODB, renamed the function 'invalidate' 
          to 'mark_changed' and the status 'invalidated' to 'changed'.
        
        0.2 (2008-06-28)
        ----------------
        
        Feature changes:
        
        * Updated to support SQLAlchemy 0.5. (0.4.6 is still supported).
        
        0.1 (2008-05-15)
        ----------------
        
        * Initial public release.
        
Keywords: zope zope3 sqlalchemy
Platform: UNKNOWN
Classifier: Framework :: Zope3
Classifier: Programming Language :: Python
Classifier: License :: OSI Approved :: Zope Public License
Classifier: Topic :: Software Development :: Libraries :: Python Modules