File: livereload

package info (click to toggle)
python-livereload 2.7.1-0.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 348 kB
  • sloc: javascript: 1,041; python: 823; makefile: 169
file content (19 lines) | stat: -rwxr-xr-x 534 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/python3
import sys
import os
sys.path.insert(0, os.environ['PWD'])
from importlib.metadata import distribution

def load_entry_point(spec, group, name):
    dist_name, _, _ = spec.partition('==')
    matches = (
        entry_point
        for entry_point in distribution(dist_name).entry_points
        if entry_point.group == group and entry_point.name == name
    )
    return next(matches).load()

if __name__ == '__main__':
    sys.exit(
        load_entry_point('livereload', 'console_scripts', 'livereload')()
    )