]>
git.madduck.net Git - code/mailplate.git/commitdiff
madduck's git repository
Every one of the projects in this repository is available at the canonical
URL git://git.madduck.net/madduck/pub/<projectpath> — see
each project's metadata for the exact URL.
All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@ git. madduck. net .
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
SSH access, as well as push access can be individually
arranged .
If you use my repositories frequently, consider adding the following
snippet to ~/.gitconfig and using the third clone URL listed for each
project:
[url "git://git.madduck.net/madduck/"]
insteadOf = madduck:
summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (parent:
3ebfbe1 )
MAILPLATEDIR = os.path.expanduser(MAILPLATEDIR)
# defaults
MAILPLATEDIR = os.path.expanduser(MAILPLATEDIR)
# defaults
-config = { 'default_template' : None
+config = { 'default_template' : 'default'
, 'template_path' : TEMPLATEDIR
}
helpers = { 'get_quote' : 'fortune -s' }
, 'template_path' : TEMPLATEDIR
}
helpers = { 'get_quote' : 'fortune -s' }
if not os.path.isdir(TPATH):
os.mkdir(TPATH, 0700)
if not os.path.isdir(TPATH):
os.mkdir(TPATH, 0700)
+default_templname = config['default_template']
+if default_templname is not None:
+ default_templpath = os.path.join(TPATH, default_templname)
+ if not os.path.isfile(default_templpath):
+ f = file(default_templpath, 'w')
+ f.write('@KEEP_STD_HEADERS\n\n@KEEP_BODY\n')
+ f.close()
+
###
### COMMAND LINE PARSING
###
###
### COMMAND LINE PARSING
###
rawmsg = ''.join(inf.readlines())
if options.auto:
rawmsg = ''.join(inf.readlines())
if options.auto:
- best_score = (0, config['default_template'] , {})
+ best_score = (0, default_templname , {})
for tf in os.listdir(TPATH):
tp = os.path.join(TPATH, tf)
if not os.path.isfile(tp) or not os.access(tp, os.R_OK): continue
for tf in os.listdir(TPATH):
tp = os.path.join(TPATH, tf)
if not os.path.isfile(tp) or not os.access(tp, os.R_OK): continue