Przeglądaj źródła

added dialog column

Daniel-Constantin Mierla 8 lat temu
rodzic
commit
80618d2485
1 zmienionych plików z 51 dodań i 0 usunięć
  1. 51 0
      kamcli/commands/cmd_dialog.py

+ 51 - 0
kamcli/commands/cmd_dialog.py

@@ -0,0 +1,51 @@
+import click
+from sqlalchemy import create_engine
+from kamcli.ioutils import ioutils_dbres_print
+from kamcli.cli import pass_context
+from kamcli.cli import parse_user_spec
+from kamcli.iorpc import command_ctl
+
+
+##
+#
+#
[email protected]('dialog', help='Manage dialog module (active calls tracking)')
+@pass_context
+def cli(ctx):
+    pass
+
+
+##
+#
+#
[email protected]('showdb', short_help='Show dialog records in database')
[email protected]('oformat', '--output-format', '-F',
+                type=click.Choice(['raw', 'json', 'table', 'dict']),
+                default=None, help='Format the output')
[email protected]('ostyle', '--output-style', '-S',
+                default=None, help='Style of the output (tabulate table format)')
+@pass_context
+def dialog_showdb(ctx, oformat, ostyle):
+    """Show details for records in dialog table
+
+    \b
+    """
+    e = create_engine(ctx.gconfig.get('db', 'rwurl'))
+    ctx.vlog('Showing all dispatcher records')
+    res = e.execute('select * from dialog')
+    ioutils_dbres_print(ctx, oformat, ostyle, res)
+
+
+##
+#
+#
[email protected]('list', short_help='Show details for dialog records in memory')
+@pass_context
+def dialog_list(ctx):
+    """Show details for dialog records in memory
+
+    \b
+    """
+    command_ctl(ctx, 'dialog.list', [ ])
+
+