Skip to content
Extraits de code Groupes Projets

Comparer les révisions

Les modifications sont affichées comme si la révision source était fusionnée avec la révision cible. En savoir plus sur la comparaison des révisions.

Source

Sélectionner le projet cible
No results found

Cible

Sélectionner le projet cible
  • la-quadrature-du-net/memopol/memopol
  • lnclt/political_memory
  • arthur/political_memory
  • agrausem/political_memory
  • periode/memopol
  • Anthony/memopol
  • Porkepix/memopol
  • jaster/memopol
  • luxcem/memopol
  • TAlone/memopol
10 résultats
Afficher les modifications
Validations sur la source (1099)
{
"directory": "core/static/libs"
}
[run]
omit =
src/representatives_positions/contrib/*
src/representatives_recommendations/contrib/*
src/representatives/tests/*
src/representatives/migrations/*
src/representatives/contrib/francedata/tests/*
src/representatives/contrib/parltrack/tests/*
src/representatives_votes/tests/*
src/representatives_votes/migrations/*
representatives
*.sqlite3
celerybeat-*
core/static/libs/*
# SASS Cache
.sass-cache
CACHE/*
# Emacs backup
*~
\#*\#
# libs
src/memopol/static/libs/
# From https://github.com/github/gitignore/blob/master/Python.gitignore
# settings
src/memopol/local_settings.py
src/memopol/config.json
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
.cache
.coverage
*.egg-info
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
var/
# Virtualenv
memopol_env
.tox
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
.dpl
*.sqlite
*.json.xz
log/
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.cache
nosetests.xml
coverage.xml
# Translations
*.mo
*.pot
# Django stuff:
*.log
\ No newline at end of file
/data
data/
# editors
*~
# local setup
.memopol.alias
whoosh_index/
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/pip-cache"
cache:
paths:
- "$CI_PROJECT_DIR/pip-cache"
key: "$CI_PROJECT_ID"
stages:
- test
- deploy
before_script:
- pip install --user tox
- export PATH="$HOME/.local/bin:$PATH"
unit tests:
stage: test
script: tox -e py27
tags: [memopol]
qa checks:
stage: test
script: tox -e qa
tags: [memopol]
docs build:
stage: test
script: git diff --raw HEAD^1 | grep docs || tox -e docs
tags: [memopol]
docs deploy:
stage: deploy
script:
- source /srv/memopol/memopol_env/bin/activate
- cd /srv/memopol/memopol_env/src/memopol/docs
- make html
tags: [memopol]
environment: production
only:
- master
django deploy:
stage: deploy
script:
- source /srv/memopol/memopol_env/bin/activate
- cd /srv/memopol/memopol_env/src/memopol
- git fetch origin
- git reset --hard origin/master
- find . -name '*.pyc' -delete
- find . -name '__pycache__' | xargs rm -rf
- rm -r src/*.egg-info
- pip install -Ue .
- src/memopol/bin/install_client_deps.sh
- memopol migrate --noinput
- memopol collectstatic --noinput
- touch /srv/memopol/ready
tags: [memopol]
environment: production
only:
- master
sudo: false
env:
global:
- DJANGO_DEBUG=True
- DJANGO_SETTINGS_MODULE=memopol.settings
matrix:
- TOXENV=qa
- TOXENV=docs
- TOXENV=py27
language: python
python:
- '3.4'
services:
- postgresql
install:
- travis_retry pip install -U pip
- travis_retry pip install tox
- travis_retry pip freeze
before_script:
- psql -c "CREATE USER memopol WITH CREATEDB PASSWORD 'memopol';" -U postgres
- psql -c "CREATE DATABASE memopol WITH OWNER memopol;" -U postgres
script:
- travis_retry tox
after_success:
- codecov
deploy:
- provider: openshift
edge: true
user: memopol@laquadrature.net
password:
secure: atDq1NEkHXOsV2gZKeXAIn+PvbL3jduz3WK1qIs7BSHyNbrZMT1OUmvoXXrM8+i5eqW3TNsvp23w0RuD06wxSjHkPl+ZCEXP1Ao98p85UZNCgixxiwZHEhL6Amz5vqueGhv+47VOIKNgNFb9NAtRrWyIdA9xDUiK2oWkMSDmHas=
app: master
domain: memopol
deployment_branch: master
on:
repo: memopol/memopol master
Ce diff est replié.
[![build status](https://git.laquadrature.net/memopol/memopol/badges/master/build.svg)](https://git.laquadrature.net/memopol/memopol/commits/master)
[![coverage report](https://git.laquadrature.net/memopol/memopol/badges/master/coverage.svg)](https://git.laquadrature.net/memopol/memopol/commits/master)
[Manual](http://memopol.readthedocs.io/en/master/index.html)
\ No newline at end of file
#!/bin/bash
# Script to setup few usual aliases to facilitate the development
# This aliases should work if you've installed memopol throught the quickstart
# script or the documentation
# It :
# - Setup automaticaly the venv
# - Setup Django in DEBUG mode
# You just need to add a line in you're .bashrc or .zshrc to load them:
REPOROOT="$( readlink -m "${BASH_SOURCE[0]}"/../..)"
ALIASROOT=$REPOROOT"/.memopol.alias"
echo $ALIASROOT
echo "Create a dedicated alias file in $ALIASROOT"
echo "alias memopol-code=\"cd $REPOROOT && source $REPOROOT/memopol_env/bin/activate && export DJANGO_DEBUG=True\"" > $ALIASROOT
echo "alias memopol-launch=\"memopol-code && memopol runserver\"" >> $ALIASROOT
echo "alias memopol-update-all=\"memopol-code && bin/update_all\"" >> $ALIASROOT
echo "alias memopol-refresh-scores=\"memopol-code && memopol refresh_scores\"" >> $ALIASROOT
case $SHELL in
*/bash)
echo "Bash detected"
echo "Update $HOME/.bashrc file"
RCSHELL="$HOME/.bashrc"
;;
*/zsh)
echo "Zsh detected"
echo "Update $HOME/.zshrc file"
RCSHELL="$HOME/.zshrc"
;;
*)
echo "SHELL not supported. Try using BASH or ZSH, or set alias manually."
RCSHELL="/dev/null"
;;
esac
echo "source $ALIASROOT" >> $RCSHELL
source $ALIASROOT
echo -e "You can use the following aliases :\n"
echo -e "\t memopol-code : Go into the repository and activate the virtualenv"
echo -e "\t memopol-launch : Run the development server"
echo -e "\t memopol-update-all : Get all the production data"
echo -e "\t memopol-refresh-scores : Refresh all scores"
function parltrack_download_pipe() {
[ -n "$CLEAN" ] && rm -rf $1
[ -f "$1" ] || wget http://parltrack.euwiki.org/dumps/$1 || exit 1
export DJANGO_SETTINGS_MODULE=memopol.settings
unxz -c ${OPENSHIFT_DATA_DIR}$1 | $2
[ -n "$CLEAN" ] && rm -rf $1
}
function francedata_download_pipe() {
[ -n "$CLEAN" ] && rm -rf $1
[ -f "$1" ] || wget https://memopol.lqdn.fr/fd/$1 || exit 1
export DJANGO_SETTINGS_MODULE=memopol.settings
gunzip -c ${OPENSHIFT_DATA_DIR}$1 | $2
[ -n "$CLEAN" ] && rm -rf $1
}
function refresh_scores() {
export DJANGO_SETTINGS_MODULE=memopol.settings
memopol refresh_scores
}
#!/bin/bash
#
# Quick-start script for new developers
# Usage: from repo root, `source bin/quickstart.sh`
#
REPOROOT=$(dirname $(dirname $0))
# Ensure we're at the root of the memopol repository
pushd $REPOROOT >/dev/null
# Create & activate python virtual environment
virtualenv memopol_env
source memopol_env/bin/activate
# Install python dependencies
pip install -U pip setuptools
pip install -e .[testing]
# Install client dependencies
src/memopol/bin/install_client_deps.sh
# Create pg user and database
if [ $(psql -c "select 'CNT=' || count(1) from pg_catalog.pg_user where usename='memopol';" -U postgres | grep CNT=1 | wc -l) -lt 1 ]; then
psql -c "create user memopol with password 'memopol';" -U postgres
fi
psql -c "alter role memopol with createdb;" -U postgres
if [ $(psql -l -U postgres | egrep "^ memopol\W" | wc -l) -lt 1 ]; then
psql -c "create database memopol with owner memopol;" -U postgres
fi
# Setup environment
export DJANGO_DEBUG=True
export DJANGO_SETTINGS_MODULE=memopol.settings
# Run django migration to create database
memopol migrate
# Import sample data
memopol loaddata data_sample.json
memopol refresh_scores
# Build index for Whoosh
memopol rebuild_index
echo
echo "You're all set!"
echo "To start the application run the following from the repository root ($REPOROOT):"
echo " source memopol_env/bin/activate"
echo " export DJANGO_DEBUG=True DJANGO_SETTINGS_MODULE=memopol.settings"
echo " memopol runserver"
echo
echo "If you make changes, don't forget to run tests using:"
echo " flake8 . --exclude '*/migrations,docs,static' --ignore E128"
echo " py.test memopol representatives_positions representatives_recommendations"
echo
echo "Happy hacking ;)"
echo
popd >/dev/null
#!/bin/bash
bin/update_representatives
sleep 10
bin/update_dossiers
sleep 10
bin/update_proposals
sleep 10
bin/update_votes
#!/bin/bash
set -x
source bin/lib.sh
parltrack_download_pipe ep_dossiers.json.xz parltrack_import_dossiers
sleep 10
francedata_download_pipe dossiers.json.gz francedata_import_dossiers
#!/bin/bash
set -x
source bin/lib.sh
# Nothing for parltrack - proposals imported with votes
francedata_download_pipe scrutins.json.gz francedata_import_scrutins
#!/bin/bash
set -x
source bin/lib.sh
parltrack_download_pipe ep_meps_current.json.xz parltrack_import_representatives
sleep 10
francedata_download_pipe parlementaires.json.gz francedata_import_representatives
#!/bin/bash
set -x
source bin/lib.sh
parltrack_download_pipe ep_votes.json.xz parltrack_import_votes
sleep 10
parltrack_download_pipe ep_com_votes.json.xz parltrack_import_votes
sleep 10
francedata_download_pipe votes.json.gz francedata_import_votes
if [ "x$1" != "xnoscores" ]; then
sleep 10
refresh_scores
fi
{
"name": "Memopol",
"version": "0.0.0",
"dependencies": {
"jquery": "~2.1.3",
"foundation": "~5.5.1"
}
}
from django.contrib import admin
# Register your models here.
from django.db import models
# Create your models here.
libs
Location of auto-categories images.