-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
88 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,5 @@ law.cli | |
completion | ||
config | ||
software | ||
quickstart | ||
luigid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
law.cli.luigid | ||
============== | ||
|
||
.. automodule:: law.cli.luigid | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
law.cli.quickstart | ||
================== | ||
|
||
.. automodule:: law.cli.quickstart | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# coding: utf-8 | ||
|
||
""" | ||
"law luigid" cli subprogram. | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
import argparse | ||
|
||
from law.config import Config | ||
|
||
|
||
def setup_parser(sub_parsers: argparse._SubParsersAction) -> None: | ||
""" | ||
Sets up the command line parser for the *luigid* subprogram and adds it to *sub_parsers*. | ||
This is identical to running ``luigid`` directly from the command line, but this also loads the | ||
law config prior to starting the scheduler process and optionally syncrhonizes it with luigi's | ||
config. | ||
""" | ||
parser = sub_parsers.add_parser( | ||
"luigid", | ||
prog="law luigid", | ||
description="Starts the 'luigid' central scheduler.", | ||
add_help=False, | ||
) | ||
|
||
parser.add_argument( | ||
"arguments", | ||
nargs="*", | ||
help="luigid arguments", | ||
) | ||
|
||
|
||
def execute(args: argparse.Namespace, argv: list[str]) -> int: | ||
""" | ||
Initializes the law config object and executes the *luigid* subprogram with parsed commandline | ||
*args*. | ||
""" | ||
# initialize the config | ||
Config.instance() | ||
|
||
# forward to luigid | ||
from luigi.cmdline import luigid # type: ignore[import-untyped] | ||
luigid(argv[2:]) | ||
|
||
return 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters