PythonSlideShow

Changeset

3:9e0e4655feee
2010-08-26 ink raw files shortlog changelog graph Changed walkfs-writemarkup.py to now output a default slide order.
walkfs-writemarkup.py (file)
     1.1 --- a/walkfs-writemarkup.py	Thu Aug 26 09:53:53 2010 +0300
     1.2 +++ b/walkfs-writemarkup.py	Thu Aug 26 10:06:53 2010 +0300
     1.3 @@ -7,9 +7,9 @@
     1.4  # Bug: Class attributes end up with white space (if filenames have them): this might be a bug or a feature, I suppose.
     1.5  
     1.6  def makeSlides(root):
     1.7 -   slideData = ""
     1.8 +   defaultOrder, slideData = "", ""
     1.9     for current, directories, files in walk(root):
    1.10 -      print "\n" + current, directories, files
    1.11 +      print current, directories, files
    1.12        classes = ""
    1.13        if directories != []:
    1.14           for directory in directories:
    1.15 @@ -17,6 +17,7 @@
    1.16                 uid = new(path.join(current, directory)).hexdigest()
    1.17                 metaInfo = path.join(current, directory)
    1.18                 slideData += '\n<!-- directory --><DIV class="%s" id="%s">%s</DIV>' % (classes, uid, metaInfo)
    1.19 +               defaultOrder += " " + uid
    1.20              except:
    1.21                 pass
    1.22  
    1.23 @@ -27,9 +28,11 @@
    1.24                 uid = new(path.join(current, filename)).hexdigest()
    1.25                 metaInfo = path.join(current, filename)
    1.26                 slideData += '\n<!-- filename --><DIV class="%s" id="%s">%s</DIV>' % (classes, uid, metaInfo)
    1.27 +               defaultOrder += " " + uid
    1.28              except:
    1.29                 pass
    1.30 -
    1.31 +   slideOrder = '\n<!-- default order --><DIV class="%s">The default slide order is this DIV\'s class attribute.</DIV>' % defaultOrder
    1.32 +   slideData += slideOrder   
    1.33  
    1.34     return slideData
    1.35