Most of this is now in doom_base.py, which stores wad/map/name, exposes them as properties, and also takes care of most common tasks needed for building command lines and such.
17 lines
539 B
Python
17 lines
539 B
Python
import boto3
|
|
import dcc.config
|
|
import dcc.doom_base
|
|
|
|
class Put(dcc.doom_base.WadMap):
|
|
def get_parser(self, prog_name):
|
|
parser = super().get_parser(prog_name)
|
|
return parser
|
|
|
|
# TODO: accept configuration for bucket name
|
|
def take_action(self, parsed_args):
|
|
s3_client = boto3.client('s3')
|
|
demo = self.demo_in_path()
|
|
bucket = self.target_bucket()
|
|
print("Uploading {} to bucket {}.".format(demo, bucket))
|
|
s3_client.upload_file(demo, 'yrriban', bucket,
|
|
ExtraArgs={'ContentType': 'binary/octet-stream', 'ACL': 'public-read'})
|