-
Notifications
You must be signed in to change notification settings - Fork 6
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 #29 from ni/peterilberg-log-file-properties
Add methods to get/set log file description and test properties.
- Loading branch information
Showing
15 changed files
with
287 additions
and
13 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,26 @@ | ||
import os | ||
import sys | ||
|
||
from flexlogger.automation import Application | ||
|
||
|
||
def main(project_path): | ||
"""Launch FlexLogger, open a project, and get the log file description.""" | ||
with Application.launch() as app: | ||
project = app.open_project(path=project_path) | ||
logging_specification = project.open_logging_specification_document() | ||
log_file_description = logging_specification.get_log_file_description() | ||
print("Log file description: " + log_file_description) | ||
print("Press Enter to close the project...") | ||
input() | ||
project.close() | ||
return 0 | ||
|
||
|
||
if __name__ == "__main__": | ||
argv = sys.argv | ||
if len(argv) < 2: | ||
print("Usage: %s <path of project to open>" % os.path.basename(__file__)) | ||
sys.exit() | ||
project_path_arg = argv[1] | ||
sys.exit(main(project_path_arg)) |
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,28 @@ | ||
import os | ||
import sys | ||
|
||
from flexlogger.automation import Application | ||
|
||
|
||
def main(project_path): | ||
"""Launch FlexLogger, open a project, and get all test properties.""" | ||
with Application.launch() as app: | ||
project = app.open_project(path=project_path) | ||
logging_specification = project.open_logging_specification_document() | ||
test_properties = logging_specification.get_test_properties() | ||
for test_property in test_properties: | ||
prompt = "(prompt on start)" if test_property.prompt_on_start else "" | ||
print(f'{test_property.name}: {test_property.value} {prompt}') | ||
print("Press Enter to close the project...") | ||
input() | ||
project.close() | ||
return 0 | ||
|
||
|
||
if __name__ == "__main__": | ||
argv = sys.argv | ||
if len(argv) < 2: | ||
print("Usage: %s <path of project to open>" % os.path.basename(__file__)) | ||
sys.exit() | ||
project_path_arg = argv[1] | ||
sys.exit(main(project_path_arg)) |
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,26 @@ | ||
import os | ||
import sys | ||
|
||
from flexlogger.automation import Application | ||
|
||
|
||
def main(project_path): | ||
"""Launch FlexLogger, open a project, and set the log file description.""" | ||
with Application.launch() as app: | ||
project = app.open_project(path=project_path) | ||
log_file_description = input("Enter the log file description: ") | ||
logging_specification = project.open_logging_specification_document() | ||
logging_specification.set_log_file_description(log_file_description) | ||
print("Log file description set. Press Enter to close the project...") | ||
input() | ||
project.close() | ||
return 0 | ||
|
||
|
||
if __name__ == "__main__": | ||
argv = sys.argv | ||
if len(argv) < 2: | ||
print("Usage: %s <path of project to open>" % os.path.basename(__file__)) | ||
sys.exit() | ||
project_path_arg = argv[1] | ||
sys.exit(main(project_path_arg)) |
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,36 @@ | ||
import os | ||
import sys | ||
|
||
from flexlogger.automation import Application | ||
from flexlogger.automation import TestProperty | ||
|
||
|
||
def main(project_path): | ||
"""Launch FlexLogger, open a project, and set test properties.""" | ||
with Application.launch() as app: | ||
project = app.open_project(path=project_path) | ||
logging_specification = project.open_logging_specification_document() | ||
|
||
test_properties = [] | ||
while True: | ||
name = input("Enter the name of the test property to set the value of (empty line to exit): ") | ||
if name == "": | ||
break | ||
value = input("Enter the test property value: ") | ||
prompt_on_start = input("Enter if you want to prompt on start (y/n): ") == "y" | ||
test_properties.append(TestProperty(name, value, prompt_on_start)) | ||
|
||
logging_specification.set_test_properties(test_properties) | ||
print("Press Enter to close the project...") | ||
input() | ||
project.close() | ||
return 0 | ||
|
||
|
||
if __name__ == "__main__": | ||
argv = sys.argv | ||
if len(argv) < 2: | ||
print("Usage: %s <path of project to open>" % os.path.basename(__file__)) | ||
sys.exit() | ||
project_path_arg = argv[1] | ||
sys.exit(main(project_path_arg)) |
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
File renamed without changes.
12 changes: 6 additions & 6 deletions
12
...dLoggingPath/Logging Specification.flxcfg → ...pecification/Logging Specification.flxcfg
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.
Oops, something went wrong.