+++ /dev/null
-#!/bin/sh
-
-docker-compose run app bash /srv/doc/build.sh
+++ /dev/null
-#!/bin/sh
-
-docker-compose exec -T app python /srv/app/manage.py build-front $1
+++ /dev/null
-#!/bin/sh
-
-docker-compose run app python /srv/app/manage.py graph_models organization_core organization-media organization_pages organization.network organization.magazine organization.projects organization.agenda organization.shop organization.job > /srv/doc/graph/mezzanine-organization.dot
+++ /dev/null
-# docker-compose run app python manage.py compilemessages
-
-cd /srv
-
-find $(pwd) -type d -name 'locale' -print | while read f; do
- cd "$f" && cd ..
- echo $(pwd)
- django-admin makemessages -l fr
- django-admin compilemessages
-done
+++ /dev/null
-#!/bin/bash
-
-# Exit when any command fails
-# We need to stop build if pip fails
-set -e
-
-for module in `ls /srv/lib/`; do
- cd /srv/lib/$module
- if [ -f 'requirements.txt' ]; then
- pip3 install -r requirements.txt
- elif [ -f 'setup.py' ]; then
- pip3 install -e .
- fi
-done
+++ /dev/null
-#!/bin/bash
-
-# Exit when any command fails
-# We need to stop build if pip fails
-set -e
-
-for module in `ls /srv/lib/`; do
- cd /srv/lib/$module
- if [ -f 'requirements.txt' ]; then
- pip install -r requirements.txt
- elif [ -f 'setup.py' ]; then
- pip install -e .
- fi
-done
+++ /dev/null
-#!/bin/sh
-
-docker compose exec app bash /srv/bin/build/local/messages.sh
+++ /dev/null
-#!/bin/bash
-
-cd "$(dirname "$0")"/../../
-
-cat doc/src/overview.rst doc/src/architecture.rst doc/src/install.rst doc/src/development.rst doc/src/maintenance.rst doc/src/copyright.rst doc/src/license.rst > README.rst
-
-echo "Build finished. The README.rst file is up to date."
+++ /dev/null
-#!/bin/sh
-
-docker-compose stop
-mv data var
-mkdir var/lib
-sudo mv var/postgresql var/lib
-sudo mv var/external var/opt
-sudo mv var/var/log var
-sudo rm -rf var/var
+++ /dev/null
-#!/bin/bash
-
-cd "$(dirname "$0")"/../../
-
-# We need to chown folders so that they can be used by the $USER (with an exception on Darwin)
-if ! uname -a | grep Darwin > /dev/null; then
-
- declare -a arr=("var/media" "var/backup")
-
- for folder in "${arr[@]}"; do
- INFO=( $(stat -L -c "%a %G %U" $folder) )
- OWNER=${INFO[2]}
- if [ "$OWNER" != "$USER" ]; then
- sudo chown -R $USER $folder
- fi
- done
-fi
+++ /dev/null
-#!/bin/sh
-
-docker-compose run app python /srv/app/manage.py gulp
+++ /dev/null
-#!/bin/sh
-
-docker-compose exec -T app python /srv/app/manage.py poll_twitter --force
+++ /dev/null
-#!/usr/bin/python3.5
-
-import os
-from chardet import detect
-from pyutil import filereplace
-srcfile = "./var/backup/mariadb.dump"
-trgfile = "./var/backup/mariadb2.dump"
-
-# get file encoding type
-def get_encoding_type(file):
- with open(file, 'rb') as f:
- rawdata = f.read()
- return detect(rawdata)['encoding']
-
-from_codec = get_encoding_type(srcfile)
-
-# add try: except block for reliability
-try:
- with open(srcfile, 'r', encoding=from_codec) as f, open(trgfile, 'w', encoding='utf-8') as e:
- text = f.read() # for small files, for big use chunks
- e.write(text)
-
- os.remove(srcfile) # remove old encoding file
- os.rename(trgfile, srcfile) # rename new encoding
-except UnicodeDecodeError:
- print('Decode Error')
-except UnicodeEncodeError:
- print('Encode Error')
-
-# replace charset latin1 to ut8
-filereplace(srcfile,"CHARSET=latin1","CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci")
\ No newline at end of file
+++ /dev/null
-#!/usr/bin/python
-
-import pandas as pd
-import requests
-from subprocess import check_output, CalledProcessError
-domain_prod = "http://brahms.ircam.fr"
-domain_dev = "http://localhost:9030"
-session_option = "-H 'Cookie: sessionid={0}'"
-session_prod = "gd9zgu68wo3lptwfhqqkawo59w0486rz"
-session_dev = "qh25niyvxetuouxwmafdpvxlc8eldp5u"
-
-analyse_urls = [
- # analyse - published
- "/analyses/dialogue/",
- "/analyses/metallics/",
- "/analyses/noanoa/",
- "/analyses/traiettoria/",
- "/analyses/Mortuos/",
- "/analyses/Stria/",
- "/analyses/Prologue/",
- # analyse - draft
- "/analyses/Etymo/",
- "/analyses/EnTrance/",
- "/analyses/test/",
- "/analyses/test2/",
- # composer
- "/witold-lutoslawski",
- "/wlodzimierz-kotonski",
- "/omer-hulusier",
- "/necil-kazim-akses",
- "/wenjing-guo",
- "/rene-alix",
- "/axel-borup-jrgensen",
- "/per-nrgard",
- "/pierre-boulez",
- # events_event
- "/admin/events/event/13/change/",
- "/admin/events/event/23/change/",
- #events_hall
- "/admin/events/hall/5/change/",
- #events_manifestation
- "/admin/events/manifestation/3/change/",
- #repertoire_analysis_definitions
- "/admin/repertoire/definition/32/change/",
- #robots_rule
- "/admin/robots/rule/1/change/",
- #robots_url
- "/admin/robots/url/3/change/",
- #utils_citysidney
- "/admin/utils/citysidney/3/change/",
- #utils_corporatebody
- "/admin/utils/corporatebody/127/change/",
- #utils_countrysidney
- "/admin/utils/countrysidney/230/change/",
- #utils_equipmentbrand
- "/admin/utils/equipmentbrand/127/change/",
- #utils_equipmentcategory
- "admin/utils/equipmentcategory/4/change/",
- #utils_equipmentreference
- "/admin/utils/equipmentreference/422/change/",
- #utils_error
- "/admin/utils/error/1703/change/",
- #utils_lang
- "/admin/utils/lang/1/change/",
- #utils_naturalperson
- "/admin/utils/naturalperson/6791/change/",
- "/admin/utils/naturalperson/6806/change/",
- "/admin/utils/naturalperson/6892/change/",
- #utils_personfunction
- "/admin/utils/personfunction/12/change/",
- #validation_fichedevalidation
- "/admin/validation/fichedevalidation/74/change/",
- "/admin/validation/fichedevalidation/63/change/",
- #works_electronic
- "/admin/works/electronic/11/change/",
- "/admin/works/electronic/5/change/",
- #works_filetype
- "/admin/works/filetype/20/change/",
- #works_version
- "/admin/works/version/1345/change/",
- "/admin/works/version/990/change/",
- #works_versionfile
- "/admin/works/versionfile/2665/change/",
- "/admin/works/versionfile/9250/change/",
- #works_worksidney
- "/admin/works/worksidney/6970/change/",
- "/admin/works/worksidney/18566/change/",
- "/admin/works/worksidney/7549/change/",
- "/admin/works/worksidney/25673/change/",
- "/admin/works/worksidney/10575/change/",
-]
-
-def get_curl_command(domain, url, session):
- return "curl -s '{0}' {1}".format(domain + url, session_option.format(session))
-
-for url in analyse_urls:
- print("==========================================================================")
- print("url ", url)
- print("-----------------------------------------")
- try:
- curl_prod = get_curl_command(domain_prod, url, session_prod)
- curl_dev = get_curl_command(domain_dev, url, session_dev)
- check_output("diff <("+curl_prod+") <("+ curl_dev + ")",
- shell=True, executable='/bin/bash', universal_newlines=True)
- except CalledProcessError as e:
- print(e.output, e.returncode)
-
+++ /dev/null
-#!/usr/bin/python3
-
-import os
-from optparse import OptionParser
-import shutil
-
-class Statifier:
-
- def __init__(self, domain, languages):
- self.domain = domain
- self.languages = languages
- self.replace_dict = {
- }
-
- def wget(self, language, dir):
- command = 'wget -q --mirror -p --adjust-extension --header="Accept-Language: %s" -e robots=off --base=./ -k -P %s https://%s' % (language, dir, self.domain)
- # print(command)
- os.system(command)
-
- def sed(self, dir, rule):
- command = "find %s -type f -print0 | xargs -0 sed -r -i -e '%s'" % (dir, rule)
- # print(command)
- os.system(command)
-
- def fix_languages(self, language):
- for root, dirs, files in os.walk(self.domain):
- for filename in files:
- name = os.path.splitext(filename)[0]
- ext = os.path.splitext(filename)[1][1:]
- if ext == 'html':
- path = root + os.sep + filename
- rel_root = root.split('/')[2:]
- rel_root = language + '/' + '/'.join(rel_root)
-
- f = open(path, 'rt')
- content = f.read()
- f.close()
-
- s_in = '<form action="https://%s/i18n/" method="post" class="c-header__languages">' % self.domain
- s_out = ''
- content = content.replace(s_in, s_out)
-
- s_in = '<button class="c-header__language is-active" type="submit" name="language" value="%s">%s</button>' % (language, language.upper())
- s_out = '<a href="/%s/">' + s_in + '</a>'
- s_out = s_out % rel_root
- content = content.replace(s_in, s_out)
-
- s_in = '<button class="c-header__language" type="submit" name="language" value="%s">%s</button>' % (language, language.upper())
- s_out = '<a href="/%s/">' + s_in + '</a>'
- s_out = s_out % rel_root
- content = content.replace(s_in, s_out)
-
- f = open(path, 'wt')
- f.write(content)
- f.close()
-
- def main(self):
- for language in self.languages:
- self.wget(language, self.domain)
- shutil.move(self.domain + os.sep + self.domain, self.domain + os.sep + language)
-
- for language in self.languages:
- self.fix_languages(language)
-
-
-def main():
- parser = OptionParser()
- parser.add_option("-d", "--domain", dest="domain", help="domain")
- parser.add_option("-l", "--languages",
- dest="languages", nargs=2,
- help="languages")
- (options, args) = parser.parse_args()
-
- s = Statifier(options.domain, options.languages)
- s.main()
-
-if __name__ == "__main__":
- main()
-
+++ /dev/null
-#!/bin/bash
-
-DOMAIN=$1
-
-mkdir $DOMAIN
-cd $DOMAIN
-
-LANG=en
-wget -q --mirror -p --adjust-extension --header='Accept-Language: en' -e robots=off --base=./ -k -P ./ https://$DOMAIN
-mv $DOMAIN $LANG
-find $LANG/ -type f -print0 | xargs -0 sed -r -i -e 's,<form action="https://'"$DOMAIN"'/i18n/" method="post" class="c-header__languages">,,g'
-find $LANG/ -type f -print0 | xargs -0 sed -r -i -e 's,<button class="c-header__language" type="submit" name="language" value="fr">FR</button>,<a href="/fr/"><button class="c-header__language\" type="button" name="language" value="fr">FR \ \;</button></a>,g'
-find $LANG/ -type f -print0 | xargs -0 sed -r -i -e 's,<button class="c-header__language is-active" type="submit" name="language" value="en">EN</button></form>,<a href="/en/"><button class="c-header__language\" type="button" name="language" value="en">\ \; EN</button></a>,g'
-
-LANG=fr
-wget -q --mirror -p --adjust-extension --header='Accept-Language: fr' -e robots=off --base=./ -k -P ./ https://$DOMAIN
-mv $DOMAIN $LANG
-find $LANG -type f -print0 | xargs -0 sed -r -i -e 's,<form action="https://'"$DOMAIN"'/i18n/" method="post" class="c-header__languages">,,g'
-find $LANG -type f -print0 | xargs -0 sed -r -i -e 's,<button class="c-header__language is-active" type="submit" name="language" value="fr">FR</button>,<a href="/fr/"><button class="c-header__language\" type="button" name="language" value="fr">FR \ \;</button></a>,g'
-find $LANG -type f -print0 | xargs -0 sed -r -i -e 's,<button class="c-header__language" type="submit" name="language" value="en">EN</button></form>,<a href="/en/"><button class="c-header__language\" type="button" name="language" value="en">\ \; EN</button></a>,g'