Commit a534a59b authored by Mattia Rizzolo's avatar Mattia Rizzolo

rename __main__.py to main.py so it can be imported

Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent c52a83e9
...@@ -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",
], ],
}, },
......
...@@ -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
...@@ -82,3 +84,20 @@ def init(data): ...@@ -82,3 +84,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()
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