Debian Codegraph @

debian/livereload

raw
1 #!/usr/bin/python3
2 import sys
3 import os
4 sys.path.insert(0, os.environ['PWD'])
5 from importlib.metadata import distribution
6
7 def load_entry_point(spec, group, name):
8 dist_name, _, _ = spec.partition('==')
9 matches = (
10 entry_point
11 for entry_point in distribution(dist_name).entry_points
12 if entry_point.group == group and entry_point.name == name
13 )
14 return next(matches).load()
15
16 if __name__ == '__main__':
17 sys.exit(
18 load_entry_point('livereload', 'console_scripts', 'livereload')()
19 )