Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
tempstorage
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
tempstorage
Commits
8773be45
Commit
8773be45
authored
Mar 18, 2014
by
Tres Seaver
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1 from zopefoundation/tomgross-python3
Python 3 compatibility
parents
f24a97cb
e06c6daf
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
89 additions
and
180 deletions
+89
-180
.gitignore
.gitignore
+2
-0
.travis.yml
.travis.yml
+2
-0
CHANGES.txt
CHANGES.txt
+2
-1
bootstrap.py
bootstrap.py
+62
-169
buildout.cfg
buildout.cfg
+1
-0
setup.py
setup.py
+15
-4
src/tempstorage/TemporaryStorage.py
src/tempstorage/TemporaryStorage.py
+5
-6
No files found.
.gitignore
View file @
8773be45
...
@@ -3,8 +3,10 @@ build
...
@@ -3,8 +3,10 @@ build
dist
dist
lib
lib
parts
parts
develop-eggs
*.dll
*.dll
*.pyc
*.pyc
*.pyo
*.pyo
*.so
*.so
.installed.cfg
.travis.yml
View file @
8773be45
language
:
python
language
:
python
python
:
python
:
-
2.7
-
2.7
-
3.2
-
3.3
install
:
install
:
-
python bootstrap.py
-
python bootstrap.py
-
bin/buildout
-
bin/buildout
...
...
CHANGES.txt
View file @
8773be45
Changelog
Changelog
=========
=========
2.1
2.3
- unreleased
2.1
3.0
- unreleased
-------------------
-------------------
- Python 3 compatibility
2.12.2 - 2012-10-14
2.12.2 - 2012-10-14
-------------------
-------------------
...
...
bootstrap.py
View file @
8773be45
This diff is collapsed.
Click to expand it.
buildout.cfg
View file @
8773be45
...
@@ -5,3 +5,4 @@ parts = test
...
@@ -5,3 +5,4 @@ parts = test
[test]
[test]
recipe = zc.recipe.testrunner
recipe = zc.recipe.testrunner
eggs = tempstorage
eggs = tempstorage
setup.py
View file @
8773be45
...
@@ -16,22 +16,33 @@
...
@@ -16,22 +16,33 @@
from
setuptools
import
setup
,
find_packages
from
setuptools
import
setup
,
find_packages
long_description
=
file
(
"README.txt"
).
read
()
+
"
\
n
"
+
\
long_description
=
open
(
"README.txt"
).
read
()
+
"
\
n
"
+
\
file
(
"CHANGES.txt"
).
read
()
open
(
"CHANGES.txt"
).
read
()
setup
(
name
=
'tempstorage'
,
setup
(
name
=
'tempstorage'
,
version
=
'2.1
2.3dev
'
,
version
=
'2.1
3.dev0
'
,
url
=
'http://pypi.python.org/pypi/tempstorage'
,
url
=
'http://pypi.python.org/pypi/tempstorage'
,
license
=
'ZPL 2.1'
,
license
=
'ZPL 2.1'
,
description
=
'A RAM-based storage for ZODB'
,
description
=
'A RAM-based storage for ZODB'
,
author
=
'Zope Foundation and Contributors'
,
author
=
'Zope Foundation and Contributors'
,
author_email
=
'zope-dev@zope.org'
,
author_email
=
'zope-dev@zope.org'
,
long_description
=
long_description
,
long_description
=
long_description
,
classifiers
=
[
"Programming Language :: Python"
,
"Programming Language :: Python :: 2"
,
"Programming Language :: Python :: 2.6"
,
"Programming Language :: Python :: 2.7"
,
"Programming Language :: Python :: 3"
,
"Programming Language :: Python :: 3.2"
,
"Programming Language :: Python :: 3.3"
,
"Programming Language :: Python :: 3.4"
,
"Programming Language :: Python :: Implementation :: CPython"
,
],
packages
=
find_packages
(
'src'
),
packages
=
find_packages
(
'src'
),
package_dir
=
{
''
:
'src'
},
package_dir
=
{
''
:
'src'
},
install_requires
=
[
install_requires
=
[
'setuptools'
,
'setuptools'
,
'ZODB
3 >= 3.9.0
'
,
'ZODB'
,
'zope.testing'
,
'zope.testing'
,
],
],
include_package_data
=
True
,
include_package_data
=
True
,
...
...
src/tempstorage/TemporaryStorage.py
View file @
8773be45
...
@@ -116,7 +116,8 @@ class TemporaryStorage(BaseStorage, ConflictResolvingStorage):
...
@@ -116,7 +116,8 @@ class TemporaryStorage(BaseStorage, ConflictResolvingStorage):
def
_clear_temp
(
self
):
def
_clear_temp
(
self
):
now
=
time
.
time
()
now
=
time
.
time
()
if
now
>
(
self
.
_last_cache_gc
+
self
.
_conflict_cache_gcevery
):
if
now
>
(
self
.
_last_cache_gc
+
self
.
_conflict_cache_gcevery
):
for
k
,
v
in
self
.
_conflict_cache
.
items
():
temp_cc
=
self
.
_conflict_cache
.
copy
()
for
k
,
v
in
temp_cc
.
items
():
data
,
t
=
v
data
,
t
=
v
if
now
>
(
t
+
self
.
_conflict_cache_maxage
):
if
now
>
(
t
+
self
.
_conflict_cache_maxage
):
del
self
.
_conflict_cache
[
k
]
del
self
.
_conflict_cache
[
k
]
...
@@ -253,7 +254,6 @@ class TemporaryStorage(BaseStorage, ConflictResolvingStorage):
...
@@ -253,7 +254,6 @@ class TemporaryStorage(BaseStorage, ConflictResolvingStorage):
references
=
{}
references
=
{}
for
roid
in
referencesl
:
for
roid
in
referencesl
:
references
[
roid
]
=
1
references
[
roid
]
=
1
referenced
=
references
.
has_key
# Create a reference count for this object if one
# Create a reference count for this object if one
# doesn't already exist
# doesn't already exist
...
@@ -265,7 +265,7 @@ class TemporaryStorage(BaseStorage, ConflictResolvingStorage):
...
@@ -265,7 +265,7 @@ class TemporaryStorage(BaseStorage, ConflictResolvingStorage):
# object
# object
roids
=
oreferences
.
get
(
oid
,
[])
roids
=
oreferences
.
get
(
oid
,
[])
for
roid
in
roids
:
for
roid
in
roids
:
if
r
eferenced
(
roid
)
:
if
r
oid
in
references
:
# still referenced, so no need to update
# still referenced, so no need to update
# remove it from the references dict so it doesn't
# remove it from the references dict so it doesn't
# get "added" in the next clause
# get "added" in the next clause
...
@@ -368,13 +368,12 @@ class TemporaryStorage(BaseStorage, ConflictResolvingStorage):
...
@@ -368,13 +368,12 @@ class TemporaryStorage(BaseStorage, ConflictResolvingStorage):
self
.
_lock_acquire
()
self
.
_lock_acquire
()
try
:
try
:
rindex
=
{}
rindex
=
{}
referenced
=
rindex
.
has_key
rootl
=
[
'
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
'
]
rootl
=
[
'
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
'
]
# mark referenced objects
# mark referenced objects
while
rootl
:
while
rootl
:
oid
=
rootl
.
pop
()
oid
=
rootl
.
pop
()
if
referenced
(
oid
)
:
if
oid
in
rindex
:
continue
continue
p
=
self
.
_opickle
[
oid
]
p
=
self
.
_opickle
[
oid
]
referencesf
(
p
,
rootl
)
referencesf
(
p
,
rootl
)
...
@@ -382,7 +381,7 @@ class TemporaryStorage(BaseStorage, ConflictResolvingStorage):
...
@@ -382,7 +381,7 @@ class TemporaryStorage(BaseStorage, ConflictResolvingStorage):
# sweep unreferenced objects
# sweep unreferenced objects
for
oid
in
self
.
_index
.
keys
():
for
oid
in
self
.
_index
.
keys
():
if
not
referenced
(
oid
)
:
if
not
oid
in
rindex
:
self
.
_takeOutGarbage
(
oid
)
self
.
_takeOutGarbage
(
oid
)
finally
:
finally
:
self
.
_lock_release
()
self
.
_lock_release
()
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