-
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
Showing
180 changed files
with
192 additions
and
234 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 |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import click | ||
|
||
from rcdb.provider import RCDBProvider | ||
from .context import pass_rcdb_context | ||
|
||
|
||
@click.command() | ||
@click.argument('run_index', required=False) | ||
@click.argument('condition', required=False) | ||
@pass_rcdb_context | ||
def ls(context, run_index, condition): | ||
"""Lists conditions""" | ||
|
||
db = context.db | ||
assert isinstance(db, RCDBProvider) | ||
|
||
|
||
|
||
def show_value(db, run_number, name): | ||
""" | ||
Shows condition value for run | ||
:param db: RCDBProvider to database | ||
:type db: RCDBProvider | ||
:param run_number: The run number | ||
:param name: Condition type name | ||
:return: | ||
""" | ||
|
||
run = db.get_run(run_number) | ||
if not run: | ||
print("Run number '{}' is not found in DB".format(run_number)) | ||
exit(1) | ||
|
||
ct = db.get_condition_type(name) | ||
|
||
result = db.get_condition(run, ct) | ||
if not result: | ||
return | ||
|
||
condition = result | ||
print(condition.value) | ||
|
||
|
||
def show_run_conditions(db, run_number): | ||
""" | ||
:param db: RCDBProvider to database | ||
:type db: RCDBProvider | ||
:param run_number: The run number | ||
:return: | ||
""" | ||
|
||
run = db.get_run(run_number) | ||
if not run: | ||
print("Run number {} is not found in DB".format(run_number)) | ||
exit(1) | ||
|
||
conditions = db.session.query(Condition).join(Run).join(ConditionType) \ | ||
.order_by(asc(ConditionType.name)) \ | ||
.filter(Run.number == run_number) \ | ||
.all() | ||
|
||
for condition in conditions: | ||
condition_type = condition.type | ||
|
||
if condition_type.value_type in [ConditionType.INT_FIELD, | ||
ConditionType.BOOL_FIELD, | ||
ConditionType.FLOAT_FIELD]: | ||
print("{} = {}".format(condition_type.name, condition.value)) | ||
elif condition_type.value_type == ConditionType.STRING_FIELD: | ||
print("{} = '{}'".format(condition_type.name, condition.value)) | ||
else: | ||
# it is something big... | ||
value = str(condition.value).replace('\n', "")[:50] | ||
print("{} = ({}){}...".format(condition_type.name, condition_type.value_type, value)) |
File renamed without changes.
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,6 @@ | ||
from .conditions import mod as conditions_module | ||
from .files import mod as files_module | ||
from .logs import mod as logs_module | ||
from .runs import mod as runs_module | ||
from .select_values import mod as select_values_module | ||
from .statistics import mod as statistics_module |
File renamed without changes.
File renamed without changes.
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
2 changes: 1 addition & 1 deletion
2
rcdb_web/select_values/veiws.py → python/rcdb/web/modules/select_values.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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...1.10.10/css/dataTables.foundation.min.css → ...1.10.10/css/dataTables.foundation.min.css
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.