-
Notifications
You must be signed in to change notification settings - Fork 4
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
4 changed files
with
35 additions
and
5 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
python/quantmsio/quantms_io/commands/convert_tsv_to_json_command.py
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,25 @@ | ||
from quantms_io.core.tools import convert_to_json | ||
import click | ||
import os | ||
CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"]) | ||
|
||
|
||
@click.group(context_settings=CONTEXT_SETTINGS) | ||
def cli(): | ||
""" | ||
This is the main tool that gives access to all commands. | ||
""" | ||
|
||
|
||
@click.command("convert_tsv_to_json", short_help="Register the file to project.json.",) | ||
@click.option("--file", help="AE or DE file", required=True) | ||
@click.pass_context | ||
def convert_tsv_to_json(ctx,file): | ||
if not os.path.exists(file): | ||
raise click.UsageError("The file does not exist.") | ||
|
||
convert_to_json(file) | ||
|
||
cli.add_command(convert_tsv_to_json) | ||
if __name__ == '__main__': | ||
cli() |
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