Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
re6stnet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Milestones
Merge Requests
4
Merge Requests
4
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
re6stnet
Commits
b93c307c
Commit
b93c307c
authored
May 16, 2024
by
Tom Niget
Committed by
Tom Niget
Jun 14, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style: remove new-style class code from the Python2 days
parent
669df364
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
26 additions
and
26 deletions
+26
-26
draft/re6st-geo
draft/re6st-geo
+1
-1
re6st/cache.py
re6st/cache.py
+1
-1
re6st/ctl.py
re6st/ctl.py
+7
-7
re6st/debug.py
re6st/debug.py
+2
-2
re6st/multicast.py
re6st/multicast.py
+2
-2
re6st/registry.py
re6st/registry.py
+2
-2
re6st/tests/test_end2end/test_registry_client.py
re6st/tests/test_end2end/test_registry_client.py
+1
-1
re6st/tests/test_network/network_build.py
re6st/tests/test_network/network_build.py
+1
-1
re6st/tests/test_network/re6st_wrap.py
re6st/tests/test_network/re6st_wrap.py
+2
-2
re6st/tunnel.py
re6st/tunnel.py
+3
-3
re6st/upnpigd.py
re6st/upnpigd.py
+1
-1
re6st/utils.py
re6st/utils.py
+1
-1
re6st/x509.py
re6st/x509.py
+2
-2
No files found.
draft/re6st-geo
View file @
b93c307c
...
@@ -11,7 +11,7 @@ from re6st.registry import RegistryServer
...
@@ -11,7 +11,7 @@ from re6st.registry import RegistryServer
@
apply
@
apply
class
proxy
(
object
)
:
class
proxy
:
def
__init__
(
self
):
def
__init__
(
self
):
self
.
sock
=
socket
.
socket
(
socket
.
AF_INET6
,
socket
.
SOCK_DGRAM
)
self
.
sock
=
socket
.
socket
(
socket
.
AF_INET6
,
socket
.
SOCK_DGRAM
)
...
...
re6st/cache.py
View file @
b93c307c
...
@@ -3,7 +3,7 @@ from itertools import chain
...
@@ -3,7 +3,7 @@ from itertools import chain
from
.registry
import
RegistryClient
from
.registry
import
RegistryClient
from
.
import
utils
,
version
,
x509
from
.
import
utils
,
version
,
x509
class
Cache
(
object
)
:
class
Cache
:
def
__init__
(
self
,
db_path
,
registry
,
cert
:
x509
.
Cert
,
db_size
=
200
):
def
__init__
(
self
,
db_path
,
registry
,
cert
:
x509
.
Cert
,
db_size
=
200
):
self
.
_prefix
=
cert
.
prefix
self
.
_prefix
=
cert
.
prefix
...
...
re6st/ctl.py
View file @
b93c307c
...
@@ -5,7 +5,7 @@ from . import utils
...
@@ -5,7 +5,7 @@ from . import utils
uint16
=
struct
.
Struct
(
"!H"
)
uint16
=
struct
.
Struct
(
"!H"
)
header
=
struct
.
Struct
(
"!HI"
)
header
=
struct
.
Struct
(
"!HI"
)
class
Struct
(
object
)
:
class
Struct
:
def
__init__
(
self
,
format
,
*
args
):
def
__init__
(
self
,
format
,
*
args
):
if
args
:
if
args
:
...
@@ -29,7 +29,7 @@ class Struct(object):
...
@@ -29,7 +29,7 @@ class Struct(object):
self
.
encode
=
encode
self
.
encode
=
encode
self
.
decode
=
decode
self
.
decode
=
decode
class
Array
(
object
)
:
class
Array
:
def
__init__
(
self
,
item
):
def
__init__
(
self
,
item
):
self
.
_item
=
item
self
.
_item
=
item
...
@@ -49,7 +49,7 @@ class Array(object):
...
@@ -49,7 +49,7 @@ class Array(object):
r
.
append
(
x
)
r
.
append
(
x
)
return
o
,
r
return
o
,
r
class
String
(
object
)
:
class
String
:
@
staticmethod
@
staticmethod
def
encode
(
buffer
:
bytes
,
value
:
str
):
def
encode
(
buffer
:
bytes
,
value
:
str
):
...
@@ -61,7 +61,7 @@ class String(object):
...
@@ -61,7 +61,7 @@ class String(object):
return
i
+
1
,
buffer
[
offset
:
i
].
decode
(
"utf-8"
)
return
i
+
1
,
buffer
[
offset
:
i
].
decode
(
"utf-8"
)
class
Buffer
(
object
)
:
class
Buffer
:
def
__init__
(
self
):
def
__init__
(
self
):
self
.
_buf
=
bytearray
()
self
.
_buf
=
bytearray
()
...
@@ -114,7 +114,7 @@ class Buffer(object):
...
@@ -114,7 +114,7 @@ class Buffer(object):
struct
.
pack_into
(
self
.
_buf
,
offset
,
*
args
)
struct
.
pack_into
(
self
.
_buf
,
offset
,
*
args
)
class
Packet
(
object
)
:
class
Packet
:
response_dict
=
{}
response_dict
=
{}
...
@@ -167,7 +167,7 @@ class ConnectionClosed(BabelException):
...
@@ -167,7 +167,7 @@ class ConnectionClosed(BabelException):
return
"connection to babeld closed (%s)"
%
self
.
args
return
"connection to babeld closed (%s)"
%
self
.
args
class
Babel
(
object
)
:
class
Babel
:
_decode
=
None
_decode
=
None
...
@@ -295,7 +295,7 @@ class Babel(object):
...
@@ -295,7 +295,7 @@ class Babel(object):
pass
pass
class
iterRoutes
(
object
)
:
class
iterRoutes
:
_waiting
=
True
_waiting
=
True
...
...
re6st/debug.py
View file @
b93c307c
import
errno
,
os
,
socket
,
stat
,
threading
import
errno
,
os
,
socket
,
stat
,
threading
class
Socket
(
object
)
:
class
Socket
:
def
__init__
(
self
,
socket
):
def
__init__
(
self
,
socket
):
# In case that the default timeout is not None.
# In case that the default timeout is not None.
...
@@ -45,7 +45,7 @@ class Socket(object):
...
@@ -45,7 +45,7 @@ class Socket(object):
return
False
return
False
class
Console
(
object
)
:
class
Console
:
def
__init__
(
self
,
path
,
pdb
):
def
__init__
(
self
,
path
,
pdb
):
self
.
path
=
path
self
.
path
=
path
...
...
re6st/multicast.py
View file @
b93c307c
...
@@ -43,7 +43,7 @@ freeifaddrs = libc.freeifaddrs
...
@@ -43,7 +43,7 @@ freeifaddrs = libc.freeifaddrs
freeifaddrs
.
restype
=
None
freeifaddrs
.
restype
=
None
freeifaddrs
.
argtypes
=
[
POINTER
(
struct_ifaddrs
)]
freeifaddrs
.
argtypes
=
[
POINTER
(
struct_ifaddrs
)]
class
unpacker
(
object
)
:
class
unpacker
:
def
__init__
(
self
,
buf
):
def
__init__
(
self
,
buf
):
self
.
_buf
=
buf
self
.
_buf
=
buf
...
@@ -55,7 +55,7 @@ class unpacker(object):
...
@@ -55,7 +55,7 @@ class unpacker(object):
self
.
_offset
+=
s
.
size
self
.
_offset
+=
s
.
size
return
result
return
result
class
PimDm
(
object
)
:
class
PimDm
:
def
__init__
(
self
):
def
__init__
(
self
):
s_netlink
=
socket
(
AF_NETLINK
,
SOCK_RAW
,
NETLINK_ROUTE
)
s_netlink
=
socket
(
AF_NETLINK
,
SOCK_RAW
,
NETLINK_ROUTE
)
...
...
re6st/registry.py
View file @
b93c307c
...
@@ -51,7 +51,7 @@ class HTTPError(Exception):
...
@@ -51,7 +51,7 @@ class HTTPError(Exception):
pass
pass
class
RegistryServer
(
object
)
:
class
RegistryServer
:
peers
=
0
,
()
peers
=
0
,
()
cert_duration
=
365
*
86400
cert_duration
=
365
*
86400
...
@@ -795,7 +795,7 @@ class RegistryServer(object):
...
@@ -795,7 +795,7 @@ class RegistryServer(object):
return
json
.
dumps
({
k
:
list
(
v
)
for
k
,
v
in
graph
.
items
()})
return
json
.
dumps
({
k
:
list
(
v
)
for
k
,
v
in
graph
.
items
()})
class
RegistryClient
(
object
)
:
class
RegistryClient
:
_hmac
=
None
_hmac
=
None
user_agent
=
"re6stnet/%s, %s"
%
(
version
.
version
,
platform
.
platform
())
user_agent
=
"re6stnet/%s, %s"
%
(
version
.
version
,
platform
.
platform
())
...
...
re6st/tests/test_end2end/test_registry_client.py
View file @
b93c307c
...
@@ -15,7 +15,7 @@ from re6st.tests import DEMO_PATH
...
@@ -15,7 +15,7 @@ from re6st.tests import DEMO_PATH
DH_FILE
=
DEMO_PATH
/
"dh2048.pem"
DH_FILE
=
DEMO_PATH
/
"dh2048.pem"
class
DummyNode
(
object
)
:
class
DummyNode
:
"""fake node to reuse Re6stRegistry
"""fake node to reuse Re6stRegistry
error: node.Popen has destory method which not in subprocess.Popen
error: node.Popen has destory method which not in subprocess.Popen
...
...
re6st/tests/test_network/network_build.py
View file @
b93c307c
...
@@ -50,7 +50,7 @@ class Node(nemu.Node):
...
@@ -50,7 +50,7 @@ class Node(nemu.Node):
if_s
.
add_v4_address
(
ip
,
prefix_len
=
prefix_len
)
if_s
.
add_v4_address
(
ip
,
prefix_len
=
prefix_len
)
return
if_s
return
if_s
class
NetManager
(
object
)
:
class
NetManager
:
"""contain all the nemu object created, so they can live more time"""
"""contain all the nemu object created, so they can live more time"""
def
__init__
(
self
):
def
__init__
(
self
):
self
.
object
=
[]
self
.
object
=
[]
...
...
re6st/tests/test_network/re6st_wrap.py
View file @
b93c307c
...
@@ -37,7 +37,7 @@ def ip_to_serial(ip6):
...
@@ -37,7 +37,7 @@ def ip_to_serial(ip6):
return
int
(
ip6
,
16
)
return
int
(
ip6
,
16
)
class
Re6stRegistry
(
object
)
:
class
Re6stRegistry
:
"""class run a re6st-registry service on a namespace"""
"""class run a re6st-registry service on a namespace"""
registry_seq
=
0
registry_seq
=
0
...
@@ -140,7 +140,7 @@ class Re6stRegistry(object):
...
@@ -140,7 +140,7 @@ class Re6stRegistry(object):
pass
pass
class
Re6stNode
(
object
)
:
class
Re6stNode
:
"""class run a re6stnet service on a namespace"""
"""class run a re6stnet service on a namespace"""
node_seq
=
0
node_seq
=
0
...
...
re6st/tunnel.py
View file @
b93c307c
...
@@ -59,7 +59,7 @@ class MultiGatewayManager(dict):
...
@@ -59,7 +59,7 @@ class MultiGatewayManager(dict):
except
:
except
:
pass
pass
class
Connection
(
object
)
:
class
Connection
:
_retry
=
0
_retry
=
0
serial
=
None
serial
=
None
...
@@ -132,7 +132,7 @@ class Connection(object):
...
@@ -132,7 +132,7 @@ class Connection(object):
self
.
open
()
self
.
open
()
return
0
return
0
class
TunnelKiller
(
object
)
:
class
TunnelKiller
:
state
=
None
state
=
None
...
@@ -186,7 +186,7 @@ class TunnelKiller(object):
...
@@ -186,7 +186,7 @@ class TunnelKiller(object):
locked
=
unlocking
=
lambda
_
:
None
locked
=
unlocking
=
lambda
_
:
None
class
BaseTunnelManager
(
object
)
:
class
BaseTunnelManager
:
# TODO: To minimize downtime when network parameters change, we should do
# TODO: To minimize downtime when network parameters change, we should do
# our best to not restart any process. Ideally, this list should be
# our best to not restart any process. Ideally, this list should be
...
...
re6st/upnpigd.py
View file @
b93c307c
...
@@ -7,7 +7,7 @@ class UPnPException(Exception):
...
@@ -7,7 +7,7 @@ class UPnPException(Exception):
pass
pass
class
Forwarder
(
object
)
:
class
Forwarder
:
"""
"""
External port is chosen randomly between 32768 & 49151 included.
External port is chosen randomly between 32768 & 49151 included.
"""
"""
...
...
re6st/utils.py
View file @
b93c307c
...
@@ -120,7 +120,7 @@ class ArgParser(argparse.ArgumentParser):
...
@@ -120,7 +120,7 @@ class ArgParser(argparse.ArgumentParser):
ca /etc/re6stnet/ca.crt"""
,
**
kw
)
ca /etc/re6stnet/ca.crt"""
,
**
kw
)
class
exit
(
object
)
:
class
exit
:
status
=
None
status
=
None
...
...
re6st/x509.py
View file @
b93c307c
...
@@ -84,7 +84,7 @@ class NewSessionError(Exception):
...
@@ -84,7 +84,7 @@ class NewSessionError(Exception):
pass
pass
class
Cert
(
object
)
:
class
Cert
:
def
__init__
(
self
,
ca
,
key
,
cert
=
None
):
def
__init__
(
self
,
ca
,
key
,
cert
=
None
):
self
.
ca_path
=
ca
self
.
ca_path
=
ca
...
@@ -176,7 +176,7 @@ class Cert(object):
...
@@ -176,7 +176,7 @@ class Cert(object):
PACKED_PROTOCOL
=
utils
.
packInteger
(
protocol
)
PACKED_PROTOCOL
=
utils
.
packInteger
(
protocol
)
class
Peer
(
object
)
:
class
Peer
:
"""
"""
UDP: A ─────────────────────────────────────────────> B
UDP: A ─────────────────────────────────────────────> B
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment