# Path: ship/utils/utilfunctions.py
# def formatFloat(value, no_of_dps, ignore_empty_str=True):
# def checkFileType(file_path, ext):
# def isNumeric(s):
# def encodeStr(value):
# def isString(value):
# def isList(value):
# def arrayToString(self, str_array):
# def findSubstringInList(substr, the_list):
# def findMax(val1, val2):
# def fileExtensionWithoutPeriod(filepath, name_only=False):
# def findWholeWord(w):
# def convertRunOptionsToSEDict(options):
# def getSEResolvedFilename(filename, se_vals):
# def enum(*sequential, **named):
#     def __init__(self):
#     def isEmpty(self):
#     def enqueue(self, item):
#     def dequeue(self):
#     def size(self):
#     def __init__(self, max_size=-1):
#     def isEmpty(self):
#     def add(self, item):
#     def pop(self):
#     def peek(self):
#     def size(self):
# class FileQueue(object):
# class LoadStack(object):


import os
import logging
from ship.utils import utilfunctions as uf

from __future__ import unicode_literals



# logging references with a __name__ set to this module.
logger = logging.getLogger(__name__)


def getFile(file_path):
    """Text file reader.

    Reads a text file, appending each new line to a list.

    Args:
        filePath (str): File path for text file to load.

    Returns:
        List - contents of text file split by new lines.

    Raises:
        IOError: if problem in reading file.
        TypeError: if string not given for file_path
    """
    file_contents = []
    line = ""

    try:
        with open(file_path, 'rU') as f:
            for line in f:

# Path: ship/utils/utilfunctions.py
# def formatFloat(value, no_of_dps, ignore_empty_str=True):
# def checkFileType(file_path, ext):
# def isNumeric(s):
# def encodeStr(value):
# def isString(value):
# def isList(value):
# def arrayToString(self, str_array):
# def findSubstringInList(substr, the_list):
# def findMax(val1, val2):
# def fileExtensionWithoutPeriod(filepath, name_only=False):
# def findWholeWord(w):
# def convertRunOptionsToSEDict(options):
# def getSEResolvedFilename(filename, se_vals):
# def enum(*sequential, **named):
#     def __init__(self):
#     def isEmpty(self):
#     def enqueue(self, item):
#     def dequeue(self):
#     def size(self):
#     def __init__(self, max_size=-1):
#     def isEmpty(self):
#     def add(self, item):
#     def pop(self):
#     def peek(self):
#     def size(self):
# class FileQueue(object):
# class LoadStack(object):


# Path: ship/utils/filetools.py
import os
import logging
from ship.utils import utilfunctions as uf


from __future__ import unicode_literals



# logging references with a __name__ set to this module.
logger = logging.getLogger(__name__)


def getFile(file_path):
    """Text file reader.

    Reads a text file, appending each new line to a list.

    Args:
        filePath (str): File path for text file to load.

    Returns:
        List - contents of text file split by new lines.

    Raises:
        IOError: if problem in reading file.
        TypeError: if string not given for file_path
    """
    file_contents = []
    line = ""

    try:
        with open(file_path, 'rU') as f:
            for line in f:

                file_contents.append(uf.encodeStr(line))