old_contents: #!/usr/bin/env python3.5
  
  import os
  import logging
  from datetime import datetime as dt
  
  
  def timestamp():
      return dt.now().strftime('%m-%d_%H:%M:%S')
  
  def timestamp_file(filepath, ts, ext="", is_dir=False):
      filepath += "_{}".format(ts)
      if ext:
          filepath += ".{}".format(ext)
      if is_dir:
          os.mkdir(filepath)
      return filepath
      
  
  def setup_logging(dir, filename):
      filepath = os.path.join(dir, filename)
      ts = timestamp()
      ts_filepath = timestamp_file(filepath, ts, ext="log")
  
      logging.basicConfig(level=logging.INFO,
                          filename=ts_filepath,
                          format='%(asctime)s %(message)s', datefmt='%H:%M:%S')
      logger = logging.getLogger(filename)
  
      symlink_cur_to_latest(filepath, ts, ext="log")
  
      return logger
  
  
  def symlink_cur_to_latest(filepath, ts, ext=""):
      """Makes a symlink(file/folder)name-latest(.ext) point to
      (file/folder)name-timestamp(.ext)"""
      current = timestamp_file(filepath, ts, ext)
      latest = filepath + "-latest"
      if ext:
          latest += ".{}".format(ext)
      try:
          os.remove(latest)
      except OSError:
          pass
      finally:
          os.symlink(current, latest)
  
new_contents: #!/usr/bin/env python3.5
  
  import os
  import logging
  from datetime import datetime as dt
  import datetime
  
  
  def get_lookback(lookback_length):
      """Take a string from the user and return a 
      datetime.timedelta object
      """
  
      time_units = {'weeks': 0, 'days': 0, 'hours': 0} 
      time_shortunits = [x[0] for x in time_units.keys()]
      lookback_unit = lookback_length[-1:]
      lookback_value = lookback_length[:-1]
  
      if not str.isalpha(lookback_unit):
          raise TypeError("No unit found")
      elif lookback_unit not in time_shortunits: 
          raise TypeError("That unit is not suppported")
  
      for unit in list(time_units.keys()):
          # if the last letter of lookback_length is supported
          if unit[0] == lookback_unit:
              time_units[unit] = int(lookback_value)
  
      lookback_timedelta = datetime.timedelta(weeks=time_units['weeks'],
                                              days=time_units['days'],
                                              hours=time_units['hours'])
      return lookback_timedelta
  
  
  def timestamp():
      return dt.now().strftime('%m-%d_%H:%M:%S')
  
  def timestamp_file(filepath, ts, ext="", is_dir=False):
      filepath += "_{}".format(ts)
      if ext:
          filepath += ".{}".format(ext)
      if is_dir:
          os.mkdir(filepath)
      return filepath
      
  
  def setup_logging(dir, filename):
      filepath = os.path.join(dir, filename)
      ts = timestamp()
      ts_filepath = timestamp_file(filepath, ts, ext="log")
  
      logging.basicConfig(level=logging.INFO,
                          filename=ts_filepath,
                          format='%(asctime)s %(message)s', datefmt='%H:%M:%S')
      logger = logging.getLogger(filename)
  
      symlink_cur_to_latest(filepath, ts, ext="log")
  
      return logger
  
  
  def symlink_cur_to_latest(filepath, ts, ext=""):
      """Makes a symlink(file/folder)name-latest(.ext) point to
      (file/folder)name-timestamp(.ext)"""
      current = timestamp_file(filepath, ts, ext)
      latest = filepath + "-latest"
      if ext:
          latest += ".{}".format(ext)
      try:
          os.remove(latest)
      except OSError:
          pass
      finally:
          os.symlink(current, latest)
  
subject: Add function for processing datetime objects from new config options