mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
tox (and travis ci?) were hiding the fact that the gdbm dependency was the problem
This commit is contained in:
parent
b6774da603
commit
e9e152ca7d
@ -6,6 +6,9 @@ python:
|
||||
- "2.7"
|
||||
- "3.2"
|
||||
- "3.3"
|
||||
before_install:
|
||||
- sudo apt-get update
|
||||
- sudo apt-get -y install python-gdbm python3-gdbm
|
||||
install: python setup.py install
|
||||
script: python setup.py test
|
||||
|
||||
|
@ -8,19 +8,31 @@ module can read. Included with warcprox because it's useful for inspecting a
|
||||
deduplication database or a playback index database, but it is a generic tool.
|
||||
"""
|
||||
|
||||
import anydbm
|
||||
try:
|
||||
import dbm
|
||||
whichdb = dbm.whichdb
|
||||
except:
|
||||
import anydbm
|
||||
dbm = anydbm
|
||||
from whichdb import whichdb
|
||||
|
||||
import sys
|
||||
import os.path
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) != 2:
|
||||
sys.stderr.write("usage: {} DBM_FILE\n".format(sys.argv[0]))
|
||||
exit(1)
|
||||
|
||||
# import whichdb
|
||||
# which = whichdb.whichdb(sys.argv[1])
|
||||
# print('{} is a {} db'.format(sys.argv[1], which))
|
||||
if not os.path.exists(sys.argv[1]):
|
||||
sys.stderr.write('No such file {}\n\n'.format(sys.argv[1]))
|
||||
sys.stderr.write("usage: {} DBM_FILE\n".format(sys.argv[0]))
|
||||
exit(1)
|
||||
|
||||
db = anydbm.open(sys.argv[1])
|
||||
which = whichdb(sys.argv[1])
|
||||
print('{} is a {} db'.format(sys.argv[1], which))
|
||||
|
||||
db = dbm.open(sys.argv[1], 'r')
|
||||
|
||||
for key in db.keys():
|
||||
print("{}:{}".format(key, db[key]))
|
||||
|
2
setup.py
2
setup.py
@ -12,7 +12,7 @@ setuptools.setup(name='warcprox',
|
||||
long_description=open('README.rst').read(),
|
||||
license='GPL',
|
||||
packages=['warcprox'],
|
||||
install_requires=['pyopenssl', 'warctools>=4.8.3'], # gdbm/dbhash?
|
||||
install_requires=['gdbm', 'pyopenssl', 'warctools>=4.8.3'],
|
||||
dependency_links=['git+https://github.com/nlevitt/warctools.git@python3#egg=warctools-4.8.3'],
|
||||
tests_require=['requests>=2.0.1'], # >=2.0.1 for https://github.com/kennethreitz/requests/pull/1636
|
||||
test_suite='warcprox.tests',
|
||||
|
Loading…
x
Reference in New Issue
Block a user