docs for config
This commit is contained in:
18
Qalbum.py
18
Qalbum.py
@@ -36,18 +36,26 @@ FILEINFO="info.txt"
|
||||
SAVEDCONFIG="""attachments=boolean
|
||||
gallery=string
|
||||
infofile=string
|
||||
link=boolean
|
||||
parent=string
|
||||
reverse=boolean
|
||||
startpath=string
|
||||
timesort=boolean
|
||||
clean=boolean
|
||||
force=boolean
|
||||
gravity=string
|
||||
recursive=boolean
|
||||
link=boolean
|
||||
width=string""".split('\n')
|
||||
CONFIGCOMMENTS="""
|
||||
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')
|
||||
webfilesearch=re.compile('.*index.html$|gallerystyle.css$|galleryscript.js$|'+FILEDESC+'$|^'+FILEINFO+'$|\..*',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)))
|
||||
pathlist=getpathlist(path,options)
|
||||
imagelist=getimagelist(path,options)
|
||||
if options.clean:
|
||||
cleanthumbs(path)
|
||||
createthumbs(path,imagelist,options)
|
||||
imagelist.extend(getnonconvertiblelist(path,options))
|
||||
filelist=getnonimagelist(path,options)
|
||||
@@ -540,8 +550,6 @@ def writeconfig(options):
|
||||
cfg.initial_comment=CONFIGCOMMENTS
|
||||
cfg.filename=FILECONFIG
|
||||
for opt in SAVEDCONFIG:
|
||||
if opt.startswith('#'):
|
||||
continue
|
||||
optname=opt.split("=")[0]
|
||||
cfg[optname]=getattr(options,optname)
|
||||
cfg.write()
|
||||
|
||||
Reference in New Issue
Block a user