summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2024-01-15 16:46:07 +0100
committeremkael <emkael@tlen.pl>2024-01-15 18:14:15 +0100
commit7f1a1d696567052993c7095598ce20575e99557b (patch)
tree290b6ec88ca3bb15d178fc2b5119a41eda6b5116
parente63ee49096364cd2e56a6743b24dc4eee6aaee33 (diff)
Commands for event metadata manipulation
-rw-r--r--pysquaredeal.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/pysquaredeal.py b/pysquaredeal.py
index aee9fbf..25d1df1 100644
--- a/pysquaredeal.py
+++ b/pysquaredeal.py
@@ -14,6 +14,12 @@ argparser_create = subparsers.add_parser('create', help='create new SQD/SQK pair
argparser_create.add_argument('--event-name', required=False, metavar='EVENT_NAME', help='event name (description)')
argparser_create.add_argument('--delayed-information', required=False, metavar='DELAYED_INFO', help='(description of) delayed information')
+argparser_name = subparsers.add_parser('set_name', help='edit event name')
+argparser_name.add_argument('event_name', metavar='EVENT_NAME', help='event name (description)')
+
+argparser_di = subparsers.add_parser('set_di', help='edit event delayed information (or its value)')
+argparser_di.add_argument('delayed_information', metavar='DELAYED_INFO', help='(description of) delayed information')
+
arguments = argparser.parse_args()
if arguments.command == 'create':
@@ -21,3 +27,13 @@ if arguments.command == 'create':
sd.name = arguments.event_name
sd.delayed_info = arguments.delayed_information
sd.tofile(arguments.sqd_file, sqkpath=arguments.sqk_file)
+elif arguments.command == 'set_name':
+ sd = SquareDeal()
+ sd.fromfile(arguments.sqd_file, sqkpath=arguments.sqk_file)
+ sd.name = arguments.event_name
+ sd.tofile(arguments.sqd_file, sqkpath=arguments.sqk_file)
+elif arguments.command == 'set_di':
+ sd = SquareDeal()
+ sd.fromfile(arguments.sqd_file, sqkpath=arguments.sqk_file)
+ sd.delayed_info = arguments.delayed_information
+ sd.tofile(arguments.sqd_file, sqkpath=arguments.sqk_file)