Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
Nuovo sito
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
16
Issues
16
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gruppo Web
Nuovo sito
Commits
dabf31bc
Commit
dabf31bc
authored
Oct 09, 2023
by
shadMod
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replaced pkg_resources with os.path
parent
7cafc9c0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
uitwww/download.py
uitwww/download.py
+6
-10
No files found.
uitwww/download.py
View file @
dabf31bc
...
@@ -24,32 +24,28 @@ import collections
...
@@ -24,32 +24,28 @@ import collections
import
flask
import
flask
import
itsdangerous
import
itsdangerous
import
requests
import
requests
import
pkg_resources
from
.
import
cache
from
.
import
cache
from
.
import
launchpad
from
.
import
launchpad
CONFIG_FILE
=
"/data/downloads.toml"
CONFIG_FILE
=
"data/downloads.toml"
CACHE_FILE
=
"download-cache.json"
CACHE_FILE
=
"download-cache.json"
CACHE_FILE_VERSION
=
1
CACHE_FILE_VERSION
=
1
class
Downloads
:
class
Downloads
:
def
__init__
(
self
,
data_path
):
def
__init__
(
self
,
data_path
):
# Load the configuration
# Load the configuration
raw
=
pkg_resources
.
resource_string
(
"uitwww"
,
CONFIG_FILE
)
path
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
+
CONFIG_FILE
self
.
config
=
toml
.
loads
(
self
.
config
=
toml
.
load
(
raw
.
decode
(
"utf-8"
),
path
,
# _dict=collections.OrderedDict,
_dict
=
collections
.
OrderedDict
,
)
)
self
.
_strip_non_lts_releases
()
self
.
_strip_non_lts_releases
()
# Save the hash of the configuration
# Save the hash of the configuration
self
.
_config_hash
=
"sha1=%s"
%
hashlib
.
sha1
(
raw
).
hexdigest
()
with
open
(
path
,
"rb"
)
as
raw
:
self
.
_config_hash
=
"sha1=%s"
%
hashlib
.
sha1
(
raw
.
read
()).
hexdigest
()
self
.
_cache_file
=
os
.
path
.
join
(
data_path
,
CACHE_FILE
)
self
.
_cache_file
=
os
.
path
.
join
(
data_path
,
CACHE_FILE
)
@
property
@
property
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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