File: manifest.py

package info (click to toggle)
psyco-doc 1.6-1
  • links: PTS
  • area: contrib
  • in suites: lenny
  • size: 1,832 kB
  • ctags: 3,236
  • sloc: ansic: 23,895; python: 5,646; perl: 1,309; makefile: 153
file content (24 lines) | stat: -rw-r--r-- 589 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from __future__ import generators
import os
import py   # the py lib, see http://codespeak.net/py

def psycofiles():
    path = py.path.svnwc(os.pardir)
    for p in path.visit(lambda x: x.check(versioned=1)):
        if p.check(dir=1):
            print p
        else:
            yield p.relto(path)

def generate():
    filename = os.path.join('..', 'MANIFEST')
    print 'Rebuilding %s...' % filename
    lst = list(psycofiles())
    lst.sort()
    f = open(filename, 'w')
    for filename in lst:
        print >> f, filename
    f.close()

if __name__ == '__main__':
    generate()