blog/app/admin/__init__.py
def initialize(self):
        """ Purges all posts and images from the DB and filesystem. """

        print(" - Initializing MDB collections!")
        collections = ['posts','images','attachments','tags']
        for collection in collections:
            removed = app.config['MDB'][collection].remove()
            print("  Removed %s records from %s.%s" % (
                removed['n'],
                app.config['MDB'].name,
                collection,
                )
            )

        print(" - Initializing Uploads folder!")
        for the_file in os.listdir(app.config['UPLOADS']):
            file_path = os.path.join(app.config['UPLOADS'], the_file)
            try:
                if os.path.isfile(file_path):
                    os.remove(file_path)
                    print("  Removed '%s'" % file_path)
            except Exception as e:
                raise
 Purges all posts and images from the DB and filesystem. 
Purges all posts and images from the DB and filesystem.
Purges all posts and images from the DB and filesystem .
def initialize(self):
        print(" - Initializing MDB collections!")
        collections = ['posts','images','attachments','tags']
        for collection in collections:
            removed = app.config['MDB'][collection].remove()
            print("  Removed %s records from %s.%s" % (
                removed['n'],
                app.config['MDB'].name,
                collection,
                )
            )
        print(" - Initializing Uploads folder!")
        for the_file in os.listdir(app.config['UPLOADS']):
            file_path = os.path.join(app.config['UPLOADS'], the_file)
            try:
                if os.path.isfile(file_path):
                    os.remove(file_path)
                    print("  Removed '%s'" % file_path)
            except Exception as e:
                raise
def initialize ( self ) : print ( " - Initializing MDB collections!" ) collections = [ 'posts' , 'images' , 'attachments' , 'tags' ] for collection in collections : removed = app . config [ 'MDB' ] [ collection ] . remove ( ) print ( "  Removed %s records from %s.%s" % ( removed [ 'n' ] , app . config [ 'MDB' ] . name , collection , ) ) print ( " - Initializing Uploads folder!" ) for the_file in os . listdir ( app . config [ 'UPLOADS' ] ) : file_path = os . path . join ( app . config [ 'UPLOADS' ] , the_file ) try : if os . path . isfile ( file_path ) : os . remove ( file_path ) print ( "  Removed '%s'" % file_path ) except Exception as e : raise
Purges all posts and images from the DB and filesystem.
Purges all posts and images from the DB and filesystem .
""" Purges all posts and images from the DB and filesystem. """
self