-
Notifications
You must be signed in to change notification settings - Fork 7
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
1 parent
4a34283
commit 009c629
Showing
6 changed files
with
43 additions
and
27 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
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 |
---|---|---|
@@ -1,22 +1,26 @@ | ||
from cli2gui import Cli2Gui | ||
import argparse | ||
|
||
from cli2gui import Cli2Gui | ||
|
||
|
||
def run(args): | ||
print(args.arg) | ||
print(args.arg) | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser(description="this is an example parser") | ||
parser.add_argument("--arg", type=str, default="foo", help="keyword arg") | ||
parser.add_argument("--bool", action='store_true', default=True, help="boolean arg") | ||
args = parser.parse_args() | ||
run(args) | ||
parser = argparse.ArgumentParser(description="this is an example parser") | ||
parser.add_argument("--arg", type=str, default="foo", help="keyword arg") | ||
parser.add_argument("--bool", action="store_true", default=True, help="boolean arg") | ||
args = parser.parse_args() | ||
run(args) | ||
|
||
|
||
decorator_function = Cli2Gui( | ||
run_function=run, | ||
auto_enable=True, | ||
run_function=run, | ||
auto_enable=True, | ||
) | ||
|
||
gui = decorator_function(main) | ||
|
||
if __name__ == "__main__": | ||
gui() | ||
gui() |