summaryrefslogtreecommitdiffstats
path: root/ogclient
Commit message (Collapse)AuthorAgeFilesLines
* #1065 Add event subcommand argumentsJose M. Guisado2021-11-301-0/+30
| | | | | | | | | | | | | | | | | | ogClient can be invoked with additional arguments to send event datagrams to the default event datagram socket at 127.0.0.1 port 55885. ogclient session events invokation syntax: ogclient event login foobar ogclient event logout foobar If event commands arguments are detected, ogclient sends the datagram and closes afterwards. Datagram syntax for session event is: session [start | stop] [user]
* #1065 revisit config_path initializationJose M. Guisado2021-11-181-1/+1
| | | | | | | If current platform is Linux (either live, virtual or linux) expect /opt/opengnsys/ogclient/cfg/ to contain ogclient.json. If current platform is not Linux then we fallback to current directory.
* #1065 Use logging module instead of syslogJose M. Guisado2021-11-181-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | We can't use syslog if we want to execute ogClient in the Windows platform. Use the native logging library so we can attach different handlers depending on the mode ogClient is executing. Logging configuration is done via a python dict. There is a different dict for linux and windows. These dicts define the configuration of the root logger, handlers and formatters used. As of now, it is only expected to use the root logger for everything logging related. The root logger is obtained via: LOGGER = logging.getLogger() More info about handlers, formatters and loggers: https://docs.python.org/3/howto/logging.html Logging configuration is done at startup, just after parsing the json (knowing ogclient mode). If json parsing goes bad, ogclient will only print a message to stdout.
* #1065 Avoid SIGPIPE errors in windows modeJose M. Guisado2021-11-171-2/+10
| | | | | | | | | | SIGPIPE is only available on Unix. Add try/except so that this import does not crash ogclient when running in Windows mode. Only assign SIG_DFL handler to SIGPIPE when mode is not windows. Prefer signal.signal over signal alone to better distinguish module from function.
* ogClient is AGPLv3+OpenGnSys Support Team2021-05-141-3/+3
| | | | Update license header in files.
* rename main.py to ogclientOpenGnSys Support Team2020-06-261-0/+36