Revision: 1418
Author: sebastien.lelong
Date: Sun Oct 25 12:02:40 2009
Log: minor improvements...
http://code.google.com/p/jallib/source/detail?r=1418

Modified:
  /trunk/tools/japp/dita2html.sh
  /trunk/tools/japp/htmlizer.py
  /trunk/tools/japp/publish.py

=======================================
--- /trunk/tools/japp/dita2html.sh      Thu Oct 22 22:57:34 2009
+++ /trunk/tools/japp/dita2html.sh      Sun Oct 25 12:02:40 2009
@@ -12,7 +12,7 @@

  if [ "$DITAFILE" = "" ] || [ "$OUTPUTDIR" = "" ]
  then
-    echo "Please provide a DITA file and an outpur directory"
+    echo "Please provide a DITA file and an output directory"
      exit 255
  fi

@@ -31,4 +31,6 @@
  fi

  # -Duser.csspath.url=  ---> don't copy css files
-ant -Dargs.transtype=xhtml -Duser.csspath.url= -Doutput.dir=$OUTPUTDIR  
-Dargs.input=$DITAFILE -Dargs.logdir=$TMPDIR -Ddita.temp.dir=$TMPDIR  
-Dargs.target=init -f $DITA_HOME/build.xml dita2xhtml
+cmd="ant -Dargs.transtype=xhtml -Duser.csspath.url=  
-Doutput.dir=$OUTPUTDIR -Dargs.input=$DITAFILE -Dargs.logdir=$TMPDIR  
-Ddita.temp.dir=$TMPDIR -Dargs.target=init -f $DITA_HOME/build.xml  
dita2xhtml"
+echo $cmd
+$cmd
=======================================
--- /trunk/tools/japp/htmlizer.py       Sat Oct 24 03:15:44 2009
+++ /trunk/tools/japp/htmlizer.py       Sun Oct 25 12:02:40 2009
@@ -27,6 +27,7 @@
  DRUPAL_CONTENT_PREFIX = "/content/"
  # where to put all stuff to publish
  OUTPUT_DIR="topublish"
+ATTACH_DIR="attachments"
  # Filename for filtered HTML
  CONTENT_FILE = "content"
  TITLE_FILE = "title"
@@ -42,7 +43,7 @@
  dirn = os.path.dirname(hfile)
  basen = os.path.basename(hfile)
  os.system("rm -f %s/%s/*" % (dirn,OUTPUT_DIR))
-os.system("mkdir -p %s/%s/" % (dirn,OUTPUT_DIR))
+os.system("mkdir -p %s/%s/%s/" % (dirn,OUTPUT_DIR,ATTACH_DIR))


  html = BeautifulSoup(file(hfile).read())
@@ -69,7 +70,7 @@
      origsrc = img['src']
      imgfn = os.path.basename(origsrc)
      img['src'] = DRUPAL_IMG_PATH_PREFIX + imgfn
-    os.system("cp %s/%s %s/%s/" % (dirn,origsrc,dirn,OUTPUT_DIR))
+    os.system("cp %s/%s %s/%s/%s/" %  
(dirn,origsrc,dirn,OUTPUT_DIR,ATTACH_DIR))


  # convert link URL
=======================================
--- /trunk/tools/japp/publish.py        Sat Oct 24 03:15:44 2009
+++ /trunk/tools/japp/publish.py        Sun Oct 25 12:02:40 2009
@@ -37,7 +37,8 @@
  msg.attach(txt)

  # Assume we know that the image files are all in PNG format
-imgfiles = map(lambda x: os.path.join(topublish,x),[f for f in  
os.listdir(topublish) if not f in ['title','content','path']])
+attachpath = os.path.join(topublish,"attachments")
+imgfiles = map(lambda x: os.path.join(attachpath,x),os.listdir(attachpath))
  for img in imgfiles:
      # Open the files in binary mode.  Let the MIMEImage class automatically
      # guess the specific image type.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to