Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ideascube
ARCHIVED Kiwix Hotspot
Commits
6330aa98
Commit
6330aa98
authored
Aug 02, 2018
by
rgaudin
Browse files
Fixed selection of content in non-kiwix catalog
parent
608a6b19
Changes
1
Hide whitespace changes
Inline
Side-by-side
pibox-installer/backend/content.py
View file @
6330aa98
...
...
@@ -177,6 +177,7 @@ def get_package_content(package_id):
package
=
catalog
[
'all'
][
package_id
]
package
.
update
({
'ext'
:
"zip"
if
package
[
'type'
]
!=
'zim'
else
"zim"
})
package
.
update
({
'langid'
:
package
.
get
(
'langid'
)
or
package_id
})
return
{
"url"
:
package
[
'url'
],
"name"
:
"package_{langid}-{version}.{ext}"
.
format
(
**
package
),
...
...
@@ -186,13 +187,14 @@ def get_package_content(package_id):
"expanded_size"
:
package
[
'size'
]
*
1.1
if
package
[
'type'
]
!=
'zim'
else
package
[
'size'
],
}
except
Index
Error
:
except
Key
Error
:
continue
def
get_packages_contents
(
packages
=
[]):
''' ideacube: ZIM file or ZIP file for each package '''
return
[
get_package_content
(
package
)
for
package
in
packages
]
return
[
get_package_content
(
package
)
for
package
in
packages
if
get_package_content
(
package
)
is
not
None
]
def
extract_and_move
(
content
,
cache_folder
,
root_path
,
final_path
,
logger
):
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment