Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
__pycache__/
/*.egg-info/
/portingdb/_build
/portingdb.sqlite
/portingdb.sqlite-shm
/portingdb.sqlite-wal
Expand Down
17 changes: 17 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
language: python
python:
- '3.6'
install:
- 'pip install . elsa'
before_script:
- 'python -m portingdb --datadir data/ load'
- 'python -m portingdb status'
script:
- 'python elsasite.py freeze'
deploy:
provider: script
skip_cleanup: true
script: 'python elsasite.py deploy --no-freeze --push'
on:
branch: master
repo: fedora-python/portingdb
17 changes: 17 additions & 0 deletions elsasite.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env python3
import logging

from portingdb import htmlreport

level = logging.INFO
logging.basicConfig(level=level)

sqlite_path = 'portingdb.sqlite'

db_url = 'sqlite:///' + sqlite_path

application = htmlreport.create_app(db_url=db_url, cache_config=None)

if __name__ == '__main__':
from elsa import cli
cli(application, base_url='http://fedora.portingdb.xyz/')
6 changes: 3 additions & 3 deletions portingdb/htmlreport.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import datetime

from flask import Flask, render_template, current_app, Markup, abort, url_for
from flask import make_response, request
from flask import make_response, request, Response
from flask.json import jsonify
from sqlalchemy import func, and_, or_, create_engine
from sqlalchemy.orm import subqueryload, eagerload, sessionmaker, joinedload
Expand Down Expand Up @@ -579,7 +579,7 @@ def history_csv():
'status': row.status,
'num_packages': row.num_packages,
})
return sio.getvalue()
return Response(sio.getvalue(), mimetype='text/csv')


def group_by_loc(grp):
Expand Down Expand Up @@ -855,7 +855,7 @@ def history_naming_csv():
'status': row.status,
'num_packages': row.num_packages,
})
return sio.getvalue()
return Response(sio.getvalue(), mimetype='text/csv')


def format_quantity(num):
Expand Down
3 changes: 3 additions & 0 deletions portingdb/templates/group.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ <h2>Visualizations</h2>
<img src="{{ url_for('piechart_grp', grp=grp.ident) }}">
</a>
</div>
<h2>Lines of Code</h2>
See <a href="{{ url_for('group_by_loc', grp=grp.ident) }}">Code Stats</a>
for {{ grp.name }}.
</div>
</div>
{% endblock bodycontent %}
1 change: 1 addition & 0 deletions portingdb/templates/package.html
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ <h2>Dependencies</h2>
<table class="table table-striped table-condensed table-hovered">
{{ pkglist_table_content(dependencies, collections, show_nonblocking=1) }}
</table>
<p>See the dependencies in a <a href="{{ url_for('graph_pkg', pkg=pkg.name) }}">graph</a>.</p>
{% else %}
None.
{% endif %}
Expand Down