forked from couchbase/couchbase-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cbtransfer
executable file
·33 lines (28 loc) · 918 Bytes
/
cbtransfer
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env python
# -*-python-*-
"""
Data transfer tool for Couchbase.
"""
import os
import platform
import sys
try:
import pump_sfd
except ImportError:
if platform.system() == "Windows":
p = "PATH"
else:
p = "LD_LIBRARY_PATH"
for x in sys.argv:
if x.startswith("couchstore-files://"):
sys.exit("error: could not import couchstore module"
"; directly accessing local couchstore-files:// will not work"
"; please check your PYTHONPATH and %s environment variables" % (p))
import pump_transfer
if __name__ == '__main__':
if platform.system() == 'Windows':
mydir = os.path.dirname(sys.argv[0])
bin_dir = os.path.join(mydir, '..')
path = [mydir, bin_dir, os.environ['PATH']]
os.environ['PATH'] = ';'.join(path)
pump_transfer.exit_handler(pump_transfer.Transfer().main(sys.argv))