good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
chat
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
github
tinode
chat
Commits
57cfd261
Commit
57cfd261
authored
Sep 3, 2018
by
or-else
Browse files
Options
Downloads
Patches
Plain Diff
better version numbers
parent
dea0f0e5
Branches
Branches containing commit
Tags
v0.15.5
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tn-cli/tn-cli.py
+8
-4
8 additions, 4 deletions
tn-cli/tn-cli.py
with
8 additions
and
4 deletions
tn-cli/tn-cli.py
+
8
−
4
View file @
57cfd261
...
@@ -7,6 +7,8 @@ import argparse
...
@@ -7,6 +7,8 @@ import argparse
import
base64
import
base64
import
grpc
import
grpc
import
json
import
json
import
pkg_resources
import
platform
import
random
import
random
import
shlex
import
shlex
import
sys
import
sys
...
@@ -18,7 +20,8 @@ from tinode_grpc import pb
...
@@ -18,7 +20,8 @@ from tinode_grpc import pb
from
tinode_grpc
import
pbx
from
tinode_grpc
import
pbx
APP_NAME
=
"
tn-cli
"
APP_NAME
=
"
tn-cli
"
VERSION
=
"
0.15
"
APP_VERSION
=
"
0.15
"
LIB_VERSION
=
pkg_resources
.
get_distribution
(
"
tinode_grpc
"
).
version
# Dictionary wich contains lambdas to be executed when server response is received
# Dictionary wich contains lambdas to be executed when server response is received
onCompletion
=
{}
onCompletion
=
{}
...
@@ -71,8 +74,9 @@ def encode_to_bytes(src):
...
@@ -71,8 +74,9 @@ def encode_to_bytes(src):
# Constructing individual messages
# Constructing individual messages
def
hiMsg
(
id
):
def
hiMsg
(
id
):
onCompletion
[
str
(
id
)]
=
lambda
params
:
print_server_params
(
params
)
onCompletion
[
str
(
id
)]
=
lambda
params
:
print_server_params
(
params
)
return
pb
.
ClientMsg
(
hi
=
pb
.
ClientHi
(
id
=
str
(
id
),
user_agent
=
APP_NAME
+
"
/
"
+
VERSION
+
"
gRPC-python
"
,
return
pb
.
ClientMsg
(
hi
=
pb
.
ClientHi
(
id
=
str
(
id
),
user_agent
=
APP_NAME
+
"
/
"
+
APP_VERSION
+
"
(
"
+
ver
=
VERSION
,
lang
=
"
EN
"
))
platform
.
system
()
+
"
/
"
+
platform
.
release
()
+
"
); gRPC-python/
"
+
LIB_VERSION
,
ver
=
LIB_VERSION
,
lang
=
"
EN
"
))
def
accMsg
(
id
,
user
,
scheme
,
secret
,
uname
,
password
,
do_login
,
fn
,
photo
,
private
,
auth
,
anon
,
tags
,
cred
):
def
accMsg
(
id
,
user
,
scheme
,
secret
,
uname
,
password
,
do_login
,
fn
,
photo
,
private
,
auth
,
anon
,
tags
,
cred
):
if
secret
==
None
and
uname
!=
None
:
if
secret
==
None
and
uname
!=
None
:
...
@@ -425,7 +429,7 @@ def print_server_params(params):
...
@@ -425,7 +429,7 @@ def print_server_params(params):
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
"""
Parse command-line arguments. Extract host name and authentication scheme, if one is provided
"""
"""
Parse command-line arguments. Extract host name and authentication scheme, if one is provided
"""
purpose
=
"
Tinode command line client. Version
"
+
VERSION
+
"
.
"
purpose
=
"
Tinode command line client. Version
"
+
APP_VERSION
+
"
/
"
+
LIB_
VERSION
+
"
.
"
print
(
purpose
)
print
(
purpose
)
parser
=
argparse
.
ArgumentParser
(
description
=
purpose
)
parser
=
argparse
.
ArgumentParser
(
description
=
purpose
)
parser
.
add_argument
(
'
--host
'
,
default
=
'
localhost:6061
'
,
help
=
'
address of Tinode server
'
)
parser
.
add_argument
(
'
--host
'
,
default
=
'
localhost:6061
'
,
help
=
'
address of Tinode server
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment