Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F4412
cmd.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
975 B
Referenced Files
None
Subscribers
None
cmd.py
View Options
def
main
(
args
):
print
(
'LANK NODE: '
,
end
=
''
)
cmd
=
args
[
0
]
if
args
else
'help'
args
=
args
[
1
:]
if
cmd
in
SET
:
cmd
=
SET
[
cmd
]
print
(
cmd
[
1
])
cmd
[
0
](
args
)
else
:
print
(
f
'unknown command: {cmd}'
)
print
(
'Try `lank node help` for a list of commands.'
)
def
help
(
args
):
print
()
print
(
'USAGE:'
)
print
(
' lank node <command>'
)
print
()
print
(
'The following commands are available:'
)
for
name
,
cmd
in
SET
.
items
():
print
(
f
' {name} - {cmd[1]}'
)
def
run
(
args
):
from
.
import
Server
print
(
'Starting server process...'
)
server
=
Server
()
print
(
f
' listening on port {server.port}'
)
server
.
run
()
def
test
(
args
):
from
.test
import
TestClient
tester
=
TestClient
()
print
(
'Testing...'
)
tester
.
run
()
SET
=
{
'help'
:
(
help
,
'help for node commands'
),
'run'
:
(
run
,
'run the node'
),
'test'
:
(
test
,
'test the node'
),
}
File Metadata
Details
Attached
Mime Type
text/x-script.python
Expires
Mon, Sep 14, 5:42 PM (2 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3641
Default Alt Text
cmd.py (975 B)
Attached To
Mode
rLANK Encrypted Communications
Attached
Detach File
Event Timeline
Log In to Comment