Skip to content

Commit

Permalink
Cleanup fastentrypoints code
Browse files Browse the repository at this point in the history
  • Loading branch information
epruesse committed Mar 20, 2018
1 parent f0b16e0 commit d3ec427
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions fastentrypoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def get_args(cls, dist, header=None):
"""
if header is None:
header = cls.get_header()
spec = str(dist.as_requirement())
for type_ in 'console', 'gui':
group = type_ + '_scripts'
for name, ep in dist.get_entry_map(group).items():
Expand All @@ -76,7 +75,6 @@ def get_args(cls, dist, header=None):

def main():
import os
import re
import shutil
import sys
dests = sys.argv[1:] or ['.']
Expand All @@ -91,17 +89,18 @@ def main():
with open(manifest_path, 'a+') as manifest:
manifest.seek(0)
manifest_content = manifest.read()
if not 'include fastentrypoints.py' in manifest_content:
if 'include fastentrypoints.py' not in manifest_content:
manifest.write(('\n' if manifest_content else '')
+ 'include fastentrypoints.py')

# Insert the import statement to setup.py if not present
with open(setup_path, 'a+') as setup:
setup.seek(0)
setup_content = setup.read()
if not 'import fastentrypoints' in setup_content:
if 'import fastentrypoints' not in setup_content:
setup.seek(0)
setup.truncate()
setup.write('import fastentrypoints\n' + setup_content)


print(__name__)

0 comments on commit d3ec427

Please sign in to comment.