degal/commands/update.py
author Tero Marttila <terom@fixme.fi>
Thu, 02 Jul 2009 21:59:01 +0300
changeset 144 97505a789003
parent 132 degal/commands/main.py@c2b2f4b6fe6d
permissions -rw-r--r--
reorganize/rename the commands and their options stuff, options like --force-html are now split out from main.py into commands/update.py
144
97505a789003 reorganize/rename the commands and their options stuff, options like --force-html are now split out from main.py into commands/update.py
Tero Marttila <terom@fixme.fi>
parents: 132
diff changeset
     1
from degal.command import command, Option
117
a2e4562deaab implement concurrency... :)
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
     2
from degal.concurrent import task
66
322e5cd0cb1f implement new main() command, remove old one
Tero Marttila <terom@fixme.fi>
parents: 48
diff changeset
     3
from degal import templates
48
20355dd2e61a new structure for bin/degal, adding degal/commands, degal/main
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     4
94
676c1d201cfe slightly reoriganize function structure in commands.main
Tero Marttila <terom@fixme.fi>
parents: 87
diff changeset
     5
def render_image_html (ctx, image) :
66
322e5cd0cb1f implement new main() command, remove old one
Tero Marttila <terom@fixme.fi>
parents: 48
diff changeset
     6
    """
132
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
     7
        Render and write out the static .html file for the give image.
66
322e5cd0cb1f implement new main() command, remove old one
Tero Marttila <terom@fixme.fi>
parents: 48
diff changeset
     8
    """
87
a7a18893730d implement up-to-date checking for commands.main, and add --force-update option
Tero Marttila <terom@fixme.fi>
parents: 76
diff changeset
     9
101
698dc68a985d split --force-update into --force-thumb/--force-html options, implement for main
Tero Marttila <terom@fixme.fi>
parents: 94
diff changeset
    10
    ctx.log_debug("%s", image.html)
698dc68a985d split --force-update into --force-thumb/--force-html options, implement for main
Tero Marttila <terom@fixme.fi>
parents: 94
diff changeset
    11
132
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    12
    # render full-xhtml-document
119
e7855eefb4c7 fix breadcrumb/title stuff
Tero Marttila <terom@fixme.fi>
parents: 118
diff changeset
    13
    tpl = templates.master(ctx.gallery, image, 
132
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    14
        # with content
66
322e5cd0cb1f implement new main() command, remove old one
Tero Marttila <terom@fixme.fi>
parents: 48
diff changeset
    15
        templates.image_page(image)
322e5cd0cb1f implement new main() command, remove old one
Tero Marttila <terom@fixme.fi>
parents: 48
diff changeset
    16
    )
322e5cd0cb1f implement new main() command, remove old one
Tero Marttila <terom@fixme.fi>
parents: 48
diff changeset
    17
    
322e5cd0cb1f implement new main() command, remove old one
Tero Marttila <terom@fixme.fi>
parents: 48
diff changeset
    18
    # write output
322e5cd0cb1f implement new main() command, remove old one
Tero Marttila <terom@fixme.fi>
parents: 48
diff changeset
    19
    tpl.render_file(image.html)
322e5cd0cb1f implement new main() command, remove old one
Tero Marttila <terom@fixme.fi>
parents: 48
diff changeset
    20
117
a2e4562deaab implement concurrency... :)
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    21
def update_image_thumbs (image) :
94
676c1d201cfe slightly reoriganize function structure in commands.main
Tero Marttila <terom@fixme.fi>
parents: 87
diff changeset
    22
    """
132
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    23
        Update/render and write out the thumbnails (thumb+preview) for the given image, returning the image object
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    24
        itself.
117
a2e4562deaab implement concurrency... :)
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    25
132
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    26
        This /should/ be threadsafe. XXX: but it probably isn't entirely.
94
676c1d201cfe slightly reoriganize function structure in commands.main
Tero Marttila <terom@fixme.fi>
parents: 87
diff changeset
    27
    """
117
a2e4562deaab implement concurrency... :)
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    28
    
a2e4562deaab implement concurrency... :)
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    29
    # this will unconditionally update the image
a2e4562deaab implement concurrency... :)
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    30
    image.update()
94
676c1d201cfe slightly reoriganize function structure in commands.main
Tero Marttila <terom@fixme.fi>
parents: 87
diff changeset
    31
117
a2e4562deaab implement concurrency... :)
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    32
    return image
94
676c1d201cfe slightly reoriganize function structure in commands.main
Tero Marttila <terom@fixme.fi>
parents: 87
diff changeset
    33
132
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    34
def render_folder_images (ctx, images) :
94
676c1d201cfe slightly reoriganize function structure in commands.main
Tero Marttila <terom@fixme.fi>
parents: 87
diff changeset
    35
    """
132
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    36
        Render the given series of images (html+thumbnails) as required based on the settings.
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    37
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    38
        This is capable of rendering the given set of images in parallel.
94
676c1d201cfe slightly reoriganize function structure in commands.main
Tero Marttila <terom@fixme.fi>
parents: 87
diff changeset
    39
    """
118
60b126ff0b74 configuration magic - can now load configuration data from ./degal.cfg, --config, folder/degal.cfg
Tero Marttila <terom@fixme.fi>
parents: 117
diff changeset
    40
132
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    41
    # first, update HTML
123
31c4a328ef96 move the uncache-del's from commands.main to Image.cleanup, and call it after rendering each image's thumbs
Tero Marttila <terom@fixme.fi>
parents: 119
diff changeset
    42
    for image in images :
144
97505a789003 reorganize/rename the commands and their options stuff, options like --force-html are now split out from main.py into commands/update.py
Tero Marttila <terom@fixme.fi>
parents: 132
diff changeset
    43
        if ctx.options.force_html or image.stale() :
132
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    44
            render_image_html(ctx, image)
94
676c1d201cfe slightly reoriganize function structure in commands.main
Tero Marttila <terom@fixme.fi>
parents: 87
diff changeset
    45
    
132
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    46
    # define the render-tasks
144
97505a789003 reorganize/rename the commands and their options stuff, options like --force-html are now split out from main.py into commands/update.py
Tero Marttila <terom@fixme.fi>
parents: 132
diff changeset
    47
    tasks = (task(update_image_thumbs, image) for image in images if ctx.options.force_thumb or image.stale())
132
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    48
    
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    49
    # render the thumbnails themselves concurrently, returning the rendered Image objects
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    50
    for image in ctx.concurrent.execute(tasks) :
94
676c1d201cfe slightly reoriganize function structure in commands.main
Tero Marttila <terom@fixme.fi>
parents: 87
diff changeset
    51
        # log image path
676c1d201cfe slightly reoriganize function structure in commands.main
Tero Marttila <terom@fixme.fi>
parents: 87
diff changeset
    52
        ctx.log_info("%s", image)
676c1d201cfe slightly reoriganize function structure in commands.main
Tero Marttila <terom@fixme.fi>
parents: 87
diff changeset
    53
101
698dc68a985d split --force-update into --force-thumb/--force-html options, implement for main
Tero Marttila <terom@fixme.fi>
parents: 94
diff changeset
    54
        # release large objects that are not needed anymore
123
31c4a328ef96 move the uncache-del's from commands.main to Image.cleanup, and call it after rendering each image's thumbs
Tero Marttila <terom@fixme.fi>
parents: 119
diff changeset
    55
        image.cleanup()
101
698dc68a985d split --force-update into --force-thumb/--force-html options, implement for main
Tero Marttila <terom@fixme.fi>
parents: 94
diff changeset
    56
117
a2e4562deaab implement concurrency... :)
Tero Marttila <terom@fixme.fi>
parents: 115
diff changeset
    57
def render_folder_html (ctx, folder) :
48
20355dd2e61a new structure for bin/degal, adding degal/commands, degal/main
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    58
    """
132
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    59
        Render and write out the required static .html files for the given folder.
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    60
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    61
        This will paginate large numbers of images, handle Folders with only subfolders within as a single page, and as
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    62
        a bonus, will not render anything for (non-recursively) empty folders.
48
20355dd2e61a new structure for bin/degal, adding degal/commands, degal/main
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    63
    """
20355dd2e61a new structure for bin/degal, adding degal/commands, degal/main
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    64
87
a7a18893730d implement up-to-date checking for commands.main, and add --force-update option
Tero Marttila <terom@fixme.fi>
parents: 76
diff changeset
    65
    # render each page separately
66
322e5cd0cb1f implement new main() command, remove old one
Tero Marttila <terom@fixme.fi>
parents: 48
diff changeset
    66
    for page in xrange(folder.page_count) :
132
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    67
        # output .html path
119
e7855eefb4c7 fix breadcrumb/title stuff
Tero Marttila <terom@fixme.fi>
parents: 118
diff changeset
    68
        html = folder.html_page(page)
101
698dc68a985d split --force-update into --force-thumb/--force-html options, implement for main
Tero Marttila <terom@fixme.fi>
parents: 94
diff changeset
    69
    
119
e7855eefb4c7 fix breadcrumb/title stuff
Tero Marttila <terom@fixme.fi>
parents: 118
diff changeset
    70
        ctx.log_debug("%s", html)
66
322e5cd0cb1f implement new main() command, remove old one
Tero Marttila <terom@fixme.fi>
parents: 48
diff changeset
    71
        
132
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    72
        # render full-html template
119
e7855eefb4c7 fix breadcrumb/title stuff
Tero Marttila <terom@fixme.fi>
parents: 118
diff changeset
    73
        tpl = templates.master(ctx.gallery, folder,
132
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    74
            # content
66
322e5cd0cb1f implement new main() command, remove old one
Tero Marttila <terom@fixme.fi>
parents: 48
diff changeset
    75
            templates.folder_page(folder, page)
322e5cd0cb1f implement new main() command, remove old one
Tero Marttila <terom@fixme.fi>
parents: 48
diff changeset
    76
        )
322e5cd0cb1f implement new main() command, remove old one
Tero Marttila <terom@fixme.fi>
parents: 48
diff changeset
    77
322e5cd0cb1f implement new main() command, remove old one
Tero Marttila <terom@fixme.fi>
parents: 48
diff changeset
    78
        # write output
119
e7855eefb4c7 fix breadcrumb/title stuff
Tero Marttila <terom@fixme.fi>
parents: 118
diff changeset
    79
        tpl.render_file(html)
66
322e5cd0cb1f implement new main() command, remove old one
Tero Marttila <terom@fixme.fi>
parents: 48
diff changeset
    80
87
a7a18893730d implement up-to-date checking for commands.main, and add --force-update option
Tero Marttila <terom@fixme.fi>
parents: 76
diff changeset
    81
def render_folder (ctx, folder) :
94
676c1d201cfe slightly reoriganize function structure in commands.main
Tero Marttila <terom@fixme.fi>
parents: 87
diff changeset
    82
    """
132
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    83
        Recursively render a folder, with render_folder_images and render_folder.
131
7021d949222c fix commands.main to render HTML for folders that only have subfolders, and no direct images
Tero Marttila <terom@fixme.fi>
parents: 123
diff changeset
    84
132
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    85
        This does a depth-first search of subfolders.
131
7021d949222c fix commands.main to render HTML for folders that only have subfolders, and no direct images
Tero Marttila <terom@fixme.fi>
parents: 123
diff changeset
    86
        
132
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    87
        Updates the Images as needed (based on config.force_thumbs/config.force_html).
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    88
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    89
        Currently, this will always update the .html for non-empty Folders.
94
676c1d201cfe slightly reoriganize function structure in commands.main
Tero Marttila <terom@fixme.fi>
parents: 87
diff changeset
    90
    """
131
7021d949222c fix commands.main to render HTML for folders that only have subfolders, and no direct images
Tero Marttila <terom@fixme.fi>
parents: 123
diff changeset
    91
132
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    92
    # do depth-first recursion
131
7021d949222c fix commands.main to render HTML for folders that only have subfolders, and no direct images
Tero Marttila <terom@fixme.fi>
parents: 123
diff changeset
    93
    for subfolder in folder.subfolders :
132
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    94
        render_folder(ctx, subfolder)
131
7021d949222c fix commands.main to render HTML for folders that only have subfolders, and no direct images
Tero Marttila <terom@fixme.fi>
parents: 123
diff changeset
    95
132
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    96
    if folder.empty :
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    97
        # warn
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    98
        ctx.log_debug("%s - empty, skipping", folder)
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
    99
        
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
   100
        return
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
   101
 
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
   102
    # force-update HTML, every time
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
   103
    render_folder_html(ctx, folder)
131
7021d949222c fix commands.main to render HTML for folders that only have subfolders, and no direct images
Tero Marttila <terom@fixme.fi>
parents: 123
diff changeset
   104
    
132
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
   105
    # get the list of images that we are going to update, only those that are stale unless any force_update
144
97505a789003 reorganize/rename the commands and their options stuff, options like --force-html are now split out from main.py into commands/update.py
Tero Marttila <terom@fixme.fi>
parents: 132
diff changeset
   106
    update_images = list(folder.index_images(for_update=not ctx.options.force_index))
132
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
   107
    
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
   108
    if update_images :
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
   109
        # status
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
   110
        ctx.log_info("%s - rendering %d/%d images", folder, len(update_images), len(folder.images))
87
a7a18893730d implement up-to-date checking for commands.main, and add --force-update option
Tero Marttila <terom@fixme.fi>
parents: 76
diff changeset
   111
132
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
   112
        # update images as needed
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
   113
        render_folder_images(ctx, folder.images)
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
   114
    
87
a7a18893730d implement up-to-date checking for commands.main, and add --force-update option
Tero Marttila <terom@fixme.fi>
parents: 76
diff changeset
   115
    else :
132
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
   116
        # nothing to do
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
   117
        ctx.log_info("%s - up-to-date", folder)
66
322e5cd0cb1f implement new main() command, remove old one
Tero Marttila <terom@fixme.fi>
parents: 48
diff changeset
   118
144
97505a789003 reorganize/rename the commands and their options stuff, options like --force-html are now split out from main.py into commands/update.py
Tero Marttila <terom@fixme.fi>
parents: 132
diff changeset
   119
@command(
97505a789003 reorganize/rename the commands and their options stuff, options like --force-html are now split out from main.py into commands/update.py
Tero Marttila <terom@fixme.fi>
parents: 132
diff changeset
   120
    options = (
97505a789003 reorganize/rename the commands and their options stuff, options like --force-html are now split out from main.py into commands/update.py
Tero Marttila <terom@fixme.fi>
parents: 132
diff changeset
   121
        Option('--force-html',    help="Force-update HTML documents", action="store_true", default="False"), 
97505a789003 reorganize/rename the commands and their options stuff, options like --force-html are now split out from main.py into commands/update.py
Tero Marttila <terom@fixme.fi>
parents: 132
diff changeset
   122
        Option('--force-thumb',   help="Force-update thumbnails", action="store_true", default="False"),
97505a789003 reorganize/rename the commands and their options stuff, options like --force-html are now split out from main.py into commands/update.py
Tero Marttila <terom@fixme.fi>
parents: 132
diff changeset
   123
        Option('-F', '--force-update', help="Force-update both", action="store_true", default="False"),
97505a789003 reorganize/rename the commands and their options stuff, options like --force-html are now split out from main.py into commands/update.py
Tero Marttila <terom@fixme.fi>
parents: 132
diff changeset
   124
    )
97505a789003 reorganize/rename the commands and their options stuff, options like --force-html are now split out from main.py into commands/update.py
Tero Marttila <terom@fixme.fi>
parents: 132
diff changeset
   125
)
97505a789003 reorganize/rename the commands and their options stuff, options like --force-html are now split out from main.py into commands/update.py
Tero Marttila <terom@fixme.fi>
parents: 132
diff changeset
   126
def update (ctx, *filter) :
66
322e5cd0cb1f implement new main() command, remove old one
Tero Marttila <terom@fixme.fi>
parents: 48
diff changeset
   127
    """
144
97505a789003 reorganize/rename the commands and their options stuff, options like --force-html are now split out from main.py into commands/update.py
Tero Marttila <terom@fixme.fi>
parents: 132
diff changeset
   128
        Scan the gallery for new folders/images, and render updated ones.
66
322e5cd0cb1f implement new main() command, remove old one
Tero Marttila <terom@fixme.fi>
parents: 48
diff changeset
   129
    """
144
97505a789003 reorganize/rename the commands and their options stuff, options like --force-html are now split out from main.py into commands/update.py
Tero Marttila <terom@fixme.fi>
parents: 132
diff changeset
   130
    
97505a789003 reorganize/rename the commands and their options stuff, options like --force-html are now split out from main.py into commands/update.py
Tero Marttila <terom@fixme.fi>
parents: 132
diff changeset
   131
    # do the force_update/force_index semantics
97505a789003 reorganize/rename the commands and their options stuff, options like --force-html are now split out from main.py into commands/update.py
Tero Marttila <terom@fixme.fi>
parents: 132
diff changeset
   132
    if ctx.options.force_update :
97505a789003 reorganize/rename the commands and their options stuff, options like --force-html are now split out from main.py into commands/update.py
Tero Marttila <terom@fixme.fi>
parents: 132
diff changeset
   133
        ctx.options.force_index = ctx.options.force_html = ctx.options.force_thumb = True
97505a789003 reorganize/rename the commands and their options stuff, options like --force-html are now split out from main.py into commands/update.py
Tero Marttila <terom@fixme.fi>
parents: 132
diff changeset
   134
97505a789003 reorganize/rename the commands and their options stuff, options like --force-html are now split out from main.py into commands/update.py
Tero Marttila <terom@fixme.fi>
parents: 132
diff changeset
   135
    elif ctx.options.force_html or ctx.options.force_thumb :
97505a789003 reorganize/rename the commands and their options stuff, options like --force-html are now split out from main.py into commands/update.py
Tero Marttila <terom@fixme.fi>
parents: 132
diff changeset
   136
        ctx.options.force_index = True
97505a789003 reorganize/rename the commands and their options stuff, options like --force-html are now split out from main.py into commands/update.py
Tero Marttila <terom@fixme.fi>
parents: 132
diff changeset
   137
    
97505a789003 reorganize/rename the commands and their options stuff, options like --force-html are now split out from main.py into commands/update.py
Tero Marttila <terom@fixme.fi>
parents: 132
diff changeset
   138
    else :
97505a789003 reorganize/rename the commands and their options stuff, options like --force-html are now split out from main.py into commands/update.py
Tero Marttila <terom@fixme.fi>
parents: 132
diff changeset
   139
        ctx.options.force_index = False
66
322e5cd0cb1f implement new main() command, remove old one
Tero Marttila <terom@fixme.fi>
parents: 48
diff changeset
   140
132
c2b2f4b6fe6d clear up commands.main logic a bit
Tero Marttila <terom@fixme.fi>
parents: 131
diff changeset
   141
    # render the gallery root as a folder
66
322e5cd0cb1f implement new main() command, remove old one
Tero Marttila <terom@fixme.fi>
parents: 48
diff changeset
   142
    render_folder(ctx, ctx.gallery)
48
20355dd2e61a new structure for bin/degal, adding degal/commands, degal/main
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
   143