home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2012 January / maximum-cd-2012-01.iso / DiscContents / digsby_setup.exe / lib / i18n / mkappfill.pyo (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2011-10-05  |  1.5 KB  |  55 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.6)
  3.  
  4. from __future__ import with_statement
  5. import os.path as os
  6. from path import path
  7. EXTENSIONS = [
  8.     '.py',
  9.     '.cpp',
  10.     '.c',
  11.     '.h',
  12.     '.sip']
  13. blacklist = [
  14.     'ext/src/generated']
  15. blacklist = [ os.path.normpath(b) for b in blacklist ]
  16.  
  17. def blacklisted(f):
  18.     f = os.path.normpath(f)
  19.     for b in blacklist:
  20.         if b in f:
  21.             return True
  22.     
  23.  
  24.  
  25. def generate_fil_file(filpath = 'app.fil', dirs = None, extensions = None):
  26.     if dirs is None:
  27.         dirs = [
  28.             '../src']
  29.     
  30.     if extensions is None:
  31.         extensions = EXTENSIONS
  32.     
  33.     
  34.     try:
  35.         appfile = _[1]
  36.         for dir in dirs:
  37.             for file in path(dir).walkfiles():
  38.                 f = file.normcase()
  39.                 for ext in extensions:
  40.                     if f.endswith(os.path.normcase(ext)):
  41.                         if not blacklisted(f):
  42.                             appfile.write(file.relpath() + '\n')
  43.                         
  44.                     blacklisted(f)
  45.                 
  46.             
  47.     finally:
  48.         pass
  49.  
  50.  
  51.  
  52. def main():
  53.     generate_fil_file()
  54.  
  55.