Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
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)
0
Konular (issue)
0
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ç
Batuhan Osman TASKAYA
cpython
Commits
48f9c6df
Kaydet (Commit)
48f9c6df
authored
Eki 28, 2003
tarafından
Skip Montanaro
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
allow dump/load of gdbm files
üst
9c8f7eaf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
6 deletions
+28
-6
db2pickle.py
Tools/scripts/db2pickle.py
+14
-3
pickle2db.py
Tools/scripts/pickle2db.py
+14
-3
No files found.
Tools/scripts/db2pickle.py
Dosyayı görüntüle @
48f9c6df
#!/usr/bin/env python
"""
Synopsis:
%(prog)
s [-h|-
b|-r
] dbfile [ picklefile ]
Synopsis:
%(prog)
s [-h|-
g|-b|-r|-a
] dbfile [ picklefile ]
Convert the database file given on the command line to a pickle
representation. The optional flags indicate the type of the database (hash,
...
...
@@ -20,6 +20,10 @@ try:
import
dbm
except
ImportError
:
dbm
=
None
try
:
import
gdbm
except
ImportError
:
gdbm
=
None
try
:
import
anydbm
except
ImportError
:
...
...
@@ -37,8 +41,9 @@ def usage():
def
main
(
args
):
try
:
opts
,
args
=
getopt
.
getopt
(
args
,
"hbrda"
,
[
"hash"
,
"btree"
,
"recno"
,
"dbm"
,
"anydbm"
])
opts
,
args
=
getopt
.
getopt
(
args
,
"hbrdag"
,
[
"hash"
,
"btree"
,
"recno"
,
"dbm"
,
"gdbm"
,
"anydbm"
])
except
getopt
.
error
:
usage
()
return
1
...
...
@@ -83,6 +88,12 @@ def main(args):
except
AttributeError
:
sys
.
stderr
.
write
(
"anydbm module unavailable.
\n
"
)
return
1
elif
opt
in
(
"-g"
,
"--gdbm"
):
try
:
dbopen
=
gdbm
.
open
except
AttributeError
:
sys
.
stderr
.
write
(
"gdbm module unavailable.
\n
"
)
return
1
elif
opt
in
(
"-d"
,
"--dbm"
):
try
:
dbopen
=
dbm
.
open
...
...
Tools/scripts/pickle2db.py
Dosyayı görüntüle @
48f9c6df
#!/usr/bin/env python
"""
Synopsis:
%(prog)
s [-h|-b|-r|-a|-d] dbfile [ picklefile ]
Synopsis:
%(prog)
s [-h|-b|-
g|-
r|-a|-d] dbfile [ picklefile ]
Read the given picklefile as a series of key/value pairs and write to a new
database. If the database already exists, any contents are deleted. The
...
...
@@ -24,6 +24,10 @@ try:
import
dbm
except
ImportError
:
dbm
=
None
try
:
import
gdbm
except
ImportError
:
gdbm
=
None
try
:
import
anydbm
except
ImportError
:
...
...
@@ -41,8 +45,9 @@ def usage():
def
main
(
args
):
try
:
opts
,
args
=
getopt
.
getopt
(
args
,
"hbrda"
,
[
"hash"
,
"btree"
,
"recno"
,
"dbm"
,
"anydbm"
])
opts
,
args
=
getopt
.
getopt
(
args
,
"hbrdag"
,
[
"hash"
,
"btree"
,
"recno"
,
"dbm"
,
"anydbm"
,
"gdbm"
])
except
getopt
.
error
:
usage
()
return
1
...
...
@@ -87,6 +92,12 @@ def main(args):
except
AttributeError
:
sys
.
stderr
.
write
(
"anydbm module unavailable.
\n
"
)
return
1
elif
opt
in
(
"-g"
,
"--gdbm"
):
try
:
dbopen
=
gdbm
.
open
except
AttributeError
:
sys
.
stderr
.
write
(
"gdbm module unavailable.
\n
"
)
return
1
elif
opt
in
(
"-d"
,
"--dbm"
):
try
:
dbopen
=
dbm
.
open
...
...
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