Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
I
inary
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
1
Konular (issue)
1
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
SulinOS
inary
Commits
4b05b282
Kaydet (Commit)
4b05b282
authored
May 30, 2006
tarafından
Eray Özkural
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
* fix: do fail when we cannot write in read-mode ops
üst
b4864525
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
lockeddbshelve.py
pisi/lockeddbshelve.py
+15
-15
No files found.
pisi/lockeddbshelve.py
Dosyayı görüntüle @
4b05b282
...
...
@@ -83,22 +83,22 @@ def init_dbenv(write=False, writeversion=False):
check_dbversion
(
'filesdbversion'
,
pisi
.
__filesdbversion__
,
write
=
write
,
update
=
writeversion
)
else
:
raise
Error
(
_
(
'Cannot attain read access to database environment'
))
if
write
and
os
.
access
(
pisi
.
context
.
config
.
db_dir
(),
os
.
W_OK
):
lock_dbenv
()
ctx
.
dbenv
=
dbobj
.
DBEnv
()
flags
=
(
db
.
DB_INIT_MPOOL
|
# cache
db
.
DB_INIT_TXN
|
# transaction subsystem
db
.
DB_INIT_LOG
|
# logging subsystem
db
.
DB_RECOVER
|
# run normal recovery
db
.
DB_CREATE
)
# allow db to create files
ctx
.
dbenv
.
set_cachesize
(
0
,
4
*
1024
*
1024
)
ctx
.
dbenv
.
open
(
pisi
.
context
.
config
.
db_dir
(),
flags
)
ctx
.
dbenv
.
set_flags
(
db
.
DB_LOG_AUTOREMOVE
,
1
)
# clear inactive logs automatically
if
write
:
if
os
.
access
(
pisi
.
context
.
config
.
db_dir
(),
os
.
W_OK
):
lock_dbenv
()
ctx
.
dbenv
=
dbobj
.
DBEnv
()
flags
=
(
db
.
DB_INIT_MPOOL
|
# cache
db
.
DB_INIT_TXN
|
# transaction subsystem
db
.
DB_INIT_LOG
|
# logging subsystem
db
.
DB_RECOVER
|
# run normal recovery
db
.
DB_CREATE
)
# allow db to create files
ctx
.
dbenv
.
set_cachesize
(
0
,
4
*
1024
*
1024
)
ctx
.
dbenv
.
open
(
pisi
.
context
.
config
.
db_dir
(),
flags
)
ctx
.
dbenv
.
set_flags
(
db
.
DB_LOG_AUTOREMOVE
,
1
)
# clear inactive logs automatically
else
:
raise
Error
(
_
(
"Cannot write to PISI database."
))
else
:
# Warn if not on purpose
if
write
:
ctx
.
ui
.
warning
(
_
(
"Opening PISI database in read-only mode. Operations that require write access will fail."
))
ctx
.
dbenv
=
None
ctx
.
dbenv
=
None
# read-only access to database
#def open(filename, flags='r', mode = 0644, filetype = db.DB_BTREE):
# db = LockedDBShelf(None, mode, filetype, None, True)
...
...
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