-
Notifications
You must be signed in to change notification settings - Fork 3
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
Added ShardArchiver.py utility: #2
base: master
Are you sure you want to change the base?
Added ShardArchiver.py utility: #2
Conversation
ShardArchiver is a command line utility that creates lz4 compressed tar archives from complete shards and optionally transfers them to a remote server.
df7194c
to
45e3012
Compare
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
|
||
# Creates lz4 compressed tar archives from complete | ||
# shards and optinally SCP transfers to a destination |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would make a good module level doc string (i.e. just make it a string: '''Create lz4 compressed archives...
# shards and optinally SCP transfers to a destination | ||
|
||
import lz4.frame | ||
import os |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This import is unused
|
||
|
||
def create_lz4(source_file, output_path): | ||
src = open(source_file, mode='rb') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd use a with
statement here for src
f.write(piece) | ||
|
||
|
||
def process(args): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd give the arguments individual names rather than just passing in args
. If the argument is optional (as with indenty_file, username, host, and host_directory), just default them to None
.
ShardArchiver is a command line utility that creates lz4
compressed tar archives from complete shards and optionally
transfers them to a remote server.