Ticket #6380: make-messages.py.diff

File make-messages.py.diff, 1.0 KB (added by Adrian <aribao@…>, 17 years ago)

Patch to allow make-messages.py follow symbolic links

  • django/bin/make-messages.py

     
    7474        if os.path.exists(potfile):
    7575            os.unlink(potfile)
    7676
    77         all_files = []
    78         for (dirpath, dirnames, filenames) in os.walk("."):
    79             all_files.extend([(dirpath, f) for f in filenames])
     77        def get_files( root ):
     78            all_files = []
     79            elements = os.listdir( root )
     80            for element in elements:
     81                path = os.path.join(root,element)
     82                if os.path.isdir( path ):
     83                    all_files.extend( get_files( path ) )
     84                    pass
     85                elif os.path.isfile( path ):
     86                    all_files.append( (root,element) )
     87            return all_files
     88
     89        all_files = get_files(".")
    8090        all_files.sort()
    8191        for dirpath, file in all_files:
    8292            if domain == 'djangojs' and file.endswith('.js'):
Back to Top