Commit b9e0a029 authored by Louis's avatar Louis
Browse files

All plugins work

parent ed5a1ccf
......@@ -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>
......
......@@ -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
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
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
......@@ -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
......
......@@ -2,3 +2,4 @@ from pypimonitor.column import Jinja2
class Homepage(Jinja2):
keyword = 'homepage'
title = 'Home'
......@@ -3,3 +3,6 @@ from pypimonitor.column import Jinja2
class Readthedocs(Jinja2):
keyword = 'readthedocs'
title = 'Doc'
default = {
'lang': 'en',
}
TODO
<a href="{{ pypi.info.package_url }}">
<img src="https://img.shields.io/pypi/v/{{ pypi.info.name }}.svg" alt="Package version">
</a>
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>
<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>
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>
......@@ -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", "pypimdownloads", "pypiwdownloads", "pypiddownloads"]),
users=querydict.get('user'),
).render(), "utf-8"))
elif self._find_yaml(path):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment