mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-06 01:05:48 +02:00
Entry point to run python on cmd line and from scripts
This commit is contained in:
12
__main__.py
12
__main__.py
@@ -20,6 +20,16 @@ def remote_control(args):
|
||||
main(args)
|
||||
|
||||
|
||||
def runpy(args):
|
||||
exec(' '.join(args[1:]))
|
||||
|
||||
|
||||
def launch(args):
|
||||
import runpy
|
||||
sys.argv = args[1:]
|
||||
runpy.run_path(args[1], run_name='__main__')
|
||||
|
||||
|
||||
def namespaced(args):
|
||||
func = namespaced_entry_points[args[1]]
|
||||
func(args[1:])
|
||||
@@ -29,6 +39,8 @@ entry_points = {
|
||||
# These two are here for backwards compat
|
||||
'icat': icat,
|
||||
'list-fonts': list_fonts,
|
||||
'runpy': runpy,
|
||||
'launch': launch,
|
||||
|
||||
'@': remote_control,
|
||||
'+': namespaced,
|
||||
|
||||
Reference in New Issue
Block a user