← Back to team overview

openshot.code team mailing list archive

[Branch ~openshot.code/openshot/openshot-docs-translations] Rev 212: Made HTML generation optional and disabled by default. Made all paths dynamic. This was needed ...

 

------------------------------------------------------------
revno: 212
committer: Jonathan Thomas <Jonathan.Oomph@xxxxxxxxx>
branch nick: openshot-docs-translations
timestamp: Tue 2011-09-13 12:25:00 -0500
message:
  Made HTML generation optional and disabled by default.  Made all paths dynamic.  This was needed for the daily build LaunchPad recipe.
modified:
  compile.py


--
lp:~openshot.code/openshot/openshot-docs-translations
https://code.launchpad.net/~openshot.code/openshot/openshot-docs-translations

Your team OpenShot Code is subscribed to branch lp:~openshot.code/openshot/openshot-docs-translations.
To unsubscribe from this branch go to https://code.launchpad.net/~openshot.code/openshot/openshot-docs-translations/+edit-subscription
=== modified file 'compile.py'
--- compile.py	2011-05-03 08:47:18 +0000
+++ compile.py	2011-09-13 17:25:00 +0000
@@ -78,10 +78,15 @@
 	subprocess.call("mv %s/*.html %s" % (path, target_dir), shell=True)
 	subprocess.call("cp %s/*.css %s" % (path, target_dir), shell=True)
 
+
+
+HTML = False
 path = os.path.dirname(os.path.abspath(__file__))
+parent_folder = os.path.dirname(path)
 locale_folder = os.path.join(path, "en-us", "openshot")
-english_xml_path = "/home/jonathan/openshot-docs/en-us/openshot/openshot.xml"
-figures_path = "/home/jonathan/openshot-docs/en-us/figures/"
+
+english_xml_path = os.path.join(parent_folder, "openshot-docs", "en-us", "openshot", "openshot.xml")
+figures_path = os.path.join(parent_folder, "openshot-docs", "en-us", "figures")
 sample_omf_path = os.path.join(path, "example.omf")
 
 # create a C folder (for the English version)
@@ -110,10 +115,12 @@
 shutil.copytree(figures_path, os.path.join(locale_folder, "html", "figures"), False)
 set_sect_id(os.path.join(locale_folder, "gnome", "C", "openshot.xml"), "Section1")
 create_omf_file(sample_omf_path, os.path.join(locale_folder, "omf", "openshot-C.omf"), "C")
-create_html_files(os.path.join(locale_folder, "gnome", "C", "openshot.xml"), os.path.join(locale_folder, "html", "en"))
+
+if HTML:
+	create_html_files(os.path.join(locale_folder, "gnome", "C", "openshot.xml"), os.path.join(locale_folder, "html", "en"))
 
 completed_po_files = ['cs.po','da.po','de.po','el.po','en_GB.po','es.po','fr.po','he.po','it.po','nb.po','nl.po','pl.po','pt.po','pt_BR.po','sk.po','zh_TW.po']
-# os.listdir(locale_folder)
+
 
 # Loop through each MO file
 section_number = 2
@@ -138,7 +145,9 @@
 		subprocess.call("xml2po -o '%s' -e -p '%s' '%s'" % (new_xml_path, po_path, english_xml_path), shell=True)
 		set_sect_id(new_xml_path, "Section%s" % section_number)
 		create_omf_file(sample_omf_path, os.path.join(locale_folder, "omf", "openshot-%s.omf" % culture), culture)
-		create_html_files(new_xml_path, os.path.join(locale_folder, "html", culture))
+		
+		if HTML:
+			create_html_files(new_xml_path, os.path.join(locale_folder, "html", culture))
 		
 print "---------------------"
 print "  Script Finished!"