Commit e577f1a0 authored by Denis Bilenko's avatar Denis Bilenko

doc/generate_rst.py: better progress reporting

parent 2d9211a1
...@@ -21,6 +21,7 @@ template = '''.. AUTOGENERATED -- will be overwritten (remove this comment to sa ...@@ -21,6 +21,7 @@ template = '''.. AUTOGENERATED -- will be overwritten (remove this comment to sa
''' '''
directory = dirname(abspath(gevent.__file__)) directory = dirname(abspath(gevent.__file__))
print 'Imported gevent from %s' % (directory, )
modules = glob.glob(join(directory, '*.py')) + glob.glob(join(directory, '*.pyc')) modules = glob.glob(join(directory, '*.py')) + glob.glob(join(directory, '*.pyc'))
modules = set(basename(filename).split('.')[0] for filename in modules) modules = set(basename(filename).split('.')[0] for filename in modules)
modules = set(name for name in modules if not name.startswith('_')) modules = set(name for name in modules if not name.startswith('_'))
...@@ -54,10 +55,10 @@ def generate_rst_for_module(module, do=True): ...@@ -54,10 +55,10 @@ def generate_rst_for_module(module, do=True):
if open(rst_filename).read(len(result) + 1) == result: if open(rst_filename).read(len(result) + 1) == result:
return # already exists one which is the same return # already exists one which is the same
if do: if do:
print 'Generated %s' % rst_filename print 'Generated %s from %s' % (rst_filename, m.__file__)
open(rst_filename, 'w').write(result) open(rst_filename, 'w').write(result)
else: else:
print 'Would generate %s' % rst_filename print 'Would generate %s from %s' % (rst_filename, m.__file__)
def generate_rst(do=True): def generate_rst(do=True):
...@@ -84,6 +85,7 @@ if __name__ == '__main__': ...@@ -84,6 +85,7 @@ if __name__ == '__main__':
print filename print filename
elif sys.argv[1:] == ['delete']: elif sys.argv[1:] == ['delete']:
for filename in iter_autogenerated(): for filename in iter_autogenerated():
print 'Removing', filename
os.unlink(filename) os.unlink(filename)
elif sys.argv[1:] == ['generate']: elif sys.argv[1:] == ['generate']:
generate_rst() generate_rst()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment