# Path: onecodex/exceptions.py
# class OneCodexException(Exception):
#     pass
# 
# class UploadException(Exception):
#     """An exception for when things go wrong with uploading."""
# 
#     pass


import os
import re
import logging
from unidecode import unidecode
from onecodex.exceptions import OneCodexException, UploadException
    def seek(self, loc):
        """Seek to a position in the file.

        Notes
        -----
        This is called if an upload fails and must be retried.
        """
        assert loc == 0

        # rewind progress bar
        if self.progressbar:
            self.progressbar.update(-self._fp.tell())

        self._fp.seek(loc)

    def close(self):
        self._fp.close()

    def enforce_ascii_filename(self, coerce_ascii):
        """Update the filename to be ASCII. Raises an exception if `coerce_ascii` is `False` and the filename is not ASCII."""
        self.filename = _check_for_ascii_filename(self.filename, coerce_ascii)


class PairedEndFiles(object):
    def __init__(self, files, progressbar=None):
        if len(files) != 2:
            raise OneCodexException("Paired files uploading can only take 2 files")

        for f in files:
            if get_fastx_format(f) != "fastq":

# Path: onecodex/exceptions.py
# class OneCodexException(Exception):
#     pass
# 
# class UploadException(Exception):
#     """An exception for when things go wrong with uploading."""
# 
#     pass


# Path: onecodex/lib/files.py
import os
import re
import logging
from unidecode import unidecode
from onecodex.exceptions import OneCodexException, UploadException

    def seek(self, loc):
        """Seek to a position in the file.

        Notes
        -----
        This is called if an upload fails and must be retried.
        """
        assert loc == 0

        # rewind progress bar
        if self.progressbar:
            self.progressbar.update(-self._fp.tell())

        self._fp.seek(loc)

    def close(self):
        self._fp.close()

    def enforce_ascii_filename(self, coerce_ascii):
        """Update the filename to be ASCII. Raises an exception if `coerce_ascii` is `False` and the filename is not ASCII."""
        self.filename = _check_for_ascii_filename(self.filename, coerce_ascii)


class PairedEndFiles(object):
    def __init__(self, files, progressbar=None):
        if len(files) != 2:
            raise OneCodexException("Paired files uploading can only take 2 files")

        for f in files:
            if get_fastx_format(f) != "fastq":

                raise OneCodexException("Interleaving FASTA files is currently unsupported")