# Path: apasvo/gui/views/generated/ui_savedialog.py
# class Ui_SaveDialog(object):
#     def setupUi(self, SaveDialog):
#     def retranslateUi(self, SaveDialog):
# 
# Path: apasvo/utils/futils.py
# def istextfile(filename, blocksize=512):
# def is_little_endian():
# def read_in_chunks(file_object, chunk_size=1024):
# def read_txt_in_chunks(file_object, n=1024, comments='#'):
# def getSize(f):
# def get_delimiter(fileobject, lines=16):
# def get_sample_rate(filename, max_header_lines=64, comments='#'):
# def copytree(src, dst, symlinks=False, ignore=None):
# 
# Path: apasvo/utils/formats/rawfile.py
# class RawFile(object):
# class BinFile(RawFile):
# class TextFile(RawFile):
#     def __init__(self):
#     def read(self):
#     def read_in_blocks(self, block_size):
#     def write(self, array):
#     def __init__(self, filename, dtype='float64', byteorder='native'):
#     def read(self, **kwargs):
#     def read_in_blocks(self, block_size=1024):
#     def write(self, array, **kwargs):
#     def __init__(self, filename, dtype='float64', byteorder='native'):
#     def read(self, **kwargs):
#     def read_in_blocks(self, block_size=1024):
#     def write(self, array, **kwargs):
# def get_file_handler(filename, fmt='', dtype='float64', byteorder='native', **kwargs):


from PySide import QtGui
from apasvo.gui.views.generated import ui_savedialog
from apasvo.utils import futils
from apasvo.utils.formats import rawfile
    signal, i.e.:
        Format: Binary or text format.
        Data-type: PCM 16, PCM 32, PCM 64, Float16, Float32 or Float64,
        Endianness: Little-endian or big-endian.

    Attributes:
        fmt: Default file format. Available values are 'binary' and 'text'.
            Default: 'binary'.
        dtype: Default datatype. Available values are 'int16', 'int32', 'int64',
            'float16', 'float32' and 'float64'.
            Default: 'float64'.
        byteorder: Default endianness. Available values are 'little-endian',
            'big-endian' and 'native'.
            Default: 'native'.
    """

    def __init__(self, parent, fmt=None, dtype='float64', byteorder='native'):
        fmt = fmt.title() if fmt is not None else DEFAULT_FORMAT
        super(SaveDialog, self).__init__(parent)
        self.setupUi(self)
        self.FileFormatComboBox.currentIndexChanged.connect(self.on_format_change)
        # init comboboxes
        self.FileFormatComboBox.addItems(FORMATS_LABELS)
        self.DataTypeComboBox.addItems(DTYPES_LABELS)
        self.ByteOrderComboBox.addItems(BYTEORDERS_LABELS)
        # Set defaults
        self.FileFormatComboBox.setCurrentIndex(FORMATS_LABELS.index(fmt))
        self.DataTypeComboBox.setCurrentIndex(DTYPES.index(dtype))
        # Detect endianness if 'native' byteorder is selected
        if byteorder == rawfile.byteorder_native:

# Path: apasvo/gui/views/generated/ui_savedialog.py
# class Ui_SaveDialog(object):
#     def setupUi(self, SaveDialog):
#     def retranslateUi(self, SaveDialog):
# 
# Path: apasvo/utils/futils.py
# def istextfile(filename, blocksize=512):
# def is_little_endian():
# def read_in_chunks(file_object, chunk_size=1024):
# def read_txt_in_chunks(file_object, n=1024, comments='#'):
# def getSize(f):
# def get_delimiter(fileobject, lines=16):
# def get_sample_rate(filename, max_header_lines=64, comments='#'):
# def copytree(src, dst, symlinks=False, ignore=None):
# 
# Path: apasvo/utils/formats/rawfile.py
# class RawFile(object):
# class BinFile(RawFile):
# class TextFile(RawFile):
#     def __init__(self):
#     def read(self):
#     def read_in_blocks(self, block_size):
#     def write(self, array):
#     def __init__(self, filename, dtype='float64', byteorder='native'):
#     def read(self, **kwargs):
#     def read_in_blocks(self, block_size=1024):
#     def write(self, array, **kwargs):
#     def __init__(self, filename, dtype='float64', byteorder='native'):
#     def read(self, **kwargs):
#     def read_in_blocks(self, block_size=1024):
#     def write(self, array, **kwargs):
# def get_file_handler(filename, fmt='', dtype='float64', byteorder='native', **kwargs):


# Path: apasvo/gui/views/savedialog.py
from PySide import QtGui
from apasvo.gui.views.generated import ui_savedialog
from apasvo.utils import futils
from apasvo.utils.formats import rawfile

    signal, i.e.:
        Format: Binary or text format.
        Data-type: PCM 16, PCM 32, PCM 64, Float16, Float32 or Float64,
        Endianness: Little-endian or big-endian.

    Attributes:
        fmt: Default file format. Available values are 'binary' and 'text'.
            Default: 'binary'.
        dtype: Default datatype. Available values are 'int16', 'int32', 'int64',
            'float16', 'float32' and 'float64'.
            Default: 'float64'.
        byteorder: Default endianness. Available values are 'little-endian',
            'big-endian' and 'native'.
            Default: 'native'.
    """

    def __init__(self, parent, fmt=None, dtype='float64', byteorder='native'):
        fmt = fmt.title() if fmt is not None else DEFAULT_FORMAT
        super(SaveDialog, self).__init__(parent)
        self.setupUi(self)
        self.FileFormatComboBox.currentIndexChanged.connect(self.on_format_change)
        # init comboboxes
        self.FileFormatComboBox.addItems(FORMATS_LABELS)
        self.DataTypeComboBox.addItems(DTYPES_LABELS)
        self.ByteOrderComboBox.addItems(BYTEORDERS_LABELS)
        # Set defaults
        self.FileFormatComboBox.setCurrentIndex(FORMATS_LABELS.index(fmt))
        self.DataTypeComboBox.setCurrentIndex(DTYPES.index(dtype))
        # Detect endianness if 'native' byteorder is selected
        if byteorder == rawfile.byteorder_native:

            if futils.is_little_endian():