Commit eaf09e55 authored by Alessandro Viprati's avatar Alessandro Viprati

Merge branch 'scopri-ubuntu' of code.ubuntu-it.org:ubuntu-it-web/www into scopri-ubuntu

parents 425998a6 4d2b928a
Pipeline #150 passed with stage
in 0 seconds
{ {
"build": [ "build": [
["invoke", "build"] ["./run", "build_scss"],
], ["./run", "init", "{{base}}/data"]
"before_install": [
["mkdir", "{{base}}/data"],
["virtualenv", "-p", "python3", "{{base}}/env"]
],
"install": [
{
"artifacts": "build/packages/*.whl",
"command": ["{{base}}/env/bin/pip", "install", "{{artifact}}"]
}
],
"after_install": [
["{{base}}/env/bin/uitwww", "init", "{{base}}/data"]
], ],
"run": [ "run": [
"{{base}}/env/bin/uitwww", "run", "-g", "{{gunicorn_config_file}}", "{{base}}/build/run", "run",
"-g", "{{gunicorn_config_file}}",
"{{base}}/data" "{{base}}/data"
] ]
} }
#! /usr/bin/python3
import os
import sys
# Prefer local modules over any system-installed ones to ensure that running a
# Git version from any current working directory does not have unexpected
# behaviour.
parent = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if os.path.exists(os.path.join(parent, 'uitwww', '__init__.py')):
sys.path.insert(0, parent)
if __name__ == '__main__':
from uitwww import main
main.cli()
...@@ -49,7 +49,7 @@ setuptools.setup( ...@@ -49,7 +49,7 @@ setuptools.setup(
entry_points = { entry_points = {
"console_scripts": [ "console_scripts": [
"uitwww = uitwww.__main__:cli", "uitwww = uitwww.main:cli",
], ],
}, },
......
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
# necessario aggiornare questa sezione. # necessario aggiornare questa sezione.
[releases.latest] [releases.latest]
version = "18.04.1" version = "18.04.2"
codename = "bionic" codename = "bionic"
lts = true lts = true
[releases.lts] [releases.lts]
version = "16.04.5" version = "16.04.6"
codename = "xenial" codename = "xenial"
lts = true lts = true
...@@ -109,14 +109,14 @@ releases = ["latest"] ...@@ -109,14 +109,14 @@ releases = ["latest"]
archs = { amd64 = "cdimages-derivatives", i386 = "cdimages-derivatives" } archs = { amd64 = "cdimages-derivatives", i386 = "cdimages-derivatives" }
[distros.ubuntustudio] #[distros.ubuntustudio]
name = "Ubuntu Studio" #name = "Ubuntu Studio"
description = "Ubuntu con tutti i programmi per lavorare con audio, video e immagini" #description = "Ubuntu con tutti i programmi per lavorare con audio, video e immagini"
lts-support-years = 3 #lts-support-years = 3
#
lts-only = true #lts-only = true
releases = ["lts"] #releases = ["lts"]
archs = { amd64 = "cdimages-studio", i386 = "cdimages-studio" } #archs = { amd64 = "cdimages-studio", i386 = "cdimages-studio" }
......
...@@ -15,8 +15,10 @@ ...@@ -15,8 +15,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import os import os
import sys
import click import click
import subprocess
import uitwww import uitwww
from uitwww import utils from uitwww import utils
...@@ -80,3 +82,20 @@ def init(data): ...@@ -80,3 +82,20 @@ def init(data):
print("Initializing data directory:", data) print("Initializing data directory:", data)
data_path = os.path.expanduser(os.path.abspath(data)) data_path = os.path.expanduser(os.path.abspath(data))
uitwww.init_data_directory(data_path) uitwww.init_data_directory(data_path)
@cli.command("build_scss")
def build_scss():
"""Build the scss file"""
base_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')
scss_file = open('%s/assets/scss/www.scss' % base_dir, 'rb')
css_file = open('%s/uitwww/static/website.css' % base_dir, 'wb')
subprocess.run(
[sys.executable, '-mscss'],
stdin=scss_file,
stdout=css_file,
check=True,
)
css_file.flush()
scss_file.close()
css_file.close()
...@@ -18,7 +18,7 @@ import datetime ...@@ -18,7 +18,7 @@ import datetime
import random import random
import string import string
from htmlmin.minify import html_minify from htmlmin import minify as html_minify
import gunicorn.app.base as baseapp import gunicorn.app.base as baseapp
......
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