-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from d-chambers/gh-actions
Gh actions
- Loading branch information
Showing
8 changed files
with
384 additions
and
97 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
*~ | ||
\#* | ||
.#* | ||
*.egg-info/ | ||
*.exp | ||
*.lib | ||
*.obj | ||
*.pyc | ||
*.pyd.manifest | ||
*.pyo | ||
.cache | ||
.DS_Store | ||
.idea | ||
.project | ||
.pydevproject | ||
/.settings | ||
build/ | ||
dist/ | ||
__pycache__ | ||
debian | ||
# Temporary dir for the anaconda builds. | ||
misc/installer/anaconda/conda_builds | ||
.vscode/** |
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,4 +1,4 @@ | ||
# -*- coding: utf-8 -*- | ||
from .obspy_github_api import * | ||
|
||
__version__ = '0.0.0.dev' | ||
__version__ = "0.0.0.dev" |
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,52 @@ | ||
""" | ||
Command line Interface for obspy_github_api | ||
""" | ||
import json | ||
from typing import Optional | ||
|
||
import typer | ||
|
||
from obspy_github_api.obspy_github_api import make_ci_json_config | ||
|
||
app = typer.Typer() | ||
|
||
DEFAULT_CONFIG_PATH = "obspy_config/conf.json" | ||
|
||
|
||
@app.command() | ||
def make_config( | ||
issue_number: int, path: str = DEFAULT_CONFIG_PATH, token: Optional[str] = None | ||
): | ||
""" | ||
Create ObsPy's configuration json file for a particular issue. | ||
This command parses the comments in an issue's text looking for any magic | ||
strings (defined in ObsPy's issue template) and stores the values assigned | ||
to them to a json file for later use. | ||
The following names are stored in the config file: | ||
module_list - A string of requested modules separated by commas. | ||
module_list_spaces - A string of requested modules separated by spaces. | ||
docs - True if a doc build is requested. | ||
""" | ||
make_ci_json_config(issue_number, path=path, token=token) | ||
|
||
|
||
@app.command() | ||
def read_config_value(name: str, path: str = DEFAULT_CONFIG_PATH): | ||
""" | ||
Read a value from the configuration file. | ||
""" | ||
with open(path, "r") as fi: | ||
params = json.load(fi) | ||
value = params[name] | ||
print(value) | ||
return value | ||
|
||
|
||
def main(): | ||
app() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
Oops, something went wrong.