#!/usr/bin/env python3.4

from client import client, ss_config
import argparse

user_config = ss_config.load_or_create_config()

parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(dest='command')

parser_put_for = subparsers.add_parser('put-for')
parser_put_for.add_argument('user_name')
parser_put_for.add_argument('file_name')

parser_get_from = subparsers.add_parser('get-from')
parser_get_from.add_argument('user_name')

parser_register = subparsers.add_parser('register')
parser_register.add_argument('user_name')

parser_get = subparsers.add_parser('get')
parser_put = subparsers.add_parser('put')
parser_put.add_argument('file_name')

args = parser.parse_args()

if 'user_name' not in user_config and args.command != "register":
    print("You have not registered with the server yet.")
    exit(1)

if args.command == "put-for":
    client.put_for(user_config, args.user_name, args.file_name)
elif args.command == "get-from":
    client.get_from(user_config, args.user_name)
elif args.command == "register":
    client.register(user_config, args.user_name)
elif args.command == "get":
    client.get(user_config)
elif args.command == "put":
    client.put(user_config, args.file_name)

acc17552144aea01dd3f9406656420c591611276
<mask token>

<mask token>
parser_put_for.add_argument('user_name')
parser_put_for.add_argument('file_name')
<mask token>
parser_get_from.add_argument('user_name')
<mask token>
parser_register.add_argument('user_name')
<mask token>
parser_put.add_argument('file_name')
<mask token>
if 'user_name' not in user_config and args.command != 'register':
    print('You have not registered with the server yet.')
    exit(1)
if args.command == 'put-for':
    client.put_for(user_config, args.user_name, args.file_name)
elif args.command == 'get-from':
    client.get_from(user_config, args.user_name)
elif args.command == 'register':
    client.register(user_config, args.user_name)
elif args.command == 'get':
    client.get(user_config)
elif args.command == 'put':
    client.put(user_config, args.file_name)

<mask token>
user_config = ss_config.load_or_create_config()
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(dest='command')
parser_put_for = subparsers.add_parser('put-for')
parser_put_for.add_argument('user_name')
parser_put_for.add_argument('file_name')
parser_get_from = subparsers.add_parser('get-from')
parser_get_from.add_argument('user_name')
parser_register = subparsers.add_parser('register')
parser_register.add_argument('user_name')
parser_get = subparsers.add_parser('get')
parser_put = subparsers.add_parser('put')
parser_put.add_argument('file_name')
args = parser.parse_args()
if 'user_name' not in user_config and args.command != 'register':
    print('You have not registered with the server yet.')
    exit(1)
if args.command == 'put-for':
    client.put_for(user_config, args.user_name, args.file_name)
elif args.command == 'get-from':
    client.get_from(user_config, args.user_name)
elif args.command == 'register':
    client.register(user_config, args.user_name)
elif args.command == 'get':
    client.get(user_config)
elif args.command == 'put':
    client.put(user_config, args.file_name)

from client import client, ss_config
import argparse
user_config = ss_config.load_or_create_config()
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(dest='command')
parser_put_for = subparsers.add_parser('put-for')
parser_put_for.add_argument('user_name')
parser_put_for.add_argument('file_name')
parser_get_from = subparsers.add_parser('get-from')
parser_get_from.add_argument('user_name')
parser_register = subparsers.add_parser('register')
parser_register.add_argument('user_name')
parser_get = subparsers.add_parser('get')
parser_put = subparsers.add_parser('put')
parser_put.add_argument('file_name')
args = parser.parse_args()
if 'user_name' not in user_config and args.command != 'register':
    print('You have not registered with the server yet.')
    exit(1)
if args.command == 'put-for':
    client.put_for(user_config, args.user_name, args.file_name)
elif args.command == 'get-from':
    client.get_from(user_config, args.user_name)
elif args.command == 'register':
    client.register(user_config, args.user_name)
elif args.command == 'get':
    client.get(user_config)
elif args.command == 'put':
    client.put(user_config, args.file_name)

#!/usr/bin/env python3.4

from client import client, ss_config
import argparse

user_config = ss_config.load_or_create_config()

parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(dest='command')

parser_put_for = subparsers.add_parser('put-for')
parser_put_for.add_argument('user_name')
parser_put_for.add_argument('file_name')

parser_get_from = subparsers.add_parser('get-from')
parser_get_from.add_argument('user_name')

parser_register = subparsers.add_parser('register')
parser_register.add_argument('user_name')

parser_get = subparsers.add_parser('get')
parser_put = subparsers.add_parser('put')
parser_put.add_argument('file_name')

args = parser.parse_args()

if 'user_name' not in user_config and args.command != "register":
    print("You have not registered with the server yet.")
    exit(1)

if args.command == "put-for":
    client.put_for(user_config, args.user_name, args.file_name)
elif args.command == "get-from":
    client.get_from(user_config, args.user_name)
elif args.command == "register":
    client.register(user_config, args.user_name)
elif args.command == "get":
    client.get(user_config)
elif args.command == "put":
    client.put(user_config, args.file_name)
