Back to my blog Back to my projects

Scripts

Changeset 93cd0a4


Ignore:
Timestamp:
02/24/12 09:28:21 (16 months ago)
Author:
Aurélien Bompard <aurelien@…>
Branches:
master
Children:
09c31f2
Parents:
d949443
git-author:
Aurélien Bompard <aurelien@…> (02/24/12 09:28:21)
git-committer:
Aurélien Bompard <aurelien@…> (02/24/12 09:28:21)
Message:

rss-mirror: add an option to keep downloaded pages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rss-mirror.py

    rd949443 r93cd0a4  
    422422 
    423423 
    424     def cleanup(self): 
     424    def remove_expired(self): 
    425425        """ 
    426426        Remove mirrored pages which are not in the feed anymore (probably 
     
    434434            if not config.getboolean("DEFAULT", "debug"): 
    435435                shutil.rmtree(os.path.join(self.path, dirname)) 
     436 
     437    def cleanup(self): 
    436438        self.lowercase_dirs() 
    437439        if "_iui" not in os.listdir(self.path): 
     
    546548                      "pages until this depth. Be careful with that. " 
    547549                      "Default: %default)") 
     550    parser.add_option("-k", "--keep", action="store_true", 
     551                      help="Keep the previously downloaded pages even if " 
     552                           "they were removed from the feed") 
    548553    parser.add_option("-d", "--debug", dest="debug", action="store_true", 
    549554                      help="Debug mode") 
     
    632637 
    633638    repo.make_index(downloader) 
     639    if not options.keep: 
     640        repo.remove_expired() 
    634641    repo.cleanup() 
    635642 
Note: See TracChangeset for help on using the changeset viewer.