def findBackups(self, view):
    fn = view.fileName()
    self.currentFile = fn

    f, ext = os.path.splitext(os.path.split(fn)[1])        
    self.backupPath = backups.backupFilePath(view, just_dir=True)
    
    dirListing = os.listdir(self.backupPath)
    
    date = "-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}"
    pattern = "%s%s%s" % (f, date, ext)
    matcher = re.compile(pattern)
    
    self.foundBackupFiles = \
        filter(lambda x: matcher.match(x), dirListing)

    self.index = len(self.foundBackupFiles)-1
  def onPostSave(self, view):
    """When a file is saved, put a copy of the file into the 
    backup directory"""

    buffer_file_name = view.fileName()
    
    # if buffer_file_name.endswith('.lnk'): return
    newname = backups.backupFilePath(view)      
    if newname == None:
      return

    backup_dir, file_to_write = os.path.split(newname)

    # make sure that we have a directory to write into
    if (os.access(backup_dir, os.F_OK) == False):
      os.makedirs(backup_dir)

    backups.log("backing up to " + newname)
    shutil.copy(buffer_file_name, newname)