Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
APK Vitrine
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Max Rees
APK Vitrine
Commits
b7183f21
Verified
Commit
b7183f21
authored
Dec 29, 2020
by
Max Rees
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lint
parent
5a081e1e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
24 deletions
+22
-24
apkvitrine/cgi.py
apkvitrine/cgi.py
+11
-13
apkvitrine/models.py
apkvitrine/models.py
+2
-2
apkvitrine/version.py
apkvitrine/version.py
+9
-9
No files found.
apkvitrine/cgi.py
View file @
b7183f21
...
...
@@ -287,13 +287,12 @@ def page_search(app):
return
[
page
]
def
page_home
(
app
):
app
.
redirect
(
app
.
conf
[
apkvitrine
.
DEFAULT
][
"default_version"
])
return
[]
return
app
.
redirect
(
app
.
conf
[
apkvitrine
.
DEFAULT
][
"default_version"
])
def
page_notfound
(
app
):
return
app
.
notfound
()
class
APKVitrineApp
:
class
APKVitrineApp
:
# pylint: disable=too-many-instance-attributes
routes
=
{
"-/versions"
:
page_branches
,
"-/builders"
:
page_builders
,
...
...
@@ -314,10 +313,9 @@ class APKVitrineApp:
"jinja"
,
"path"
,
"query"
,
"request"
,
)
def
__init__
(
self
,
cache
=
None
):
def
__init__
(
self
):
self
.
jinja
=
jinja2
.
Environment
(
loader
=
jinja2
.
PackageLoader
(
"apkvitrine"
,
"templates"
),
autoescape
=
True
,
...
...
@@ -339,6 +337,8 @@ class APKVitrineApp:
self
.
data
=
Path
(
self
.
conf
[
apkvitrine
.
DEFAULT
][
"data_dir"
])
self
.
_response
=
self
.
base
=
self
.
env
=
self
.
path
=
self
.
query
=
None
def
handle
(
self
,
env
,
response
):
self
.
env
=
env
self
.
_response
=
response
...
...
@@ -348,15 +348,13 @@ class APKVitrineApp:
self
.
query
=
urllib
.
parse
.
parse_qs
(
env
.
get
(
"QUERY_STRING"
,
""
))
self
.
query
=
{
i
:
j
[
-
1
]
for
i
,
j
in
self
.
query
.
items
()}
self
.
jinja
.
globals
[
"base"
]
=
self
.
base
# Used for pagination on search pages so that "page=x" isn't repeated
self
.
request
=
str
(
self
.
base
/
self
.
path
)
+
"?"
self
.
request
+=
urllib
.
parse
.
urlencode
(
self
.
jinja
.
globals
[
"request"
]
=
str
(
self
.
base
/
self
.
path
)
+
"?"
self
.
jinja
.
globals
[
"request"
]
+=
urllib
.
parse
.
urlencode
(
{
i
:
j
for
i
,
j
in
self
.
query
.
items
()
if
i
!=
"page"
}
)
self
.
jinja
.
globals
[
"base"
]
=
self
.
base
self
.
jinja
.
globals
[
"request"
]
=
self
.
request
page
=
self
.
cached_page
()
if
page
is
not
None
:
return
page
...
...
@@ -385,11 +383,10 @@ class APKVitrineApp:
if
not
self
.
query
:
self
.
ok
()
return
[
cache
.
read_bytes
()]
el
if
self
.
query
.
get
(
"purge"
)
==
"1"
:
if
self
.
query
.
get
(
"purge"
)
==
"1"
:
if
(
time
.
time
()
-
cache
.
stat
().
st_mtime
)
>
600
:
cache
.
unlink
()
self
.
redirect
(
self
.
base
/
self
.
path
)
return
[]
return
self
.
redirect
(
self
.
base
/
self
.
path
)
return
None
...
...
@@ -430,6 +427,7 @@ class APKVitrineApp:
http
.
HTTPStatus
.
TEMPORARY_REDIRECT
,
headers
=
[(
"Location"
,
str
(
self
.
base
/
location
))],
)
return
[]
if
__name__
==
"__main__"
:
app
=
APKVitrineApp
()
...
...
apkvitrine/models.py
View file @
b7183f21
...
...
@@ -333,7 +333,7 @@ def gl_strptime(s):
tzinfo
=
datetime
.
timezone
.
utc
,
).
timestamp
()
class
Builder
:
class
Builder
:
# pylint: disable=too-few-public-methods,too-many-instance-attributes
__slots__
=
(
"id"
,
"name"
,
...
...
@@ -355,7 +355,7 @@ class Builder:
self
.
seen
=
gl_strptime
(
data
.
get
(
"contacted_at"
))
self
.
running_job
=
self
.
success_job
=
self
.
fail_job
=
None
class
Job
:
class
Job
:
# pylint: disable=too-few-public-methods
__slots__
=
(
"id"
,
"pipeline"
,
...
...
apkvitrine/version.py
View file @
b7183f21
...
...
@@ -14,17 +14,17 @@ class APK_VER(enum.IntFlag):
FUZZY
=
8
APK_OPS
=
{
">="
:
APK_VER
.
GREATER
|
APK_VER
.
EQUAL
,
"<="
:
APK_VER
.
LESS
|
APK_VER
.
EQUAL
,
">~"
:
APK_VER
.
GREATER
|
APK_VER
.
EQUAL
,
"<~"
:
APK_VER
.
LESS
|
APK_VER
.
EQUAL
,
">"
:
APK_VER
.
GREATER
,
"<"
:
APK_VER
.
LESS
,
"="
:
APK_VER
.
EQUAL
,
"~"
:
APK_VER
.
EQUAL
,
">="
:
APK_VER
.
GREATER
|
APK_VER
.
EQUAL
,
"<="
:
APK_VER
.
LESS
|
APK_VER
.
EQUAL
,
">~"
:
APK_VER
.
GREATER
|
APK_VER
.
EQUAL
,
"<~"
:
APK_VER
.
LESS
|
APK_VER
.
EQUAL
,
">"
:
APK_VER
.
GREATER
,
"<"
:
APK_VER
.
LESS
,
"="
:
APK_VER
.
EQUAL
,
"~"
:
APK_VER
.
EQUAL
,
}
class
_apk_blob_t
(
ctypes
.
Structure
):
class
_apk_blob_t
(
ctypes
.
Structure
):
# pylint: disable=too-few-public-methods
_fields_
=
[
(
"len"
,
ctypes
.
c_long
),
(
"ptr"
,
ctypes
.
c_char_p
),
...
...
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