-
Notifications
You must be signed in to change notification settings - Fork 29
download and load a complete stackexchange project #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
db298e6
fc4dc26
2b39ef6
22b0de5
d9e1735
588b740
7bede10
dc79fda
e0be1b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -394,16 +394,23 @@ def moveTableToSchema(table, schemaName, dbConnectionParam): | |
# load a project | ||
elif args.so_project: | ||
import libarchive | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you verify that you are using I will add this to the README. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am indeed using libarchive-c (in version 2.8). |
||
import tempfile | ||
|
||
filepath = None | ||
if args.file: | ||
filepath = args.file | ||
url = filepath | ||
else: | ||
# download the 7z archive in /tmp | ||
# download the 7z archive in tempdir | ||
file_name = args.so_project + '.stackexchange.com.7z' | ||
url = '{0}/{1}'.format(args.archive_url, file_name) | ||
filepath = '/tmp/'+file_name | ||
six.print_('Downloading the archive, please be patient ...') | ||
temp_dir = tempfile.gettempdir() | ||
if temp_dir == 'None': | ||
musically-ut marked this conversation as resolved.
Show resolved
Hide resolved
|
||
six.print_('WARNING: Could not find temporary directory. Use current directory instead.') | ||
temp_dir = os.getcwd() | ||
filepath = os.path.join(temp_dir, file_name) | ||
six.print_('Downloading the archive in {0}'.format(filepath)) | ||
six.print_('please be patient ...') | ||
try: | ||
six.moves.urllib.request.urlretrieve(url, filepath, show_progress) | ||
except Exception as e: | ||
|
Uh oh!
There was an error while loading. Please reload this page.