]>
git.madduck.net Git - code/mailplate.git/blobdiff - mailplate
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:
# parse the arguments
for arg in args:
if arg == '-':
# parse the arguments
for arg in args:
if arg == '-':
- # filename is -, so do nothing, since stdin/stdout are default
- continue
+ infname = arg
+ outfname = arg
+ elif arg.find(os.path.sep) == -1 and os.access(os.path.join(TPATH, arg), os.R_OK):
+ if templname is not None:
+ err("template already specified (%s), unsure what to do with '%s'"
+ % (templname, arg))
+ sys.exit(posix.EX_USAGE)
+ # argument references an existing template
+ templname = arg
elif os.path.isfile(arg):
elif os.path.isfile(arg):
+ if infname is not None:
+ err("input file already specified (%s), unsure what to do with '%s'"
+ % (infname, arg))
+ sys.exit(posix.EX_USAGE)
# the file exists, so use it as in/out if read/writeable
if os.access(arg, os.R_OK):
infname = arg
if os.access(arg, os.W_OK):
outfname = arg
# the file exists, so use it as in/out if read/writeable
if os.access(arg, os.R_OK):
infname = arg
if os.access(arg, os.W_OK):
outfname = arg
- elif os.access(os.path.join(TPATH, arg), os.R_OK):
- # argument referenced an existing template
- templname = arg
- err('unknown argument, and cannot find a template by this name : %s' % arg)
+ err('unknown argument: %s' % arg)
sys.exit(posix.EX_USAGE)
# sanity checks
sys.exit(posix.EX_USAGE)
# sanity checks