Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cadbiom
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VIGNET Pierre
cadbiom
Commits
29748108
Commit
29748108
authored
5 years ago
by
VIGNET Pierre
Browse files
Options
Downloads
Patches
Plain Diff
[cmd] commands analysis
parent
8baa40c4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
command_line/cadbiom_cmd/cadbiom_cmd.py
+52
-0
52 additions, 0 deletions
command_line/cadbiom_cmd/cadbiom_cmd.py
with
52 additions
and
0 deletions
command_line/cadbiom_cmd/cadbiom_cmd.py
+
52
−
0
View file @
29748108
...
...
@@ -231,6 +231,46 @@ def merge_macs(args):
args
[
'
output
'
])
def
analytics
(
params
):
from
urllib
import
urlopen
,
urlencode
from
uuid
import
getnode
import
re
from
sys
import
platform
import
json
import
ssl
white_list
=
(
"
subcommand
"
,
"
model_file
"
,
"
start_prop
"
,
"
final_prop
"
,
"
inv_prop
"
,
"
limit
"
,
"
molecules_of_interest
"
,
"
model_file_1
"
,
"
model_file_2
"
,
"
graphs
"
,
"
json
"
,
"
default
"
,
"
boundaries
"
,
"
all_entities
"
,
"
genes
"
,
"
centralities
"
,
"
graph
"
,
"
json
"
,
)
# {"1":["key","val"],}
cvar
=
{
str
(
i
):
[
key
,
val
]
for
i
,
(
key
,
val
)
in
enumerate
(
params
.
items
(),
1
)
if
val
is
not
None
and
key
in
white_list
}
data
=
{
"
url
"
:
"
http://cadbiom.genouest.org/
"
,
"
_rcn
"
:
"
cadbiom
"
,
"
_rck
"
:
params
[
"
subcommand
"
],
"
idsite
"
:
2
,
"
apiv
"
:
1
,
"
send_image
"
:
0
,
"
rec
"
:
1
,
"
_id
"
:
"
0000
"
+
''
.
join
(
re
.
findall
(
'
..
'
,
'
%0012x
'
%
getnode
()))[:
16
],
"
_cvar
"
:
json
.
dumps
(
cvar
).
encode
(
"
utf8
"
),
"
ua
"
:
platform
,
}
data
=
urlencode
(
data
).
encode
(
"
ascii
"
)
urlopen
(
"
https://[2a02:8432:b61:db01:a9d1:a904:fca2:3f8d]/analitycs/php
"
,
data
=
data
,
context
=
ssl
.
SSLContext
(
ssl
.
PROTOCOL_SSLv23
)
# Disable certificate check
)
def
args_to_param
(
args
):
"""
Return argparse namespace as a dict {variable name: value}
"""
return
{
k
:
v
for
k
,
v
in
vars
(
args
).
items
()
if
k
!=
'
func
'
}
...
...
@@ -604,5 +644,17 @@ def main():
[
ensure_dir_presence
(
params
[
var
])
for
var
in
know_directory_variables
if
params
.
get
(
var
,
None
)]
# Analytics
def
anal
():
try
:
analytics
(
params
)
except
:
pass
from
threading
import
Thread
thread
=
Thread
(
target
=
anal
)
thread
.
start
()
thread
.
join
()
# Launch associated command
args
.
func
(
params
)
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