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
Louis
pypimonitor
Commits
b9e0a029
Commit
b9e0a029
authored
May 21, 2016
by
Louis
Browse files
All plugins work
parent
ed5a1ccf
Changes
12
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
b9e0a029
...
...
@@ -5,10 +5,12 @@
* Name changed from "pypistats" to "pypimonitor".
* Use chartsjs.org to draw line charts (was morrisjs before).
* Package names are now case insensitive.
* Column/badges are extensible using plugins.
* New column/badge types:
* empty: empty column;
* link: hyperlin;
* html: raw html code;
* color: show the color of the line charts
* and more…
-- Louis Paternault <spalax@gresille.org>
...
...
TODO.md
View file @
b9e0a029
...
...
@@ -17,20 +17,20 @@
-
[ ] Document and add screenshot
-
[ ] Publish on framagit and pypi
-
[ ] Make an example documentation file
-
[ ] Add generation date to html page
-
[
] Add a square the exact same color os the line charts, on the left of each row. Make it a
`color`
plugin
-
[ ] Add generation date
and "built using XXX"
to html page
-
[
x
] Add a square the exact same color os the line charts, on the left of each row. Make it a
`color`
plugin
-
[x] Get rid of pkgtools
-
[
] load plugins using straightplugin ?
-
[
] Plugins have a
`type`
list, which list which type (docs, ci, etc.) they can match
-
[
] Add plugins
`html`
,
`img`
,
`shields`
, which can be of any type
-
[
]
`render()`
method of plugins is passed the type and the pypi slug
-
[
x
] load plugins using straightplugin ?
-
[
X
] Plugins have a
`type`
list, which list which type (docs, ci, etc.) they can match
-
[
x
] Add plugins
`html`
,
`img`
,
`shields`
, which can be of any type
-
[
x
]
`render()`
method of plugins is passed the type and the pypi slug
-
[ ] Plugins have an
`agnostic`
argument, stating if they can be used when no information is known about a package but its pypi name
-
[ ] localhost:PORT/index.html shows a form with text entries for pkg, usr, column if no valid package is given
-
[ ] Add an argument to Renderer to show the default data to put in form
-
[ ] If this argument is None, do not show forms
-
[x] pkg= usr= column= arguments can be comma separated lists
-
[
] Add a favicon
-
[
] Each plugin can access global and common options in global configuration
-
[
x
] Add a favicon
-
[
x
] Each plugin can access global and common options in global configuration
-
[ ] Add copyright information
-
[x] Create plugins
`empty`
,
`link`
,
`html`
-
[
] Remove obsolete templates
-
[
x
] Remove obsolete templates
examples/spalax.yaml
View file @
b9e0a029
default
:
gitlabci
:
server
:
http://
framagit.org
server
:
framagit.org
user
:
spalax
columns
:
-
color
...
...
@@ -15,6 +15,8 @@ packages:
argdispatch
:
cahier
:
chval
:
readthedocs
:
branch
:
next
devoir
:
dummypdf
:
evariste
:
...
...
@@ -24,21 +26,18 @@ packages:
mklog
:
papersize
:
patacrep
:
docs
:
column
:
readthedocs
gitlabci
:
column
:
travisci
user
:
patacrep
pdfautonup
:
docs
:
column
:
readthedocs
pdfimpose
:
pypimonitor
:
scal
:
squelette
:
sphinxcontrib-packages
:
docs
:
column
:
readthedocs
readthedocs
:
slug
:
packages
sphinxcontrib-proof
:
srsync
:
readthedocs
:
branch
:
python3
examples/test.yaml
View file @
b9e0a029
default
:
gitlabci
:
server
:
http://framagit.org
server
:
framagit.org
user
:
spalax
columns
:
-
color
-
homepage
...
...
@@ -15,9 +16,6 @@ packages:
argdispatch
:
html
:
html
:
"
Tagada
tsoin
tsoin"
papersize
:
html
:
column
:
"
empty"
pdfautonup
:
html
:
column
:
"
link"
...
...
@@ -26,3 +24,12 @@ packages:
column
:
"
link"
href
:
"
http://example.com"
content
:
"
Example"
sphinxcontrib-packages
:
readthedocs
:
slug
:
packages
html
:
column
:
"
empty"
patacrep
:
gitlabci
:
column
:
travisci
user
:
patacrep
pypimonitor/__init__.py
View file @
b9e0a029
...
...
@@ -135,7 +135,6 @@ class Renderer:
env
.
globals
[
'counter'
]
=
Counter
().
count
env
.
globals
[
'now'
]
=
datetime
.
datetime
.
now
()
env
.
filters
[
'datetime'
]
=
operator
.
methodcaller
(
'strftime'
,
"%Y-%m-%d %H:%M:%S"
)
env
.
filters
[
'as_id'
]
=
as_id
# TODO: Remove?
env
.
filters
[
'color'
]
=
random_color
return
env
...
...
pypimonitor/column/pypi.py
View file @
b9e0a029
...
...
@@ -2,3 +2,4 @@ from pypimonitor.column import Jinja2
class
Homepage
(
Jinja2
):
keyword
=
'homepage'
title
=
'Home'
pypimonitor/column/readthedocs.py
View file @
b9e0a029
...
...
@@ -3,3 +3,6 @@ from pypimonitor.column import Jinja2
class
Readthedocs
(
Jinja2
):
keyword
=
'readthedocs'
title
=
'Doc'
default
=
{
'lang'
:
'en'
,
}
pypimonitor/data/templates/columns/badgesio/pypiversion.html
View file @
b9e0a029
TODO
<a
href=
"{{ pypi.info.package_url }}"
>
<img
src=
"https://img.shields.io/pypi/v/{{ pypi.info.name }}.svg"
alt=
"Package version"
>
</a>
pypimonitor/data/templates/columns/gitlab/gitlabci.html
View file @
b9e0a029
TODO
<a
href=
"//{{ column.server }}/{{ column.user }}/{% if column.slug %}{{ column.slug }}{% else %}{{ package }}{% endif %}/builds"
>
<img
src=
"//{{ column.server }}/{{ column.user }}/{% if column.slug %}{{ column.slug }}{% else %}{{ package }}{% endif %}/badges/master/build.svg"
alt=
"Build"
>
</a>
pypimonitor/data/templates/columns/readthedocs.html
View file @
b9e0a029
<a
href=
"//{% if column.slug %}{{ column.slug }}{% else %}{{ package }}{% endif %}.readthedocs.io"
>
<a
href=
"//{% if column.slug %}{{ column.slug }}{% else %}{{ package }}{% endif %}.readthedocs.io
/{{ column.lang }}/{% if column.branch %}{{ column.branch }}{% endif %}
"
>
<img
src=
"//readthedocs.org/projects/{% if column.slug %}{{ column.slug }}{% else %}{{ package }}{% endif %}/badge/{% if column.branch %}?version={{ column.branch }}{% endif %}"
alt=
"Documentation"
>
</a>
pypimonitor/data/templates/columns/travisci.html
View file @
b9e0a029
TODO
<a
href=
"//travis-ci.org/{{ user }}/{% if column.slug %}{{ column.slug }}{% else %}{{ package }}{% endif %}"
>
<img
src=
"//api.travis-ci.org/{{ column.user }}/{% if column.slug %}{{ column.slug }}{% else %}{{ package }}{% endif %}.svg"
alt=
"Travis build"
>
</a>
pypimonitor/httpd/__main__.py
View file @
b9e0a029
...
...
@@ -35,7 +35,7 @@ class HttpHandler(http.server.SimpleHTTPRequestHandler):
self
.
end_headers
()
self
.
wfile
.
write
(
bytes
(
pypimonitor
.
Renderer
.
from_args
(
packages
=
querydict
.
get
(
'pkg'
),
columns
=
querydict
.
get
(
'col'
,
[
"homepage"
,
"pypi
_
version"
,
"pypi
_
mdownload"
,
"pypi
_
wdownload"
,
"pypi
_
ddownload"
]),
columns
=
querydict
.
get
(
'col'
,
[
"homepage"
,
"pypiversion"
,
"pypimdownload
s
"
,
"pypiwdownload
s
"
,
"pypiddownload
s
"
]),
users
=
querydict
.
get
(
'user'
),
).
render
(),
"utf-8"
))
elif
self
.
_find_yaml
(
path
):
...
...
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