true-level-replication 0.10.4__py3-none-any.whl
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.
- replication/__init__.py +18 -0
- replication/constants.py +66 -0
- replication/exception.py +58 -0
- replication/interface.py +506 -0
- replication/net/__init__.py +658 -0
- replication/net.py +678 -0
- replication/objects.py +246 -0
- replication/porcelain.py +481 -0
- replication/protocol.py +245 -0
- replication/repository.py +338 -0
- replication/server.py +839 -0
- replication/ttl.py +72 -0
- replication/utils.py +44 -0
- true_level_replication-0.10.4.dist-info/METADATA +61 -0
- true_level_replication-0.10.4.dist-info/RECORD +20 -0
- true_level_replication-0.10.4.dist-info/WHEEL +5 -0
- true_level_replication-0.10.4.dist-info/entry_points.txt +2 -0
- true_level_replication-0.10.4.dist-info/licenses/LICENSE +695 -0
- true_level_replication-0.10.4.dist-info/licenses/NOTICE.md +19 -0
- true_level_replication-0.10.4.dist-info/top_level.txt +1 -0
replication/ttl.py
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
2
|
+
#
|
|
3
|
+
# This program is free software: you can redistribute it and/or modify
|
|
4
|
+
# it under the terms of the GNU General Public License as published by
|
|
5
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
6
|
+
# (at your option) any later version.
|
|
7
|
+
#
|
|
8
|
+
# This program is distributed in the hope that it will be useful,
|
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
11
|
+
# GNU General Public License for more details.
|
|
12
|
+
#
|
|
13
|
+
# You should have received a copy of the GNU General Public License
|
|
14
|
+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
15
|
+
#
|
|
16
|
+
# ##### END GPL LICENSE BLOCK #####
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
import argparse
|
|
20
|
+
import logging
|
|
21
|
+
import os
|
|
22
|
+
import sys
|
|
23
|
+
import uuid
|
|
24
|
+
from pathlib import Path
|
|
25
|
+
|
|
26
|
+
# REFACTOR: remove this in favor of a better env setup
|
|
27
|
+
replication_lib = Path(os.path.dirname(os.path.realpath(__file__)))
|
|
28
|
+
sys.path.append(str(replication_lib.parent))
|
|
29
|
+
sys.path.append(str(replication_lib.parent.parent))
|
|
30
|
+
|
|
31
|
+
from replication.constants import CONNECTION_TIMEOUT
|
|
32
|
+
from replication import net
|
|
33
|
+
|
|
34
|
+
logger = logging.getLogger(__name__)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def heartbeat(address="127.0.0.1", id=None, port=5562, timeout=CONNECTION_TIMEOUT):
|
|
38
|
+
command = net.Dealer(address, port, identity=uuid.UUID(id).bytes, role=net.ROLE_TTL)
|
|
39
|
+
command.connect()
|
|
40
|
+
loop_interval = timeout + 1000
|
|
41
|
+
|
|
42
|
+
command.send([b"INIT"])
|
|
43
|
+
logging.info("TTL running")
|
|
44
|
+
while True:
|
|
45
|
+
command.poll(loop_interval)
|
|
46
|
+
message = command.recv()
|
|
47
|
+
|
|
48
|
+
if message is not None:
|
|
49
|
+
command.send([b"PONG"])
|
|
50
|
+
else:
|
|
51
|
+
command.close()
|
|
52
|
+
exit(0)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
if __name__ == "__main__":
|
|
56
|
+
|
|
57
|
+
parser = argparse.ArgumentParser()
|
|
58
|
+
parser.add_argument("-p", "--port", required=True, help="port to listen")
|
|
59
|
+
parser.add_argument("-d", "--destination", required=True, help="address to listen")
|
|
60
|
+
parser.add_argument("-i", "--id", required=True, help="user id")
|
|
61
|
+
parser.add_argument(
|
|
62
|
+
"-t", "--timeout", required=True, help="timeout before disconnection"
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
args = parser.parse_args()
|
|
66
|
+
|
|
67
|
+
heartbeat(
|
|
68
|
+
port=int(args.port),
|
|
69
|
+
address=args.destination,
|
|
70
|
+
id=args.id,
|
|
71
|
+
timeout=int(args.timeout),
|
|
72
|
+
)
|
replication/utils.py
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
2
|
+
#
|
|
3
|
+
# This program is free software: you can redistribute it and/or modify
|
|
4
|
+
# it under the terms of the GNU General Public License as published by
|
|
5
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
6
|
+
# (at your option) any later version.
|
|
7
|
+
#
|
|
8
|
+
# This program is distributed in the hope that it will be useful,
|
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
11
|
+
# GNU General Public License for more details.
|
|
12
|
+
#
|
|
13
|
+
# You should have received a copy of the GNU General Public License
|
|
14
|
+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
15
|
+
#
|
|
16
|
+
# ##### END GPL LICENSE BLOCK #####
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
import time
|
|
20
|
+
from .constants import ADDED, COMMITED, PUSHED, FETCHED, UP, MODIFIED, ERROR
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def current_milli_time():
|
|
24
|
+
"""Retrieve current time in millisecond"""
|
|
25
|
+
return int(round(time.time() * 1000))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def get_state_str(state):
|
|
29
|
+
state_str = "UNKOWN"
|
|
30
|
+
if state == ADDED:
|
|
31
|
+
state_str = "ADDED"
|
|
32
|
+
elif state == COMMITED:
|
|
33
|
+
state_str = "COMMITED"
|
|
34
|
+
elif state == PUSHED:
|
|
35
|
+
state_str = "PUSHED"
|
|
36
|
+
elif state == FETCHED:
|
|
37
|
+
state_str = "FETCHED"
|
|
38
|
+
elif state == UP:
|
|
39
|
+
state_str = "UP"
|
|
40
|
+
elif state == MODIFIED:
|
|
41
|
+
state_str = "MODIFIED"
|
|
42
|
+
elif state == ERROR:
|
|
43
|
+
state_str = "ERROR"
|
|
44
|
+
return state_str
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: true-level-replication
|
|
3
|
+
Version: 0.10.4
|
|
4
|
+
Summary: True Level: Playblast fork of the replication object replication library
|
|
5
|
+
Author: True Level: Playblast maintainers
|
|
6
|
+
License-Expression: GPL-3.0-or-later
|
|
7
|
+
Project-URL: Homepage, https://gitlab.com/slumber/replication
|
|
8
|
+
Project-URL: Upstream, https://gitlab.com/slumber/replication
|
|
9
|
+
Project-URL: Fork, https://github.com/soilent-dev/true-level-playblast
|
|
10
|
+
Keywords: blender,replication,multi-user,playblast
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
15
|
+
Requires-Python: >=3.7
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
License-File: NOTICE.md
|
|
19
|
+
Requires-Dist: deepdiff==8.1.1
|
|
20
|
+
Dynamic: license-file
|
|
21
|
+
|
|
22
|
+
# true-level-replication
|
|
23
|
+
|
|
24
|
+
True Level: Playblast fork of the `replication` object replication library.
|
|
25
|
+
|
|
26
|
+
The PyPI distribution name is `true-level-replication`.
|
|
27
|
+
The import package remains `replication` so the Blender addon can keep its
|
|
28
|
+
existing imports:
|
|
29
|
+
|
|
30
|
+
```python
|
|
31
|
+
from replication.interface import session
|
|
32
|
+
from replication.repository import Repository
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Why this fork exists
|
|
36
|
+
|
|
37
|
+
The addon needs a transport/runtime variant that includes
|
|
38
|
+
`replication/net/__init__.py` and will later carry True Level specific
|
|
39
|
+
publication-policy and server-authority changes. For official Blender
|
|
40
|
+
extension distribution, bundled wheels must be unmodified wheels downloaded
|
|
41
|
+
from PyPI. This fork is therefore published as its own PyPI project and the
|
|
42
|
+
addon bundles the published wheel intact.
|
|
43
|
+
|
|
44
|
+
## Upstream
|
|
45
|
+
|
|
46
|
+
Upstream project: `replication` by Swann Martinez and contributors.
|
|
47
|
+
Upstream homepage: https://gitlab.com/slumber/replication
|
|
48
|
+
|
|
49
|
+
This fork preserves the GPL-3.0-or-later license and upstream attribution.
|
|
50
|
+
See `LICENSE` and `NOTICE.md`.
|
|
51
|
+
|
|
52
|
+
## Build
|
|
53
|
+
|
|
54
|
+
From the addon repository root:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
python3 tools/build_replication_fork.py --output dist/pkg01
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The script builds a valid pure-Python wheel with `RECORD` hashes. Publication
|
|
61
|
+
to PyPI is a separate, manual maintainer step.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
replication/__init__.py,sha256=yl1Ac8RBDTcnaZCuH8o1muTTDat63dy6Usu9M1XfSGw,757
|
|
2
|
+
replication/constants.py,sha256=hD5K8T6TENPDLrgAw2X1jssgiTipNNrQV0ZrghEtOU0,1791
|
|
3
|
+
replication/exception.py,sha256=U-FG42RCo0Qxz9QiKg7CZOoEu0ieQbEKgMnJubuwYzs,1352
|
|
4
|
+
replication/interface.py,sha256=LFcjHkviA6Zlvvfbk4Owj6-bie7J1hKZAj3Wam1HxVc,16821
|
|
5
|
+
replication/net.py,sha256=EFAVw2TuJ0m-hvj0NXVDkGHo62_0fy81qIxmWI_AK8c,24180
|
|
6
|
+
replication/objects.py,sha256=qqJRgf2gfRzQzt5gU2V0ST-gvH9S9_MYa9qqn_qynWU,5850
|
|
7
|
+
replication/porcelain.py,sha256=ZMivDguPSMFatfiWgKq4XRPuw58GeY8UD3bV-NLXR3U,16162
|
|
8
|
+
replication/protocol.py,sha256=6lkLyoEps8a38lyz8cfzyNHFOLzYqWZ0LlluRCDz4KE,8206
|
|
9
|
+
replication/repository.py,sha256=FgoJUbOUtcyIwh12d2TldtTyr25cWfqQCTIX_OlrsVk,10520
|
|
10
|
+
replication/server.py,sha256=aJwEMdahqab0LjEmlMQqMDuRLLapKzvz9bw7yMDE7zY,30862
|
|
11
|
+
replication/ttl.py,sha256=yb1owsPk9VtGpM2ooNIcl6YTSZfTt7bGbqRHgkHywnQ,2331
|
|
12
|
+
replication/utils.py,sha256=hhoKxrrN9wdRjqrCibHv-Im3tqvlHPBW8uWX3VP8VNw,1440
|
|
13
|
+
replication/net/__init__.py,sha256=jsjejNeOPp6ZIwDGCxXEwWPMzaLlnUpNnKPiYDAjpDA,23192
|
|
14
|
+
true_level_replication-0.10.4.dist-info/licenses/LICENSE,sha256=131o2C5xQP6ouAUrpr9q9drNu4TAE6FLJOTW68Z2xMI,35770
|
|
15
|
+
true_level_replication-0.10.4.dist-info/licenses/NOTICE.md,sha256=fB2MbFNZ2FJnZlfwvO4eg2AIRkzbaWmN2Q4rUNtaXJw,625
|
|
16
|
+
true_level_replication-0.10.4.dist-info/METADATA,sha256=wVW7_-WeXU3_pFJ3L2ZJxE9CfeD_5q1UzsqxK0FrEAY,2169
|
|
17
|
+
true_level_replication-0.10.4.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
18
|
+
true_level_replication-0.10.4.dist-info/entry_points.txt,sha256=yNwpGvqZCTMPFEr3be-8wgb_W-lyI6kAtpKAXh9efwc,62
|
|
19
|
+
true_level_replication-0.10.4.dist-info/top_level.txt,sha256=muoOaurCAg4yVff9giwfoMBMGYccH8Ps5IvA0HtJ_U8,12
|
|
20
|
+
true_level_replication-0.10.4.dist-info/RECORD,,
|