# Path: grace/utils.py
# def get_path():
#     encoding = sys.getfilesystemencoding()
#     if we_are_frozen():
#         return os.path.dirname(sys.executable)
#     return os.path.dirname(__file__)
# 
# def write_json(string):
#     try:
#         return json.dumps(string)
#     except:
#         raise
# 
# Path: grace/error.py
# class MissingKeyError(Error):
#     pass
# 
# class WrongLoginCredentials(Error):
#     pass
# 
# class FileNotFoundError(Error):
#     pass
# 
# class RemoteServerError(Error):
#     pass


from builtins import input
from builtins import object
from .utils import get_path, write_json
from .error import MissingKeyError, WrongLoginCredentials, FileNotFoundError, RemoteServerError
from pkg_resources import resource_filename
import os
import requests
import getpass
    def _get_login_information(self):
        data = {}

        if self._username is None:
            self._username = input('Please provide the username for your upload server (or leave blank if none is required): ')

        if self._password is None:
            self._password = getpass.getpass('Please provide the password for your upload server (or leave blank if none is required): ')

        if self._username != '':
            data['username'] = self._username
        if self._password != '':
            data['password'] = self._password

        return data

    def _login(self):
        data = self._get_login_information()

        r = requests.post(self._login_url,
            data=write_json(data),
            headers={'Content-Type': 'application/json'},
            verify=self._verify_ssl
        )

        self._cookies = r.cookies

        self._login_response(r)

    def _login_response(self, r):

# Path: grace/utils.py
# def get_path():
#     encoding = sys.getfilesystemencoding()
#     if we_are_frozen():
#         return os.path.dirname(sys.executable)
#     return os.path.dirname(__file__)
# 
# def write_json(string):
#     try:
#         return json.dumps(string)
#     except:
#         raise
# 
# Path: grace/error.py
# class MissingKeyError(Error):
#     pass
# 
# class WrongLoginCredentials(Error):
#     pass
# 
# class FileNotFoundError(Error):
#     pass
# 
# class RemoteServerError(Error):
#     pass


# Path: grace/upload.py
from builtins import input
from builtins import object
from .utils import get_path, write_json
from .error import MissingKeyError, WrongLoginCredentials, FileNotFoundError, RemoteServerError
from pkg_resources import resource_filename
import os
import requests
import getpass

    def _get_login_information(self):
        data = {}

        if self._username is None:
            self._username = input('Please provide the username for your upload server (or leave blank if none is required): ')

        if self._password is None:
            self._password = getpass.getpass('Please provide the password for your upload server (or leave blank if none is required): ')

        if self._username != '':
            data['username'] = self._username
        if self._password != '':
            data['password'] = self._password

        return data

    def _login(self):
        data = self._get_login_information()

        r = requests.post(self._login_url,
            data=write_json(data),
            headers={'Content-Type': 'application/json'},
            verify=self._verify_ssl
        )

        self._cookies = r.cookies

        self._login_response(r)

    def _login_response(self, r):

        if r.status_code != 200: