docs for config

This commit is contained in:
ville rantanen
2014-01-28 16:09:22 +02:00
parent 57f7091fea
commit 5d4dd60a77

View File

@@ -36,18 +36,26 @@ FILEINFO="info.txt"
SAVEDCONFIG="""attachments=boolean SAVEDCONFIG="""attachments=boolean
gallery=string gallery=string
infofile=string infofile=string
link=boolean
parent=string parent=string
reverse=boolean reverse=boolean
startpath=string
timesort=boolean timesort=boolean
clean=boolean clean=boolean
force=boolean force=boolean
gravity=string gravity=string
recursive=boolean link=boolean
width=string""".split('\n') width=string""".split('\n')
CONFIGCOMMENTS=""" CONFIGCOMMENTS="""
config values: config values:
gallery: Name of the gallery
infofile: Name of the infofile, inserted in beginning of the main page
parent: String URL pointing to parent folder
reverse: Sort reverse
timesort: Sort by timestamp
clean: Delete unused thumbnails
force: Force recreate thumbnails
gravity: ImageMagick option for creating thumbnails, e.g. North,East,Center
link: Medium sized images are symbolic links to original
width: Medium images longer axis in pixels
""".split('\n') """.split('\n')
webfilesearch=re.compile('.*index.html$|gallerystyle.css$|galleryscript.js$|'+FILEDESC+'$|^'+FILEINFO+'$|\..*',re.I) webfilesearch=re.compile('.*index.html$|gallerystyle.css$|galleryscript.js$|'+FILEDESC+'$|^'+FILEINFO+'$|\..*',re.I)
imagesearch=re.compile('.*\.jpg$|.*\.jpeg$|.*\.gif$|.*\.png$|.*\.svg$|.*\.pdf$',re.I) imagesearch=re.compile('.*\.jpg$|.*\.jpeg$|.*\.gif$|.*\.png$|.*\.svg$|.*\.pdf$',re.I)
@@ -417,6 +425,8 @@ def traverse(path,crumbs,inputs,options):
#print('Depth: '+str(len(crumbs))) #print('Depth: '+str(len(crumbs)))
pathlist=getpathlist(path,options) pathlist=getpathlist(path,options)
imagelist=getimagelist(path,options) imagelist=getimagelist(path,options)
if options.clean:
cleanthumbs(path)
createthumbs(path,imagelist,options) createthumbs(path,imagelist,options)
imagelist.extend(getnonconvertiblelist(path,options)) imagelist.extend(getnonconvertiblelist(path,options))
filelist=getnonimagelist(path,options) filelist=getnonimagelist(path,options)
@@ -540,8 +550,6 @@ def writeconfig(options):
cfg.initial_comment=CONFIGCOMMENTS cfg.initial_comment=CONFIGCOMMENTS
cfg.filename=FILECONFIG cfg.filename=FILECONFIG
for opt in SAVEDCONFIG: for opt in SAVEDCONFIG:
if opt.startswith('#'):
continue
optname=opt.split("=")[0] optname=opt.split("=")[0]
cfg[optname]=getattr(options,optname) cfg[optname]=getattr(options,optname)
cfg.write() cfg.write()