# Path: anchorhub/lib/filetolist.py
# class FileToList(object):
#     """
#     FileToList is a helper class used to import text files and turn them into
#     lists, with each index in the list representing a single line from the
#     text file.
#     """
#     @staticmethod
#     def to_list(file_path):
#         """
#         Static method. Takes in a file path, and outputs a list of stings.
#         Each element in the list corresponds to a line in the file.
#         :param file_path: string file path
#         :return: A list of strings, with elements in the list corresponding
#         to lines in the file pointed to in file_path
#         """
#         l = []
#         f = open(file_path, 'r')
#         for line in f:
#             l.append(line)
#         f.close()
#         return l
# 
# Path: anchorhub/util/stripprefix.py
# def strip_prefix(string, strip):
#     """
#     Strips a prefix from a string, if the string starts with the prefix.
# 
#     :param string: String that should have its prefix removed
#     :param strip: Prefix to be removed
#     :return: string with the prefix removed if it has the prefix, or else it
#         just returns the original string
#     """
#     import re
#     strip_esc = re.escape(strip)
#     if re.match(strip_esc, string):
#         return string[len(strip):]
#     else:
#         return string


import os
import os.path
import sys
from abc import ABCMeta, abstractmethod
from anchorhub.lib.filetolist import FileToList
from anchorhub.util.stripprefix import strip_prefix
        """
        self._strategies = strategies  # List of concrete WriterStrategy objs
        self._switches = switches  # List of ArmedTestSwitch objects
        self._counter = []
        for s in self._strategies:
            self._counter.append([0, s.get_label()])

    def write(self, file_paths, anchors, opts):
        """

        :param file_paths:
        :param anchors:
        :param opts:
        :return: A list of numbers, counting the number of times each
            strategy was used
        """
        for file_path in file_paths:
            self.write_single_file(file_path, anchors, opts)
            self._reset_switches()
        return self._counter

    def write_single_file(self, file_path, anchors, opts):
        """

        :param file_path:
        :param anchors:
        :param opts:
        :return: A list of numbers, counting the number of times each
            strategy was used
        """

# Path: anchorhub/lib/filetolist.py
# class FileToList(object):
#     """
#     FileToList is a helper class used to import text files and turn them into
#     lists, with each index in the list representing a single line from the
#     text file.
#     """
#     @staticmethod
#     def to_list(file_path):
#         """
#         Static method. Takes in a file path, and outputs a list of stings.
#         Each element in the list corresponds to a line in the file.
#         :param file_path: string file path
#         :return: A list of strings, with elements in the list corresponding
#         to lines in the file pointed to in file_path
#         """
#         l = []
#         f = open(file_path, 'r')
#         for line in f:
#             l.append(line)
#         f.close()
#         return l
# 
# Path: anchorhub/util/stripprefix.py
# def strip_prefix(string, strip):
#     """
#     Strips a prefix from a string, if the string starts with the prefix.
# 
#     :param string: String that should have its prefix removed
#     :param strip: Prefix to be removed
#     :return: string with the prefix removed if it has the prefix, or else it
#         just returns the original string
#     """
#     import re
#     strip_esc = re.escape(strip)
#     if re.match(strip_esc, string):
#         return string[len(strip):]
#     else:
#         return string


# Path: anchorhub/writer.py
import os
import os.path
import sys
from abc import ABCMeta, abstractmethod
from anchorhub.lib.filetolist import FileToList
from anchorhub.util.stripprefix import strip_prefix

        """
        self._strategies = strategies  # List of concrete WriterStrategy objs
        self._switches = switches  # List of ArmedTestSwitch objects
        self._counter = []
        for s in self._strategies:
            self._counter.append([0, s.get_label()])

    def write(self, file_paths, anchors, opts):
        """

        :param file_paths:
        :param anchors:
        :param opts:
        :return: A list of numbers, counting the number of times each
            strategy was used
        """
        for file_path in file_paths:
            self.write_single_file(file_path, anchors, opts)
            self._reset_switches()
        return self._counter

    def write_single_file(self, file_path, anchors, opts):
        """

        :param file_path:
        :param anchors:
        :param opts:
        :return: A list of numbers, counting the number of times each
            strategy was used
        """

        lines = FileToList.to_list(file_path)