File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
pythonforandroid/recipes/libsodium Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 2
2
from pythonforandroid .util import current_directory
3
3
from pythonforandroid .logger import shprint , error
4
4
from multiprocessing import cpu_count
5
- import sh
6
-
7
5
from urllib .request import urlopen
8
- import json
9
6
from os import environ
7
+ import json
8
+ import sh
9
+
10
10
11
11
def get_libsodium_urls ():
12
12
"""
@@ -21,8 +21,8 @@ def get_libsodium_urls():
21
21
urls = {}
22
22
for release in releases :
23
23
version = release ['name' ]
24
+ file_name = 'libsodium-{}.tar.gz' .format (version )
24
25
for asset in release ['assets' ]:
25
- file_name = 'libsodium-{}.tar.gz' .format (version )
26
26
if asset ['name' ] == file_name :
27
27
download_url = asset ['browser_download_url' ]
28
28
urls [version ] = download_url .replace (version , '{version}' )
@@ -32,10 +32,11 @@ def get_libsodium_urls():
32
32
try :
33
33
URLS = get_libsodium_urls ()
34
34
except :
35
- message = 'failed to get libsodium repo assets '
35
+ message = 'failed to get libsodium url formats '
36
36
error (message )
37
37
raise Exception (message )
38
38
39
+
39
40
class LibsodiumRecipe (Recipe ):
40
41
env_version = environ .get ('VERSION_libsodium' )
41
42
if not env_version :
@@ -45,7 +46,7 @@ class LibsodiumRecipe(Recipe):
45
46
try :
46
47
url = URLS [version ]
47
48
except KeyError :
48
- message = ' libsodium {} not found in repo assets' .format (version )
49
+ message = " libsodium version '{}' not found" .format (version )
49
50
error (message )
50
51
raise Exception (message )
51
52
depends = []
You can’t perform that action at this time.
0 commit comments