From: <go...@us...> - 2005-11-29 02:55:17
|
Author: goodger Date: 2005-11-29 03:54:29 +0100 (Tue, 29 Nov 2005) New Revision: 4115 Modified: branches/s5/docs/user/slide-shows.txt branches/s5/docutils/writers/s5_html.py Log: added code to fix paths in slides.js & iepngfix.htc, so they're not hard-coded to 'ui/default' Modified: branches/s5/docs/user/slide-shows.txt =================================================================== --- branches/s5/docs/user/slide-shows.txt 2005-11-29 01:53:59 UTC (rev 4114) +++ branches/s5/docs/user/slide-shows.txt 2005-11-29 02:54:29 UTC (rev 4115) @@ -600,10 +600,7 @@ - iepngfix.htc - blank.gif - .. TODO: Alter paths in slides.js; currently hard-coded to - ui/default. - Making a Custom Theme ===================== @@ -636,10 +633,10 @@ Repeat from step 3 until you're satisfied. -.. TBD: What to do next: +.. TODO: What to do next: * add a ``__base__`` file - * create a personal reusable theme + * create a personal reusable theme (plugin) * submit the new theme to Docutils ``docutils/writers/support/s5_html/<theme>`` Modified: branches/s5/docutils/writers/s5_html.py =================================================================== --- branches/s5/docutils/writers/s5_html.py 2005-11-29 01:53:59 UTC (rev 4114) +++ branches/s5/docutils/writers/s5_html.py 2005-11-29 02:54:29 UTC (rev 4115) @@ -15,7 +15,6 @@ import sys import os -import shutil import docutils from docutils import frontend, nodes, utils, writers from docutils.writers import html4css1 @@ -239,7 +238,13 @@ if os.path.exists(dest) and not settings.overwrite_theme_files: settings.record_dependencies.add(dest) else: - shutil.copyfile(source, dest) + src_file = open(source, 'rb') + src_data = src_file.read() + src_file.close() + dest_file = open(dest, 'wb') + dest_file.write(src_data.replace( + 'ui/default', dest_dir[dest_dir.rfind('ui/'):])) + dest_file.close() settings.record_dependencies.add(source) return 1 if os.path.isfile(dest): |