genocide 151__tar.gz → 152__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- genocide-151/README.rst → genocide-152/MANUAL.rst +4 -5
- genocide-152/PKG-INFO +73 -0
- genocide-152/README.rst +56 -0
- {genocide-151 → genocide-152}/docs/about.rst +15 -0
- {genocide-151 → genocide-152}/docs/conf.py +1 -17
- {genocide-151 → genocide-152}/docs/index.rst +1 -1
- {genocide-151 → genocide-152}/docs/manual.rst +4 -11
- {genocide-151 → genocide-152}/docs/writings.rst +2 -2
- genocide-152/genocide/__init__.py +6 -0
- {genocide-151 → genocide-152}/genocide/__main__.py +76 -59
- genocide-152/genocide/broker.py +57 -0
- genocide-152/genocide/client.py +84 -0
- genocide-152/genocide/default.py +29 -0
- genocide-151/genocide/excepts.py → genocide-152/genocide/errors.py +40 -26
- genocide-152/genocide/event.py +54 -0
- genocide-152/genocide/handler.py +80 -0
- genocide-152/genocide/interface.py +68 -0
- {genocide-151 → genocide-152}/genocide/modules/__init__.py +8 -10
- genocide-152/genocide/modules/cmd.py +20 -0
- genocide-152/genocide/modules/dbg.py +25 -0
- genocide-152/genocide/modules/err.py +31 -0
- genocide-152/genocide/modules/flt.py +25 -0
- {genocide-151 → genocide-152}/genocide/modules/fnd.py +16 -7
- {genocide-151 → genocide-152}/genocide/modules/irc.py +162 -41
- {genocide-151 → genocide-152}/genocide/modules/log.py +21 -3
- genocide-152/genocide/modules/mbx.py +120 -0
- {genocide-151 → genocide-152}/genocide/modules/mdl.py +51 -38
- genocide-152/genocide/modules/mod.py +23 -0
- {genocide-151 → genocide-152}/genocide/modules/req.py +11 -1
- {genocide-151 → genocide-152}/genocide/modules/rss.py +195 -50
- {genocide-151 → genocide-152}/genocide/modules/rst.py +63 -33
- {genocide-151 → genocide-152}/genocide/modules/tdo.py +23 -6
- {genocide-151 → genocide-152}/genocide/modules/thr.py +11 -2
- genocide-152/genocide/modules/tmr.py +244 -0
- {genocide-151 → genocide-152}/genocide/modules/udp.py +30 -3
- genocide-151/genocide/objects.py → genocide-152/genocide/object.py +156 -132
- genocide-152/genocide/parser.py +75 -0
- genocide-151/genocide/storage.py → genocide-152/genocide/persist.py +63 -84
- genocide-152/genocide/repeater.py +31 -0
- genocide-151/genocide/threads.py → genocide-152/genocide/thread.py +27 -61
- genocide-152/genocide/timer.py +61 -0
- genocide-152/genocide/utils.py +68 -0
- genocide-152/genocide/workdir.py +48 -0
- genocide-152/genocide.egg-info/PKG-INFO +73 -0
- {genocide-151 → genocide-152}/genocide.egg-info/SOURCES.txt +17 -14
- {genocide-151 → genocide-152}/genocide.egg-info/entry_points.txt +0 -1
- {genocide-151 → genocide-152}/pyproject.toml +5 -5
- genocide-151/PKG-INFO +0 -205
- genocide-151/docs/source.rst +0 -56
- genocide-151/genocide/__init__.py +0 -61
- genocide-151/genocide/brokers.py +0 -49
- genocide-151/genocide/clients.py +0 -89
- genocide-151/genocide/command.py +0 -42
- genocide-151/genocide/handler.py +0 -94
- genocide-151/genocide/modules/cmd.py +0 -13
- genocide-151/genocide/modules/err.py +0 -22
- genocide-151/genocide/modules/flt.py +0 -16
- genocide-151/genocide/modules/mbx.py +0 -134
- genocide-151/genocide/modules/mod.py +0 -13
- genocide-151/genocide/modules/mre.py +0 -28
- genocide-151/genocide/modules/pwd.py +0 -22
- genocide-151/genocide/modules/slg.py +0 -15
- genocide-151/genocide/modules/tmr.py +0 -76
- genocide-151/genocide/modules/wsd.py +0 -196
- genocide-151/genocide/parsers.py +0 -279
- genocide-151/genocide.egg-info/PKG-INFO +0 -205
- {genocide-151 → genocide-152}/docs/ECHAabilify.png +0 -0
- {genocide-151 → genocide-152}/docs/ECHAclozapine.png +0 -0
- {genocide-151 → genocide-152}/docs/ECHAhaldol.png +0 -0
- {genocide-151 → genocide-152}/docs/ECHAzyprexa.png +0 -0
- {genocide-151 → genocide-152}/docs/OTP1.png +0 -0
- {genocide-151 → genocide-152}/docs/OTP2.png +0 -0
- {genocide-151 → genocide-152}/docs/_static/genocide.css +0 -0
- {genocide-151 → genocide-152}/docs/_templates/base.rst +0 -0
- {genocide-151 → genocide-152}/docs/_templates/class.rst +0 -0
- {genocide-151 → genocide-152}/docs/_templates/mine.rst +0 -0
- {genocide-151 → genocide-152}/docs/_templates/module.rst +0 -0
- {genocide-151 → genocide-152}/docs/arrest.png +0 -0
- {genocide-151 → genocide-152}/docs/banner.png +0 -0
- {genocide-151 → genocide-152}/docs/bevestigd.jpg +0 -0
- {genocide-151 → genocide-152}/docs/evidence.rst +0 -0
- {genocide-151 → genocide-152}/docs/genocide.png +0 -0
- {genocide-151 → genocide-152}/docs/guilty.rst +0 -0
- {genocide-151 → genocide-152}/docs/informed.jpg +0 -0
- {genocide-151 → genocide-152}/docs/kamer.png +0 -0
- {genocide-151 → genocide-152}/docs/pdf/EM_T04_OTP-CR-117_19.pdf +0 -0
- {genocide-151 → genocide-152}/docs/pdf/EM_T07_OTP-CR-117_19_001.pdf +0 -0
- {genocide-151 → genocide-152}/docs/pdf/Kamer.pdf +0 -0
- {genocide-151 → genocide-152}/docs/pdf/Rome-Statute.pdf +0 -0
- {genocide-151 → genocide-152}/docs/pdf/bevestigd.pdf +0 -0
- {genocide-151 → genocide-152}/docs/request.rst +0 -0
- {genocide-151 → genocide-152}/docs/skull.jpg +0 -0
- {genocide-151 → genocide-152}/docs/skull3.png +0 -0
- {genocide-151 → genocide-152}/docs/verbatim.rst +0 -0
- {genocide-151 → genocide-152}/docs/verbatim2.png +0 -0
- {genocide-151 → genocide-152}/docs/wallpaper.png +0 -0
- {genocide-151 → genocide-152}/genocide.egg-info/dependency_links.txt +0 -0
- {genocide-151 → genocide-152}/genocide.egg-info/requires.txt +0 -0
- {genocide-151 → genocide-152}/genocide.egg-info/top_level.txt +0 -0
- {genocide-151 → genocide-152}/genocide.egg-info/zip-safe +0 -0
- {genocide-151 → genocide-152}/setup.cfg +0 -0
- {genocide-151 → genocide-152}/setup.py +0 -0
|
@@ -2,7 +2,7 @@ NAME
|
|
|
2
2
|
|
|
3
3
|
::
|
|
4
4
|
|
|
5
|
-
GENOCIDE -
|
|
5
|
+
GENOCIDE - OTP-CR-117/19
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
SYNOPSIS
|
|
@@ -138,7 +138,7 @@ SYSTEMD
|
|
|
138
138
|
|
|
139
139
|
|
|
140
140
|
[Unit]
|
|
141
|
-
Description
|
|
141
|
+
Description=OTP-CR-117/19
|
|
142
142
|
Requires=network-online.target
|
|
143
143
|
After=network-online.target
|
|
144
144
|
|
|
@@ -147,11 +147,11 @@ SYSTEMD
|
|
|
147
147
|
User=<user>
|
|
148
148
|
Group=<user>
|
|
149
149
|
WorkingDirectory=/home/<user>/.genocide
|
|
150
|
-
ExecStart=/home/<user>/.local/pipx/venvs/genocide/bin/
|
|
150
|
+
ExecStart=/home/<user>/.local/pipx/venvs/genocide/bin/genocide -d
|
|
151
151
|
RemainAfterExit=yes
|
|
152
152
|
|
|
153
153
|
[Install]
|
|
154
|
-
WantedBy=
|
|
154
|
+
WantedBy=default.target
|
|
155
155
|
|
|
156
156
|
|
|
157
157
|
then run this
|
|
@@ -168,7 +168,6 @@ FILES
|
|
|
168
168
|
|
|
169
169
|
~/.genocide
|
|
170
170
|
~/.local/bin/genocide
|
|
171
|
-
~/.local/bin/genocided
|
|
172
171
|
~/.local/pipx/venvs/genocide/
|
|
173
172
|
|
|
174
173
|
|
genocide-152/PKG-INFO
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: genocide
|
|
3
|
+
Version: 152
|
|
4
|
+
Summary: OTP-CR-117/19
|
|
5
|
+
Author-email: Bart Thate <bthate@dds.nl>
|
|
6
|
+
License: Public Domain
|
|
7
|
+
Project-URL: home, https://pypi.org/project/genocide
|
|
8
|
+
Project-URL: bugs, https://github.com/bthate/genocide/issues
|
|
9
|
+
Project-URL: source, https://github.com/bthate/genocide
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: License :: Public Domain
|
|
12
|
+
Classifier: Operating System :: Unix
|
|
13
|
+
Classifier: Programming Language :: Python
|
|
14
|
+
Classifier: Topic :: Utilities
|
|
15
|
+
Description-Content-Type: text/x-rst
|
|
16
|
+
Provides-Extra: dev
|
|
17
|
+
|
|
18
|
+
| **Information and Evidence Unit**
|
|
19
|
+
| **Office of the Prosecutor**
|
|
20
|
+
| **Post Office Box 19519**
|
|
21
|
+
| **2500 CM The Hague**
|
|
22
|
+
| **The Netherlands** ``OTP-CR-117/19``
|
|
23
|
+
|
|
|
24
|
+
|
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
Hello Office of the Prosecutor,
|
|
28
|
+
|
|
29
|
+
i write you in the context of communications and claims under art.15 of
|
|
30
|
+
the Rome Statute. i want to inform the prosecutor that the king of the
|
|
31
|
+
netherlands and his government are commiting 3 of the 5 crimes defined
|
|
32
|
+
in the Rome Statute.
|
|
33
|
+
|
|
34
|
+
The dutch government has introduced three new forced care laws, the Wfz
|
|
35
|
+
(wet forensische zorg) for criminals, the WvGGZ (Wet verplichte GGZ) for
|
|
36
|
+
the disturbed and addicted and the Wzd (Wet zorg en dwang) for the
|
|
37
|
+
handicapped.
|
|
38
|
+
|
|
39
|
+
Both the chamber suggesting these laws to the king and the king himself
|
|
40
|
+
have been informed about the fact the the substances administered under
|
|
41
|
+
these laws are proven to be poison.
|
|
42
|
+
|
|
43
|
+
There is proof the medication used in forced treatements in the
|
|
44
|
+
netherlands are poison, see copies of the ECHA <`European Chemical Agency`>
|
|
45
|
+
website for:
|
|
46
|
+
|
|
47
|
+
(1) haldol <haldol>
|
|
48
|
+
(2) clozapine <clozapine>
|
|
49
|
+
(3) zyprexa <zyprexa>
|
|
50
|
+
(4) abilify <abilify>
|
|
51
|
+
|
|
52
|
+
With the mass scale torture with poison the king of the netherlands and
|
|
53
|
+
his chamber:
|
|
54
|
+
|
|
55
|
+
(1) kills
|
|
56
|
+
(2) does grave bodily and mental harm
|
|
57
|
+
(3) makes impotent
|
|
58
|
+
|
|
59
|
+
on the following victim groups here in the Netherlands:
|
|
60
|
+
|
|
61
|
+
(1) verslaafden (addicts)
|
|
62
|
+
(2) bejaarden (elderly)
|
|
63
|
+
(3) ggz patienten (psychiatric patients)
|
|
64
|
+
(4) criminelen (criminials)
|
|
65
|
+
(5) gehandicapten (handicapped)
|
|
66
|
+
|
|
67
|
+
Since the members of the chamber <chamber> and the king <king>
|
|
68
|
+
were aware that these medicine are poison at the time they voted for this law
|
|
69
|
+
and the day the Wfz law took effect (1-1-2019), i ask the prosecutor to
|
|
70
|
+
prosecute the king for making the commiting of the above mentioned crimes
|
|
71
|
+
(killing, torture and impotent making) possible here in the netherlands in
|
|
72
|
+
the hope that it stops the mass torture with poison the king of the
|
|
73
|
+
netherlands and his government are doing.
|
genocide-152/README.rst
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
| **Information and Evidence Unit**
|
|
2
|
+
| **Office of the Prosecutor**
|
|
3
|
+
| **Post Office Box 19519**
|
|
4
|
+
| **2500 CM The Hague**
|
|
5
|
+
| **The Netherlands** ``OTP-CR-117/19``
|
|
6
|
+
|
|
|
7
|
+
|
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
Hello Office of the Prosecutor,
|
|
11
|
+
|
|
12
|
+
i write you in the context of communications and claims under art.15 of
|
|
13
|
+
the Rome Statute. i want to inform the prosecutor that the king of the
|
|
14
|
+
netherlands and his government are commiting 3 of the 5 crimes defined
|
|
15
|
+
in the Rome Statute.
|
|
16
|
+
|
|
17
|
+
The dutch government has introduced three new forced care laws, the Wfz
|
|
18
|
+
(wet forensische zorg) for criminals, the WvGGZ (Wet verplichte GGZ) for
|
|
19
|
+
the disturbed and addicted and the Wzd (Wet zorg en dwang) for the
|
|
20
|
+
handicapped.
|
|
21
|
+
|
|
22
|
+
Both the chamber suggesting these laws to the king and the king himself
|
|
23
|
+
have been informed about the fact the the substances administered under
|
|
24
|
+
these laws are proven to be poison.
|
|
25
|
+
|
|
26
|
+
There is proof the medication used in forced treatements in the
|
|
27
|
+
netherlands are poison, see copies of the ECHA <`European Chemical Agency`>
|
|
28
|
+
website for:
|
|
29
|
+
|
|
30
|
+
(1) haldol <haldol>
|
|
31
|
+
(2) clozapine <clozapine>
|
|
32
|
+
(3) zyprexa <zyprexa>
|
|
33
|
+
(4) abilify <abilify>
|
|
34
|
+
|
|
35
|
+
With the mass scale torture with poison the king of the netherlands and
|
|
36
|
+
his chamber:
|
|
37
|
+
|
|
38
|
+
(1) kills
|
|
39
|
+
(2) does grave bodily and mental harm
|
|
40
|
+
(3) makes impotent
|
|
41
|
+
|
|
42
|
+
on the following victim groups here in the Netherlands:
|
|
43
|
+
|
|
44
|
+
(1) verslaafden (addicts)
|
|
45
|
+
(2) bejaarden (elderly)
|
|
46
|
+
(3) ggz patienten (psychiatric patients)
|
|
47
|
+
(4) criminelen (criminials)
|
|
48
|
+
(5) gehandicapten (handicapped)
|
|
49
|
+
|
|
50
|
+
Since the members of the chamber <chamber> and the king <king>
|
|
51
|
+
were aware that these medicine are poison at the time they voted for this law
|
|
52
|
+
and the day the Wfz law took effect (1-1-2019), i ask the prosecutor to
|
|
53
|
+
prosecute the king for making the commiting of the above mentioned crimes
|
|
54
|
+
(killing, torture and impotent making) possible here in the netherlands in
|
|
55
|
+
the hope that it stops the mass torture with poison the king of the
|
|
56
|
+
netherlands and his government are doing.
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
.. _about:
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
.. raw:: html
|
|
5
|
+
|
|
6
|
+
<center>
|
|
7
|
+
<i>
|
|
8
|
+
By law, with the use of poison,
|
|
9
|
+
killing, torturing, castrating, destroying,
|
|
10
|
+
in whole or in part,
|
|
11
|
+
all elderly and all handicapped (Wzd), all criminals (Wfz)
|
|
12
|
+
and all psychiatric patients (WvGGZ)
|
|
13
|
+
here in the Netherlands
|
|
14
|
+
</i>
|
|
15
|
+
</center>
|
|
16
|
+
<br>
|
|
17
|
+
|
|
18
|
+
|
|
4
19
|
.. raw:: html
|
|
5
20
|
|
|
6
21
|
<br><br>
|
|
@@ -114,22 +114,6 @@ rst_prolog = '''.. image:: genocide.png
|
|
|
114
114
|
:height: 2.6cm
|
|
115
115
|
:target: index.html
|
|
116
116
|
|
|
117
|
-
|
|
118
|
-
.. raw:: html
|
|
119
|
-
|
|
120
|
-
<center>
|
|
121
|
-
<i>
|
|
122
|
-
By law, with the use of poison,
|
|
123
|
-
killing, torturing, castrating, destroying,
|
|
124
|
-
in whole or in part,
|
|
125
|
-
all elderly and all handicapped (Wzd), all criminals (Wfz)
|
|
126
|
-
and all psychiatric patients (WvGGZ)
|
|
127
|
-
here in the Netherlands
|
|
128
|
-
</i>
|
|
129
|
-
</center>
|
|
130
|
-
<br>
|
|
131
|
-
|
|
132
|
-
|
|
133
117
|
'''
|
|
134
118
|
|
|
135
119
|
rst_epilog = '''.. raw:: html
|
|
@@ -140,7 +124,7 @@ rst_epilog = '''.. raw:: html
|
|
|
140
124
|
<center>
|
|
141
125
|
<b>
|
|
142
126
|
|
|
143
|
-
:ref:`about <about>` - :ref:`writings <writings>` - :ref:`
|
|
127
|
+
:ref:`about <about>` - :ref:`writings <writings>` - :ref:`evidence <evidence>` - :ref:`guilty <guilty>` - :ref:`reconsider <reconsider>`
|
|
144
128
|
|
|
145
129
|
|
|
146
130
|
.. raw:: html
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
**NAME**
|
|
12
12
|
|
|
13
|
-
**GENOCIDE** -
|
|
13
|
+
**GENOCIDE** - OTP-CR-117/19
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
**INSTALL**
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
physical (contracted muscles) and
|
|
44
44
|
mental (make people hallucinate)
|
|
45
45
|
torture and kills members of the
|
|
46
|
-
victim groups
|
|
46
|
+
victim groups.
|
|
47
47
|
|
|
48
48
|
**GENOCIDE** contains :ref:`correspondence <writings>`
|
|
49
49
|
with the International Criminal Court,
|
|
@@ -174,11 +174,11 @@
|
|
|
174
174
|
User=<user>
|
|
175
175
|
Group=<user>
|
|
176
176
|
WorkingDirectory=/home/<user>/.genocide
|
|
177
|
-
ExecStart=/home/<user>/.local/pipx/venvs/genocide/bin/
|
|
177
|
+
ExecStart=/home/<user>/.local/pipx/venvs/genocide/bin/genocide -d
|
|
178
178
|
RemainAfterExit=yes
|
|
179
179
|
|
|
180
180
|
[Install]
|
|
181
|
-
WantedBy=
|
|
181
|
+
WantedBy=default.target
|
|
182
182
|
|
|
183
183
|
|
|
184
184
|
then run this
|
|
@@ -197,16 +197,9 @@
|
|
|
197
197
|
|
|
198
198
|
~/.genocide
|
|
199
199
|
~/.local/bin/genocide
|
|
200
|
-
~/.local/bin/genocided
|
|
201
200
|
~/.local/pipx/venvs/genocide/
|
|
202
201
|
|
|
203
202
|
|
|
204
|
-
**SOURCE**
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
source code is :ref:`here <source>`
|
|
208
|
-
|
|
209
|
-
|
|
210
203
|
**AUTHOR**
|
|
211
204
|
|
|
212
205
|
::
|
|
@@ -1,82 +1,79 @@
|
|
|
1
1
|
# This file is placed in the Public Domain.
|
|
2
2
|
#
|
|
3
|
-
# pylint: disable=C,R,W0212
|
|
3
|
+
# pylint: disable=C,R,W0105,W0212
|
|
4
|
+
# ruff: noqa: E402
|
|
4
5
|
|
|
5
6
|
|
|
6
|
-
"
|
|
7
|
+
"main"
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
import getpass
|
|
10
|
-
import inspect
|
|
11
11
|
import os
|
|
12
12
|
import pwd
|
|
13
|
-
import readline
|
|
14
13
|
import sys
|
|
15
14
|
import termios
|
|
16
15
|
import time
|
|
17
|
-
import _thread
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
from . import Client, Command, Default, Error, Event, Object, Storage
|
|
21
|
-
from . import cdir, cmnd, debug, forever, launch, parse_command, spl, scan
|
|
22
|
-
|
|
23
16
|
|
|
24
|
-
def __dir__():
|
|
25
|
-
return (
|
|
26
|
-
'Cfg',
|
|
27
|
-
'Console',
|
|
28
|
-
'daemon',
|
|
29
|
-
'daemoned',
|
|
30
|
-
'main',
|
|
31
|
-
'privileges',
|
|
32
|
-
'wrap',
|
|
33
|
-
'wrapped'
|
|
34
|
-
)
|
|
35
17
|
|
|
18
|
+
from .client import Client, cmnd
|
|
19
|
+
from .default import Default
|
|
20
|
+
from .errors import Errors,debug
|
|
21
|
+
from .event import Event
|
|
22
|
+
from .object import cdir
|
|
23
|
+
from .parser import parse_cmd
|
|
24
|
+
from .utils import spl
|
|
25
|
+
from .workdir import Workdir
|
|
36
26
|
|
|
37
|
-
__all__ = __dir__()
|
|
38
27
|
|
|
28
|
+
from . import modules
|
|
39
29
|
|
|
40
|
-
Cfg
|
|
41
|
-
Cfg.
|
|
42
|
-
Cfg.
|
|
43
|
-
Cfg.
|
|
44
|
-
Cfg.
|
|
45
|
-
|
|
30
|
+
Cfg = Default()
|
|
31
|
+
Cfg.mod = "cmd,mod"
|
|
32
|
+
Cfg.name = sys.argv[0].split(os.sep)[-2]
|
|
33
|
+
Cfg.dir = os.path.expanduser(f"~/.{Cfg.name}")
|
|
34
|
+
Cfg.pidfile = os.path.join(Cfg.wd, f"{Cfg.name}.pid")
|
|
35
|
+
Workdir.workdir = Cfg.dir
|
|
46
36
|
|
|
47
37
|
|
|
48
|
-
|
|
38
|
+
dte = time.ctime(time.time()).replace(" ", " ")
|
|
39
|
+
ext = os._exit
|
|
49
40
|
|
|
50
41
|
|
|
51
42
|
class Console(Client):
|
|
52
43
|
|
|
44
|
+
"Console"
|
|
45
|
+
|
|
53
46
|
def announce(self, txt):
|
|
54
|
-
|
|
47
|
+
"blind announce"
|
|
55
48
|
|
|
56
49
|
def callback(self, evt):
|
|
50
|
+
"run and wait for callback to finish."
|
|
57
51
|
Client.callback(self, evt)
|
|
58
|
-
evt.wait()
|
|
52
|
+
evt.wait(5.0)
|
|
59
53
|
|
|
60
54
|
def poll(self):
|
|
55
|
+
"reconstruct event from input."
|
|
61
56
|
evt = Event()
|
|
62
57
|
evt.orig = object.__repr__(self)
|
|
63
58
|
evt.txt = input("> ")
|
|
64
59
|
evt.type = "command"
|
|
65
60
|
return evt
|
|
66
61
|
|
|
67
|
-
def say(self,
|
|
62
|
+
def say(self, _channel, txt):
|
|
63
|
+
"say text in channel."
|
|
68
64
|
txt = txt.encode('utf-8', 'replace').decode()
|
|
69
65
|
print(txt)
|
|
70
66
|
|
|
71
67
|
|
|
72
68
|
def daemon(pidfile, verbose=False):
|
|
69
|
+
"fork into the background."
|
|
73
70
|
pid = os.fork()
|
|
74
71
|
if pid != 0:
|
|
75
|
-
|
|
72
|
+
ext(0)
|
|
76
73
|
os.setsid()
|
|
77
74
|
pid2 = os.fork()
|
|
78
75
|
if pid2 != 0:
|
|
79
|
-
|
|
76
|
+
ext(0)
|
|
80
77
|
if not verbose:
|
|
81
78
|
with open('/dev/null', 'r', encoding="utf-8") as sis:
|
|
82
79
|
os.dup2(sis.fileno(), sys.stdin.fileno())
|
|
@@ -93,21 +90,30 @@ def daemon(pidfile, verbose=False):
|
|
|
93
90
|
fds.write(str(os.getpid()))
|
|
94
91
|
|
|
95
92
|
|
|
96
|
-
def
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
93
|
+
def init(pkg, modstr, disable=""):
|
|
94
|
+
"start inits in modules."
|
|
95
|
+
mds = []
|
|
96
|
+
for modname in spl(modstr):
|
|
97
|
+
if modname in spl(disable):
|
|
98
|
+
continue
|
|
99
|
+
module = getattr(pkg, modname, None)
|
|
100
|
+
if not module:
|
|
101
|
+
continue
|
|
102
|
+
if "init" in dir(module):
|
|
103
|
+
module.init()
|
|
104
|
+
mds.append(module)
|
|
105
|
+
return mds
|
|
102
106
|
|
|
103
107
|
|
|
104
108
|
def privileges(username):
|
|
109
|
+
"lower privileges."
|
|
105
110
|
pwnam = pwd.getpwnam(username)
|
|
106
111
|
os.setgid(pwnam.pw_gid)
|
|
107
112
|
os.setuid(pwnam.pw_uid)
|
|
108
113
|
|
|
109
114
|
|
|
110
115
|
def wrap(func):
|
|
116
|
+
"restore terminal"
|
|
111
117
|
old2 = None
|
|
112
118
|
try:
|
|
113
119
|
old2 = termios.tcgetattr(sys.stdin.fileno())
|
|
@@ -122,34 +128,45 @@ def wrap(func):
|
|
|
122
128
|
termios.tcsetattr(sys.stdin.fileno(), termios.TCSADRAIN, old2)
|
|
123
129
|
|
|
124
130
|
|
|
131
|
+
"runtime"
|
|
132
|
+
|
|
133
|
+
|
|
125
134
|
def main():
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
135
|
+
"main code"
|
|
136
|
+
Workdir.skel()
|
|
137
|
+
Errors.enable(print)
|
|
138
|
+
parse_cmd(Cfg, " ".join(sys.argv[1:]))
|
|
139
|
+
result = None
|
|
140
|
+
if 'a' in Cfg.opts:
|
|
141
|
+
Cfg.mod = "," + ",".join(modules.__dir__())
|
|
132
142
|
if "v" in Cfg.opts:
|
|
133
|
-
dte = time.ctime(time.time()).replace(" ", " ")
|
|
134
143
|
debug(f"{Cfg.name.upper()} {Cfg.opts.upper()} started {dte}")
|
|
135
|
-
if "d" in Cfg.opts:
|
|
136
|
-
daemoned()
|
|
137
|
-
csl = Console()
|
|
138
144
|
if "h" in Cfg.opts:
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
if "
|
|
142
|
-
|
|
145
|
+
print(__doc__)
|
|
146
|
+
return result
|
|
147
|
+
if "d" in Cfg.opts:
|
|
148
|
+
Cfg.mod = ",".join(modules.__dir__())
|
|
149
|
+
Cfg.user = getpass.getuser()
|
|
150
|
+
daemon(Cfg.pidfile, "v" in Cfg.opts)
|
|
151
|
+
privileges(Cfg.user)
|
|
152
|
+
init(modules, Cfg.mod)
|
|
153
|
+
while 1:
|
|
154
|
+
time.sleep(1.0)
|
|
155
|
+
elif "c" in Cfg.opts:
|
|
156
|
+
init(modules, Cfg.mod)
|
|
157
|
+
csl = Console()
|
|
143
158
|
csl.start()
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
159
|
+
while 1:
|
|
160
|
+
time.sleep(1.0)
|
|
161
|
+
elif Cfg.otxt:
|
|
162
|
+
cmnd(Cfg.otxt, print)
|
|
163
|
+
return result
|
|
148
164
|
|
|
149
165
|
|
|
150
166
|
def wrapped():
|
|
167
|
+
"wrapped code"
|
|
151
168
|
wrap(main)
|
|
152
|
-
|
|
169
|
+
Errors.show()
|
|
153
170
|
|
|
154
171
|
|
|
155
172
|
if __name__ == "__main__":
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# This file is placed in the Public Domain.
|
|
2
|
+
#
|
|
3
|
+
# pylint: disable=C,R,W0105
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
"broker"
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
from .object import Object, keys, values
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
rpr = object.__repr__
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Broker:
|
|
16
|
+
|
|
17
|
+
"Broker"
|
|
18
|
+
|
|
19
|
+
objs = Object()
|
|
20
|
+
|
|
21
|
+
@staticmethod
|
|
22
|
+
def add(obj):
|
|
23
|
+
"add an object to the broker."
|
|
24
|
+
setattr(Broker.objs, rpr(obj), obj)
|
|
25
|
+
|
|
26
|
+
@staticmethod
|
|
27
|
+
def all():
|
|
28
|
+
"return all objects."
|
|
29
|
+
return values(Broker.objs)
|
|
30
|
+
|
|
31
|
+
@staticmethod
|
|
32
|
+
def first():
|
|
33
|
+
"return first object."
|
|
34
|
+
for key in keys(Broker.objs):
|
|
35
|
+
return getattr(Broker.objs, key)
|
|
36
|
+
|
|
37
|
+
@staticmethod
|
|
38
|
+
def get(orig):
|
|
39
|
+
"return object by origin (repr)"
|
|
40
|
+
return getattr(Broker.objs, orig, None)
|
|
41
|
+
|
|
42
|
+
@staticmethod
|
|
43
|
+
def remove(obj):
|
|
44
|
+
"remove object from broker"
|
|
45
|
+
delattr(Broker.objs, rpr(obj))
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
"interface"
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def __dir__():
|
|
52
|
+
return (
|
|
53
|
+
'Broker',
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
__all__ = __dir__()
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# This file is placed in the Public Domain.
|
|
2
|
+
#
|
|
3
|
+
# pylint: disable=C,R,W0105,W0718
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
"client"
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
from .broker import Broker
|
|
10
|
+
from .errors import Errors
|
|
11
|
+
from .event import Event
|
|
12
|
+
from .handler import Handler
|
|
13
|
+
from .object import Object
|
|
14
|
+
from .parser import parse_cmd
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class Client(Handler):
|
|
18
|
+
|
|
19
|
+
"Client"
|
|
20
|
+
|
|
21
|
+
cmds = Object()
|
|
22
|
+
|
|
23
|
+
def __init__(self):
|
|
24
|
+
Handler.__init__(self)
|
|
25
|
+
self.register("command", self.command)
|
|
26
|
+
Broker.add(self)
|
|
27
|
+
|
|
28
|
+
@staticmethod
|
|
29
|
+
def add(func):
|
|
30
|
+
"add command to client."
|
|
31
|
+
setattr(Client.cmds, func.__name__, func)
|
|
32
|
+
|
|
33
|
+
def announce(self, txt):
|
|
34
|
+
"announce text."
|
|
35
|
+
self.raw(txt)
|
|
36
|
+
|
|
37
|
+
def command(self, evt):
|
|
38
|
+
"check for and run a command."
|
|
39
|
+
parse_cmd(evt)
|
|
40
|
+
func = getattr(self.cmds, evt.cmd, None)
|
|
41
|
+
if func:
|
|
42
|
+
try:
|
|
43
|
+
func(evt)
|
|
44
|
+
self.show(evt)
|
|
45
|
+
except Exception as ex:
|
|
46
|
+
Errors.add(ex)
|
|
47
|
+
evt.ready()
|
|
48
|
+
|
|
49
|
+
def raw(self, txt):
|
|
50
|
+
"raw output."
|
|
51
|
+
|
|
52
|
+
def say(self, _channel, txt):
|
|
53
|
+
"say text in a channel."
|
|
54
|
+
self.raw(txt)
|
|
55
|
+
|
|
56
|
+
def show(self, evt):
|
|
57
|
+
"show results into a channel."
|
|
58
|
+
for txt in evt.result:
|
|
59
|
+
self.say(evt.channel, txt)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def cmnd(txt, out):
|
|
63
|
+
"do a command using the provided output function."
|
|
64
|
+
clt = Client()
|
|
65
|
+
clt.raw = out
|
|
66
|
+
evn = Event()
|
|
67
|
+
evn.orig = object.__repr__(clt)
|
|
68
|
+
evn.txt = txt
|
|
69
|
+
clt.command(evn)
|
|
70
|
+
evn.wait()
|
|
71
|
+
return evn
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
"interface"
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def __dir__():
|
|
78
|
+
return (
|
|
79
|
+
'Client',
|
|
80
|
+
'cmnd'
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
__all__ = __dir__()
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# This file is placed in the Public Domain.
|
|
2
|
+
#
|
|
3
|
+
# pylint: disable=C,R,W0105
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
"default"
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
from .object import Object
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class Default(Object):
|
|
13
|
+
|
|
14
|
+
"Default"
|
|
15
|
+
|
|
16
|
+
def __getattr__(self, key):
|
|
17
|
+
return self.__dict__.get(key, "")
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
"interface"
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def __dir__():
|
|
24
|
+
return (
|
|
25
|
+
'Default',
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
__all__ = __dir__()
|