diff --git a/butterfly.server.py b/butterfly.server.py index ed4efc1..bf21efd 100755 --- a/butterfly.server.py +++ b/butterfly.server.py @@ -61,12 +61,6 @@ tornado.options.define("generate_current_user_pkcs", default=False, tornado.options.define("generate_user_pkcs", default='', help="Generate user pfx for client authentication " "(Must be root to create for another user)") -tornado.options.define("install_themes", default=False, - help="Install or update themes from butterfly-themes") -tornado.options.define("install_themes_from", - default='https://github.com/paradoxxxzero/' - 'butterfly-themes/archive/master.zip', - help="Url to download themes from") if os.getuid() == 0: ev = os.getenv('XDG_CONFIG_DIRS', '/etc') @@ -118,49 +112,6 @@ for logger in ('tornado.access', 'tornado.application', log = logging.getLogger('butterfly') -if options.install_themes: - from io import BytesIO - from shutil import move, rmtree - from zipfile import ZipFile - from tempfile import mkdtemp - try: - from urllib.request import urlopen - except ImportError: - from urllib import urlopen - try: - import sass as _ - _.CompileError - except Exception: - print('You must install libsass to use themes ' - '(run: pip install libsass)') - sys.exit(1) - themes_url = options.install_themes_from - print('Downloading %s...' % themes_url) - zip_ = ZipFile(BytesIO(urlopen(themes_url).read())) - - print('Extracting in %s' % butterfly_dir) - zip_.extractall(butterfly_dir) - - zip_dest = os.path.join(butterfly_dir, 'butterfly-themes-master') - theme_dir = os.path.join(butterfly_dir, 'themes') - if not os.path.exists(theme_dir): - os.makedirs(theme_dir) - - tmp_dir = mkdtemp() - for dir_ in os.listdir(zip_dest): - if dir_ == 'README.md': - continue - new_dir = os.path.join(theme_dir, dir_) - if os.path.exists(new_dir): - move(new_dir, tmp_dir) - print('Old theme %s has been backed up in %s' % ( - new_dir, tmp_dir)) - move(os.path.join(zip_dest, dir_), theme_dir) - - rmtree(zip_dest) - print('%s extracted.' % theme_dir) - sys.exit(0) - host = options.host port = options.port diff --git a/butterfly/__init__.py b/butterfly/__init__.py index 5319df0..fabc79e 100644 --- a/butterfly/__init__.py +++ b/butterfly/__init__.py @@ -14,7 +14,7 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . -__version__ = '2.0.10' +__version__ = '2.0.12' import os diff --git a/butterfly/bin/butterfly_help b/butterfly/bin/butterfly_help index 8ecdb60..e0a5409 100755 --- a/butterfly/bin/butterfly_help +++ b/butterfly/bin/butterfly_help @@ -38,9 +38,8 @@ Butterfly is a xterm compliant terminal built with python and javascript. {title}Styling butterfly:{reset} To style butterfly in sass, you need to have the libsass python library installed. - Install official themes with {code}butterfly.server.py --install-themes{reset} - Theming is done by overiding the default sass files located in {code}{main}{reset} in a theme directory. + Theming is done by overriding the default sass files located in {code}{main}{reset} in your theme directory. This directory can include images and custom fonts. Please take a look at official themes here: https://github.com/paradoxxxzero/butterfly-themes and submit your best themes as pull request! diff --git a/setup.py b/setup.py index cfa7f4f..e3f0bcd 100644 --- a/setup.py +++ b/setup.py @@ -29,8 +29,8 @@ options = dict( package_data={ 'butterfly': [ 'sass/*.sass', - 'themes/*', - 'themes/**/*', + 'themes/*.*', + 'themes/**/*.*', 'static/fonts/*', 'static/images/favicon.png', 'static/main.css',