changeset 2414:58ae57239761

Modify mk_POTFILES.py so that it can work with different dirs.
author Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
date Tue, 17 Jul 2007 03:35:58 +0200
parents 61380308535d
children 1007128cb089
files MoinMoin/i18n/tools/mk_POTFILES.py
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/i18n/tools/mk_POTFILES.py	Tue Jul 17 03:24:28 2007 +0200
+++ b/MoinMoin/i18n/tools/mk_POTFILES.py	Tue Jul 17 03:35:58 2007 +0200
@@ -1,10 +1,16 @@
 #!/usr/bin/env python
 
 import os
+from sys import argv
 
 # Define the starting directory.
 
-startdir = os.path.join("..") # MoinMoin
+startdir = ""
+
+if len(argv) == 2:
+    startdir = os.path.join(argv[1])
+else:
+    startdir = os.path.join("..") # MoinMoin
 
 # Define a blacklist.
 
@@ -77,10 +83,10 @@
     outfile.write("POTFILES = \\\n")
     try:
         for file in files[:-1]:
-            outfile.write("\t" + os.path.join("..", file) + " \\\n")
+            outfile.write("\t" + os.path.join(startdir, file) + " \\\n")
         if files[-1]:
             file = files[-1]
-            outfile.write("\t" + os.path.join("..", file) + "\n")
+            outfile.write("\t" + os.path.join(startdir, file) + "\n")
     finally:
         outfile.close()