"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" Functions
+" See: http://learnvimscriptthehardway.stevelosh.com/chapters/27.html
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let $VIMHOME = $HOME.'/.vim'
setloc nomore
setloc textwidth=0
- let fname = &filetype.'.tt'
+ let ftype = FileGet('type')
+ if $VIMFILE =~ 'init\.d'
+ let ftype = 'daemon'
+ endif
+ let fname = ftype.'.tt'
let ffind = findfile(fname,$VIMPLATE_DIR)
if ffind == ''
" if ffind != $VIMPLATE_DIR . '/' . fname
return
endif
- let cmd = $VIMPLATE . ' -template '.&filetype
-" NB 29.12.12 let cmd = cmd . ' -listtemplates'
- " let cmd = 'vimplate -user nico -dir '.$VIMHOME.'/vimplaterc -template '.&filetype
- " let cmd = 'vimplate -user nico' . -dir '.$VIMHOME.'/vimplaterc -template '.&filetype
-" NB 29.12.12 echo '>>'.cmd
-" NB 29.12.12 execute "!" . cmd . ' && echo OK'
+ let cmd = $VIMPLATE . ' -template '.ftype
let bashenv = $BASH_ENV
let $BASH_ENV = ""
execute "r!" . cmd
# Short-Description: [% var.filename %]
# Description: [% user.me_now %] - [% user.copyright %]
### END INIT INFO
-#################################################################################
-#
-#
-#################################################################################
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
. /lib/lsb/init-functions
+START="yes"
# Source defaults file; edit that file to configure this script.
if test -e /etc/default/$NAME ; then
. /etc/default/$NAME
fi
+if [ "$START" != "yes" ]; then
+ echo "$NAME not configured to start, please edit /etc/default/$NAME to enable (START=yes)"
+fi
+
case "$1" in
start)
log_daemon_msg "Starting" "${NAME}"
import os
import re
#INCLUDE_LINES = re.sub('\.py$','-lines.py',os.path.realpath(__file__))
+import pprint
+PP = pprint.PrettyPrinter(indent=4)
# Debug message
def debug(msg):
+ if (type(msg)) != 'str':
+ msg = PP.pformat(msg)
print >> sys.stderr, msg
# Return first and last line from a file