Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WorldWotMap
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Pascal Engélibert
WorldWotMap
Commits
d0a8929d
Verified
Commit
d0a8929d
authored
2 years ago
by
Pascal Engélibert
Browse files
Options
Downloads
Patches
Plain Diff
Cesiumplus fallbacks
parent
8d80db72
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
py/gencache.py
+28
-22
28 additions, 22 deletions
py/gencache.py
with
28 additions
and
22 deletions
py/gencache.py
+
28
−
22
View file @
d0a8929d
...
@@ -4,7 +4,7 @@ import plyvel, json, urllib.request, networkx, random, math, re, utils
...
@@ -4,7 +4,7 @@ import plyvel, json, urllib.request, networkx, random, math, re, utils
from
math
import
*
from
math
import
*
from
utils
import
*
from
utils
import
*
CESIUMPLUS_URL
=
"
https://g1.data.presles.fr
"
CESIUMPLUS_URL
=
"
https://g1.data.
le-sou.org,https://g1.data.e-is.pro,https://g1.data.adn.life,https://g1.data.
presles.fr
"
DUNITER_PATH
=
"
~/.config/duniter/duniter_default
"
DUNITER_PATH
=
"
~/.config/duniter/duniter_default
"
OUTPUT_PATH
=
"
www/data
"
OUTPUT_PATH
=
"
www/data
"
OVERLAY_PRECISION
=
"
0.5
"
OVERLAY_PRECISION
=
"
0.5
"
...
@@ -65,7 +65,7 @@ Duniter must not be running while extracting LevelDB data.
...
@@ -65,7 +65,7 @@ Duniter must not be running while extracting LevelDB data.
Only compatible with Duniter >=1.7.9.
Only compatible with Duniter >=1.7.9.
Options:
Options:
-c <url> Cesium+ URL (default={})
-c <url> Cesium+ URL
s separated by commas
(default={})
-d <path> Duniter profile path (default={})
-d <path> Duniter profile path (default={})
-e <path> Output dir (default={})
-e <path> Output dir (default={})
-o Do not generate image overlays
-o Do not generate image overlays
...
@@ -81,6 +81,8 @@ Options:
...
@@ -81,6 +81,8 @@ Options:
antispam
=
"
--spam
"
in
sys
.
argv
antispam
=
"
--spam
"
in
sys
.
argv
cesiumplus_urls
=
getargv
(
"
-c
"
,
CESIUMPLUS_URL
).
split
(
"
,
"
)
output_dir
=
format_path
(
getargv
(
"
-e
"
,
OUTPUT_PATH
))
output_dir
=
format_path
(
getargv
(
"
-e
"
,
OUTPUT_PATH
))
try
:
try
:
os
.
mkdir
(
output_dir
)
os
.
mkdir
(
output_dir
)
...
@@ -116,21 +118,24 @@ Options:
...
@@ -116,21 +118,24 @@ Options:
"
size
"
:
10000
,
"
size
"
:
10000
,
"
_source
"
:
[
"
title
"
,
"
geoPoint
"
,
"
avatar._content_type
"
]
"
_source
"
:
[
"
title
"
,
"
geoPoint
"
,
"
avatar._content_type
"
]
}
}
log
(
"
Request Cesium+
"
,
LOG_TRACE
)
for
cesiumplus_url
in
cesiumplus_urls
:
log
(
"
Request Cesium+ {}
"
.
format
(
cesiumplus_url
),
LOG_TRACE
)
try
:
try
:
resp
=
json
.
loads
(
urllib
.
request
.
urlopen
(
resp
=
json
.
loads
(
urllib
.
request
.
urlopen
(
getargv
(
"
-c
"
,
CESIUMPLUS_URL
)
+
"
/user/profile/_search?scroll=2m
"
,
cesiumplus_url
+
"
/user/profile/_search?scroll=2m
"
,
json
.
dumps
(
query
).
encode
()
json
.
dumps
(
query
).
encode
()
).
read
().
decode
())
).
read
().
decode
())
except
urllib
.
error
.
HTTPError
as
err
:
except
urllib
.
error
.
HTTPError
as
err
:
log
(
"
Cesium+ HTTP Error: {}
"
.
format
(
err
),
LOG_ERROR
)
log
(
"
Cesium+ HTTP Error: {}
"
.
format
(
err
),
LOG_ERROR
)
continue
results
+=
resp
[
"
hits
"
][
"
hits
"
]
results
+=
resp
[
"
hits
"
][
"
hits
"
]
scroll_id
=
resp
.
get
(
"
_scroll_id
"
)
scroll_id
=
resp
.
get
(
"
_scroll_id
"
)
for
i
in
range
(
100
):
for
i
in
range
(
100
):
log
(
"
Request Cesium+: scroll {}
"
.
format
(
i
),
LOG_TRACE
)
log
(
"
Request Cesium+: scroll {}
"
.
format
(
i
),
LOG_TRACE
)
try
:
try
:
resp
=
json
.
loads
(
urllib
.
request
.
urlopen
(
resp
=
json
.
loads
(
urllib
.
request
.
urlopen
(
getargv
(
"
-c
"
,
CESIUMPLUS_URL
)
+
"
/_search/scroll
"
,
cesiumplus_url
+
"
/_search/scroll
"
,
json
.
dumps
({
json
.
dumps
({
"
scroll
"
:
"
1m
"
,
"
scroll
"
:
"
1m
"
,
"
scroll_id
"
:
scroll_id
"
scroll_id
"
:
scroll_id
...
@@ -142,6 +147,7 @@ Options:
...
@@ -142,6 +147,7 @@ Options:
scroll_id
=
resp
.
get
(
"
scroll_id
"
)
scroll_id
=
resp
.
get
(
"
scroll_id
"
)
if
not
scroll_id
:
if
not
scroll_id
:
break
break
break
log
(
"
Cesium+ accounts: {}
"
.
format
(
len
(
results
)),
LOG_INFO
)
log
(
"
Cesium+ accounts: {}
"
.
format
(
len
(
results
)),
LOG_INFO
)
log
(
"
Opening DBs
"
)
log
(
"
Opening DBs
"
)
...
...
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