Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
1f54a380
Commit
1f54a380
authored
Jan 07, 2003
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No longer use CLIENT_HOME, INSTANCE_HOME, or ZEO_CLIENT environment
variables. Updated docstrings/comments.
parent
db74d7a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
17 deletions
+11
-17
src/ZEO/ClientCache.py
src/ZEO/ClientCache.py
+5
-10
src/ZEO/ClientStorage.py
src/ZEO/ClientStorage.py
+6
-7
No files found.
src/ZEO/ClientCache.py
View file @
1f54a380
...
...
@@ -122,16 +122,18 @@ from ZEO.ICache import ICache
magic
=
'ZEC1'
headersize
=
12
MB
=
1024
**
2
class
ClientCache
:
__implements__
=
ICache
def
__init__
(
self
,
storage
=
'1'
,
size
=
20
000000
,
client
=
None
,
var
=
None
):
def
__init__
(
self
,
storage
=
'1'
,
size
=
20
*
MB
,
client
=
None
,
var
=
None
):
# Arguments:
# storage -- storage name (used in filenames and log messages)
# size -- size limit in bytes of both files together
# client -- if not None, use a persistent cache file and use this name
# var -- directory where to create persistent cache files
# var -- directory where to create persistent cache files
; default cwd
self
.
_storage
=
storage
self
.
_limit
=
size
/
2
...
...
@@ -145,15 +147,8 @@ class ClientCache:
if
client
is
not
None
:
# Create a persistent cache
# CLIENT_HOME and INSTANCE_HOME are builtins set by App.FindHomes
if
var
is
None
:
try
:
var
=
CLIENT_HOME
except
:
try
:
var
=
os
.
path
.
join
(
INSTANCE_HOME
,
'var'
)
except
:
var
=
os
.
getcwd
()
var
=
os
.
getcwd
()
fmt
=
os
.
path
.
join
(
var
,
"c%s-%s-%%s.zec"
%
(
storage
,
client
))
# Initialize pairs of filenames, file objects, and serialnos.
...
...
src/ZEO/ClientStorage.py
View file @
1f54a380
...
...
@@ -141,16 +141,15 @@ class ClientStorage:
name -- The storage name, defaulting to ''. If this is false,
str(addr) is used as the storage name.
client -- The client name, defaulting to None. If this is
false, the environment value ZEO_CLIENT is used. If the
effective value is true, the client cache is persistent.
See ClientCache for more info.
client -- A name used to construct persistent cache filenames.
Defaults to None, in which case the cache is not persistent.
debug -- Ignored. This is present only for backwards
compatibility with ZEO 1.
var -- The 'var' directory, defaulting to None, in which
the persistent cache files should be written.
var -- When client is not None, this specifies the directory
where the persistent cache files are created. It defaults
to None, in whichcase the current directory is used.
min_disconnect_poll -- The minimum delay in seconds between
attempts to connect to the server, in seconds. Defaults
...
...
@@ -249,7 +248,7 @@ class ClientStorage:
self
.
_oid
=
'
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
'
# Decide whether to use non-temporary files
client
=
client
or
os
.
environ
.
get
(
'ZEO_CLIENT'
)
client
=
client
self
.
_cache
=
self
.
ClientCacheClass
(
storage
,
cache_size
,
client
=
client
,
var
=
var
)
...
...
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