diff --git a/webgen.py b/webgen.py index cd7d427..14da1ba 100755 --- a/webgen.py +++ b/webgen.py @@ -5,16 +5,23 @@ from dialog import Dialog # If not choosen stdout as output, where should the generated file go to and what -# fileending (f.e. .html) shall it have +# fileending (f.e. .html) shall it have. Preset values. webbasedir = os.path.expanduser("~/www/i21k.de/") targetdir = webbasedir + "posts/" sourcedir = os.path.expanduser("~/python/webgen/") + ### for module mkdirindex: filesdir = webbasedir + "files/" indexfilename = "index.html" filesdirheadline = "Files" #### +# for spellchecko +# Preferred: aspell -c filename +# +spellcheck = "aspell" +spellcheckparam = "-c" + fileending = "" locale.setlocale(locale.LC_ALL, "") clear = "\x1b[2J\x1b[H" @@ -47,14 +54,20 @@ signal.signal(signal.SIGINT, sigint_handler) # call favorite editor with filename to write the text +# i am not shure bout that spellchecko, is it nessesary? + + def edit(headline): editor = os.getenv("EDITOR") if not editor: editor = "vim" subprocess.call([editor, headline]) -# spellcheck = os.getenv("SPELLCHECK") -# if spellcheck: -# subprocess.call([spellcheck, " -c ", headline]) + spellcheck = os.getenv("SPELLCHECK") + if spellcheck: + print(yellow) + if input("You like to spellcheck it [y/N]?") == "y": + subprocess.call([spellcheck, spellcheckparam, headline]) + print(green) return headline