Some informational output from the plugin, do not overwrite __init__.py

This commit is contained in:
Daniel G. Taylor 2019-10-23 15:07:05 -07:00
parent d43d5af5ce
commit eff9021529
No known key found for this signature in database
GPG Key ID: 7BD6DC99C9A87E22

View File

@ -363,10 +363,20 @@ def generate_code(request, response):
inits.add(base)
for base in inits:
name = os.path.join(base, "__init__.py")
if os.path.exists(name):
# Never overwrite inits as they may have custom stuff in them.
continue
init = response.file.add()
init.name = os.path.join(base, "__init__.py")
init.name = name
init.content = b""
filenames = sorted([f.name for f in response.file])
for fname in filenames:
print(f"Writing {fname}", file=sys.stderr)
def main():
"""The plugin's main entry point."""