Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
persistent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
persistent
Commits
f6202dbb
Commit
f6202dbb
authored
Jun 28, 2012
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid relative imports.
parent
694591ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
30 deletions
+26
-30
persistent/__init__.py
persistent/__init__.py
+26
-30
No files found.
persistent/__init__.py
View file @
f6202dbb
...
...
@@ -11,44 +11,28 @@
# FOR A PARTICULAR PURPOSE
#
##############################################################################
"""Pr
ovide access to Persistent and PersistentMapping
.
"""Pr
efer C implementations of Persistent / PickleCache / TimeStamp
.
$Id$
Fall back to pure Python implementations.
"""
try
:
from
cPersistence
import
Persistent
from
cPersistence
import
GHOST
from
cPersistence
import
UPTODATE
from
cPersistence
import
CHANGED
from
cPersistence
import
STICKY
from
cPersistence
import
simple_new
from
persistent.
cPersistence
import
Persistent
from
persistent.
cPersistence
import
GHOST
from
persistent.
cPersistence
import
UPTODATE
from
persistent.
cPersistence
import
CHANGED
from
persistent.
cPersistence
import
STICKY
from
persistent.
cPersistence
import
simple_new
except
ImportError
:
#pragma NO COVER
_HAVE_CPERSISTENCE
=
False
from
pyPersistence
import
Persistent
from
pyPersistence
import
GHOST
from
pyPersistence
import
UPTODATE
from
pyPersistence
import
CHANGED
from
pyPersistence
import
STICKY
from
persistent.pyPersistence
import
Persistent
from
persistent.pyPersistence
import
GHOST
from
persistent.pyPersistence
import
UPTODATE
from
persistent.pyPersistence
import
CHANGED
from
persistent.pyPersistence
import
STICKY
else
:
_HAVE_CPERSISTENCE
=
True
import
copy_reg
copy_reg
.
constructor
(
simple_new
)
try
:
from
cPickleCache
import
PickleCache
except
ImportError
:
#pragma NO COVER
from
picklecache
import
PickleCache
try
:
import
TimeStamp
except
ImportError
:
#pragma NO COVER
import
timestamp
as
TimeStamp
import
sys
sys
.
modules
[
'persistent.TimeStamp'
]
=
sys
.
modules
[
'persistent.timestamp'
]
if
_HAVE_CPERSISTENCE
:
# Make an interface declaration for Persistent, if zope.interface
# is available.
XXX that the pyPersistent version already does this?
# is available.
Note that the pyPersistent version already does this.
try
:
from
zope.interface
import
classImplements
except
ImportError
:
#pragma NO COVER
...
...
@@ -56,3 +40,15 @@ if _HAVE_CPERSISTENCE:
else
:
from
persistent.interfaces
import
IPersistent
classImplements
(
Persistent
,
IPersistent
)
try
:
from
persistent.cPickleCache
import
PickleCache
except
ImportError
:
#pragma NO COVER
from
persistent.picklecache
import
PickleCache
try
:
import
persistent.TimeStamp
except
ImportError
:
#pragma NO COVER
import
persistent.timestamp
as
TimeStamp
import
sys
sys
.
modules
[
'persistent.TimeStamp'
]
=
sys
.
modules
[
'persistent.timestamp'
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment