Back to index

moin  1.9.0~rc2
Functions | Variables
MoinMoin.i18n.tools.mk_POTFILES Namespace Reference

Functions

def get_files
def find_files

Variables

string startdir = ""
list blacklist
string outname_in = "POTFILES.in"
string outname_final = "POTFILES"
tuple files = find_files(startdir, blacklist)
tuple outfile = open(outname_in, "w")
list file = files[-1]

Function Documentation

def MoinMoin.i18n.tools.mk_POTFILES.find_files (   startdir,
  blacklist 
)

Definition at line 61 of file mk_POTFILES.py.

00061 
00062 def find_files(startdir, blacklist):
00063     "Find files under 'startdir' excluding those in the 'blacklist'."
00064 
00065     # Calculate the prefix from the start directory.
00066     prefix = os.path.join(startdir, "")
00067 
00068     # Start with an empty list of files.
00069 
00070     files = []
00071     os.path.walk(startdir, get_files, (files, prefix, blacklist))
00072     return files

def MoinMoin.i18n.tools.mk_POTFILES.get_files (   files,
  prefix,
  blacklist,
  d,
  names 
)
Store pathnames in 'files', removing 'prefix', excluding those mentioned
in the 'blacklist', building such pathnames from the directory 'd' and
the given 'names'.

Definition at line 31 of file mk_POTFILES.py.

00031 
00032 def get_files((files, prefix, blacklist), d, names):
00033 
00034     """
00035     Store pathnames in 'files', removing 'prefix', excluding those mentioned
00036     in the 'blacklist', building such pathnames from the directory 'd' and
00037     the given 'names'.
00038     """
00039 
00040     for name in names:
00041         if name.endswith(".py"):
00042             path = os.path.join(d, name)
00043 
00044             # Strip the prefix.
00045             if path.startswith(prefix):
00046                 path = path[len(prefix):]
00047 
00048             # Test for exact blacklist matches.
00049             if path in blacklist:
00050                 continue
00051 
00052             # Test for directory blacklist matches.
00053             found = 0
00054             for blackitem in blacklist:
00055                 if path.startswith(blackitem):
00056                     found = 1
00057                     break
00058 
00059             if not found:
00060                 files.append(path)


Variable Documentation

Initial value:
00001 ["_tests",
00002              os.path.join("script", "old"),
00003              "support",
00004              os.path.join("filter", "EXIF.py"),
00005              os.path.join("web", "static", "htdocs"),
00006             ]

Definition at line 17 of file mk_POTFILES.py.

Definition at line 93 of file mk_POTFILES.py.

Definition at line 76 of file mk_POTFILES.py.

Definition at line 79 of file mk_POTFILES.py.

Definition at line 27 of file mk_POTFILES.py.

Definition at line 26 of file mk_POTFILES.py.

Definition at line 8 of file mk_POTFILES.py.