old_contents: import glob
  import os
  import shutil
  from exporters.writers.filebase_base_writer import FilebaseBaseWriter
  
  
  class FSWriter(FilebaseBaseWriter):
      """
      Writes items to local file system files. It is a File Based writer, so it has filebase
      option available
  
          - filebase (str)
              Path to store the exported files
      """
  
      supported_options = {
  
      }
  
      def __init__(self, options, *args, **kwargs):
          super(FSWriter, self).__init__(options, *args, **kwargs)
          self.logger.info(
              'FSWriter has been initiated. Writing to: {}'.format(self.filebase))
  
      def _create_path_if_not_exist(self, path):
          """
          Creates a folders path if it doesn't exist
          """
          if not os.path.exists(path):
              os.makedirs(path)
  
      def get_file_suffix(self, path, prefix):
          """
          Gets a valid filename
          """
          try:
              number_of_files = len(glob.glob(os.path.join(path, prefix) + '*'))
          except:
              number_of_files = 0
          return '{0:04}'.format(number_of_files)
  
      def write(self, dump_path, group_key=None, file_name=None):
          if group_key is None:
              group_key = []
          filebase_path, file_name = self.create_filebase_name(group_key, file_name=file_name)
          destination = os.path.join(filebase_path, file_name)
          self._create_path_if_not_exist(filebase_path)
          shutil.copy(dump_path, destination)
          self.last_written_file = destination
          self.logger.info('Saved {}'.format(dump_path))
  
new_contents: import glob
  import os
  import shutil
  from exporters.writers.filebase_base_writer import FilebaseBaseWriter
  
  
  class FSWriter(FilebaseBaseWriter):
      """
      Writes items to local file system files. It is a File Based writer, so it has filebase
      option available
  
          - filebase (str)
              Path to store the exported files
      """
  
      supported_options = {
  
      }
  
      def __init__(self, options, *args, **kwargs):
          super(FSWriter, self).__init__(options, *args, **kwargs)
          self.logger.info(
              'FSWriter has been initiated. Writing to: {}'.format(self.filebase))
  
      def _create_path_if_not_exist(self, path):
          """
          Creates a folders path if it doesn't exist
          """
          if path and not os.path.exists(path):
              os.makedirs(path)
  
      def get_file_suffix(self, path, prefix):
          """
          Gets a valid filename
          """
          try:
              number_of_files = len(glob.glob(os.path.join(path, prefix) + '*'))
          except:
              number_of_files = 0
          return '{0:04}'.format(number_of_files)
  
      def write(self, dump_path, group_key=None, file_name=None):
          if group_key is None:
              group_key = []
          filebase_path, file_name = self.create_filebase_name(group_key, file_name=file_name)
          destination = os.path.join(filebase_path, file_name)
          self._create_path_if_not_exist(filebase_path)
          shutil.copy(dump_path, destination)
          self.last_written_file = destination
          self.logger.info('Saved {}'.format(dump_path))
  
subject: Fix empty path in create path method