[PATCH] [Wok] Remove Open Sans font requirement
by Aline Manera
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
COPYING | 4 --
IBM-license-blacklist | 1 -
configure.ac | 1 -
contrib/DEBIAN/control.in | 3 +-
contrib/wok.spec.fedora.in | 1 -
contrib/wok.spec.suse.in | 1 -
docs/fedora-deps.md | 4 +-
docs/opensuse-deps.md | 3 +-
docs/ubuntu-deps.md | 3 +-
src/wok/config.py.in | 18 +-----
tests/test_config.py.in | 70 -----------------------
ui/css/Makefile.am | 2 +-
ui/css/bootstrap.custom.css | 22 ++++----
ui/css/opensans/Makefile.am | 21 -------
ui/css/opensans/opensans.css | 100 ---------------------------------
ui/css/src/modules/_wok-variables.scss | 4 +-
ui/css/wok.css | 14 ++---
ui/pages/login.html.tmpl | 1 -
ui/pages/wok-ui.html.tmpl | 3 +-
19 files changed, 28 insertions(+), 248 deletions(-)
delete mode 100644 ui/css/opensans/Makefile.am
delete mode 100644 ui/css/opensans/opensans.css
diff --git a/COPYING b/COPYING
index a163007..980d024 100644
--- a/COPYING
+++ b/COPYING
@@ -12,10 +12,6 @@ Files: ui/css/fontawesome/fontawesome.css
Source: http://fontawesome.io
License: MIT
-Files: ui/css/opensans/opensans.css
-Source: https://fonts.google.com/specimen/Open+Sans
-License: Apache-2.0
-
Files: ui/css/src/bootstrap.custom.scss
ui/css/src/vendor/bootstrap-sass/bootstrap/*
Source: https://github.com/twbs/bootstrap
diff --git a/IBM-license-blacklist b/IBM-license-blacklist
index 6ff1e29..ba5050a 100644
--- a/IBM-license-blacklist
+++ b/IBM-license-blacklist
@@ -42,7 +42,6 @@ src/wok/plugins/sample/ui/pages/help/en_US/.*.html
ui/base64/README.md
ui/base64/jquery.base64.js
ui/css/fontawesome/fontawesome.css
-ui/css/opensans/opensans.css
ui/css/src/vendor/bootstrap-sass/LICENSE
ui/css/src/vendor/bootstrap-sass/bootstrap/.*.scss
ui/css/src/vendor/bootstrap-sass/bootstrap/mixins/.*.scss
diff --git a/configure.ac b/configure.ac
index 2f8d13a..2803dfb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -79,7 +79,6 @@ AC_CONFIG_FILES([
ui/base64/Makefile
ui/css/Makefile
ui/css/fontawesome/Makefile
- ui/css/opensans/Makefile
ui/images/Makefile
ui/images/theme-default/Makefile
ui/js/Makefile
diff --git a/contrib/DEBIAN/control.in b/contrib/DEBIAN/control.in
index e825368..1254688 100644
--- a/contrib/DEBIAN/control.in
+++ b/contrib/DEBIAN/control.in
@@ -16,8 +16,7 @@ Depends: python-cherrypy3 (>= 3.2.0),
fonts-font-awesome,
logrotate,
openssl,
- websockify,
- texlive-fonts-extra
+ websockify
Build-Depends: xsltproc,
gettext,
python-lxml,
diff --git a/contrib/wok.spec.fedora.in b/contrib/wok.spec.fedora.in
index 7514376..df06e83 100644
--- a/contrib/wok.spec.fedora.in
+++ b/contrib/wok.spec.fedora.in
@@ -18,7 +18,6 @@ Requires: nginx
Requires: python-ldap
Requires: python-psutil >= 0.6.0
Requires: fontawesome-fonts
-Requires: open-sans-fonts
Requires: logrotate
Requires: openssl
Requires: python-websockify
diff --git a/contrib/wok.spec.suse.in b/contrib/wok.spec.suse.in
index cca3186..956fb26 100644
--- a/contrib/wok.spec.suse.in
+++ b/contrib/wok.spec.suse.in
@@ -19,7 +19,6 @@ Requires: python-xml
Requires: nginx
Requires: python-psutil >= 0.6.0
Requires: fontawesome-fonts
-Requires: google-opensans-fonts
Requires: logrotate
Requires: openssl
Requires: python-websockify
diff --git a/docs/fedora-deps.md b/docs/fedora-deps.md
index 484f409..f4d63fe 100644
--- a/docs/fedora-deps.md
+++ b/docs/fedora-deps.md
@@ -27,8 +27,8 @@ Runtime Dependencies
$ sudo yum install python-cherrypy python-cheetah PyPAM m2crypto \
python-jsonschema python-psutil python-ldap \
- python-lxml nginx openssl open-sans-fonts \
- fontawesome-fonts logrotate python-websockify
+ python-lxml nginx openssl python-websockify \
+ fontawesome-fonts logrotate
# For RHEL systems, install the additional packages:
$ sudo yum install python-ordereddict
diff --git a/docs/opensuse-deps.md b/docs/opensuse-deps.md
index eee39f9..71a1af9 100644
--- a/docs/opensuse-deps.md
+++ b/docs/opensuse-deps.md
@@ -18,8 +18,7 @@ Runtime Dependencies
$ sudo zypper install python-CherryPy python-Cheetah python-pam \
python-M2Crypto python-jsonschema python-psutil \
python-ldap python-lxml python-xml nginx openssl \
- google-opensans-fonts fontawesome-fonts logrotate \
- python-websockify
+ fontawesome-fonts logrotate python-websockify
Packages required for UI development
------------------------------------
diff --git a/docs/ubuntu-deps.md b/docs/ubuntu-deps.md
index 3607998..4577348 100644
--- a/docs/ubuntu-deps.md
+++ b/docs/ubuntu-deps.md
@@ -18,8 +18,7 @@ Runtime Dependencies
$ sudo apt-get install python-cherrypy3 python-cheetah python-pam \
python-m2crypto python-jsonschema \
python-psutil python-ldap python-lxml nginx \
- openssl fonts-font-awesome texlive-fonts-extra \
- websockify
+ openssl fonts-font-awesome websockify
Packages required for UI development
------------------------------------
diff --git a/src/wok/config.py.in b/src/wok/config.py.in
index c2bcc28..8349d58 100644
--- a/src/wok/config.py.in
+++ b/src/wok/config.py.in
@@ -30,17 +30,7 @@ __release__ = "@wokrelease@"
CACHEEXPIRES = 31536000 # expires is one year.
DEFAULT_LOG_LEVEL = "info"
-FONT_FILES = {'fontawesome': ['fontawesome-webfont.ttf'],
- 'opensans': ['OpenSans-ExtraBoldItalic.ttf',
- 'OpenSans-ExtraBold.ttf',
- 'OpenSans-LightItalic.ttf',
- 'OpenSans-Light.ttf',
- 'OpenSans-SemiboldItalic.ttf',
- 'OpenSans-BoldItalic.ttf',
- 'OpenSans-Italic.ttf',
- 'OpenSans-Bold.ttf',
- 'OpenSans-Semibold.ttf',
- 'OpenSans-Regular.ttf']}
+FONT_FILES = {'fontawesome': ['fontawesome-webfont.ttf']}
FONTS_PATH = {
'fontawesome': [
@@ -48,12 +38,6 @@ FONTS_PATH = {
'/usr/share/fonts/truetype/font-awesome',
'/usr/share/fonts/truetype',
'/usr/share/fonts/TTF'
- ],
- 'opensans': [
- '/usr/share/fonts/open-sans',
- '/usr/share/fonts/truetype/',
- '/usr/share/texlive/texmf-dist/fonts/truetype/public/opensans',
- '/usr/share/fonts/TTF'
]
}
diff --git a/tests/test_config.py.in b/tests/test_config.py.in
index a4d65bb..7b7e656 100644
--- a/tests/test_config.py.in
+++ b/tests/test_config.py.in
@@ -155,76 +155,6 @@ class ConfigTests(unittest.TestCase):
'tools.staticfile.on': True,
'tools.staticfile.filename':
'%s/fontawesome-webfont.ttf' % paths.fontawesome_dir
- },
- '/fonts/OpenSans-LightItalic.ttf': {
- 'tools.wokauth.on': False,
- 'tools.nocache.on': False,
- 'tools.staticfile.on': True,
- 'tools.staticfile.filename':
- '%s/OpenSans-LightItalic.ttf' % paths.opensans_dir
- },
- '/fonts/OpenSans-Bold.ttf': {
- 'tools.wokauth.on': False,
- 'tools.nocache.on': False,
- 'tools.staticfile.on': True,
- 'tools.staticfile.filename':
- '%s/OpenSans-Bold.ttf' % paths.opensans_dir
- },
- '/fonts/OpenSans-Italic.ttf': {
- 'tools.wokauth.on': False,
- 'tools.nocache.on': False,
- 'tools.staticfile.on': True,
- 'tools.staticfile.filename':
- '%s/OpenSans-Italic.ttf' % paths.opensans_dir
- },
- '/fonts/OpenSans-Semibold.ttf': {
- 'tools.wokauth.on': False,
- 'tools.nocache.on': False,
- 'tools.staticfile.on': True,
- 'tools.staticfile.filename':
- '%s/OpenSans-Semibold.ttf' % paths.opensans_dir
- },
- '/fonts/OpenSans-Light.ttf': {
- 'tools.wokauth.on': False,
- 'tools.nocache.on': False,
- 'tools.staticfile.on': True,
- 'tools.staticfile.filename':
- '%s/OpenSans-Light.ttf' % paths.opensans_dir
- },
- '/fonts/OpenSans-SemiboldItalic.ttf': {
- 'tools.wokauth.on': False,
- 'tools.nocache.on': False,
- 'tools.staticfile.on': True,
- 'tools.staticfile.filename':
- '%s/OpenSans-SemiboldItalic.ttf' % paths.opensans_dir
- },
- '/fonts/OpenSans-ExtraBold.ttf': {
- 'tools.wokauth.on': False,
- 'tools.nocache.on': False,
- 'tools.staticfile.on': True,
- 'tools.staticfile.filename':
- '%s/OpenSans-ExtraBold.ttf' % paths.opensans_dir
- },
- '/fonts/OpenSans-BoldItalic.ttf': {
- 'tools.wokauth.on': False,
- 'tools.nocache.on': False,
- 'tools.staticfile.on': True,
- 'tools.staticfile.filename':
- '%s/OpenSans-BoldItalic.ttf' % paths.opensans_dir
- },
- '/fonts/OpenSans-ExtraBoldItalic.ttf': {
- 'tools.wokauth.on': False,
- 'tools.nocache.on': False,
- 'tools.staticfile.on': True,
- 'tools.staticfile.filename':
- '%s/OpenSans-ExtraBoldItalic.ttf' % paths.opensans_dir
- },
- '/fonts/OpenSans-Regular.ttf': {
- 'tools.wokauth.on': False,
- 'tools.nocache.on': False,
- 'tools.staticfile.on': True,
- 'tools.staticfile.filename':
- '%s/OpenSans-Regular.ttf' % paths.opensans_dir
}
}
diff --git a/ui/css/Makefile.am b/ui/css/Makefile.am
index 1a75e6d..afa6609 100644
--- a/ui/css/Makefile.am
+++ b/ui/css/Makefile.am
@@ -17,7 +17,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-SUBDIRS = fontawesome opensans
+SUBDIRS = fontawesome
EXTRA_DIST = theme-default
diff --git a/ui/css/bootstrap.custom.css b/ui/css/bootstrap.custom.css
index 76a6367..d2c2a32 100644
--- a/ui/css/bootstrap.custom.css
+++ b/ui/css/bootstrap.custom.css
@@ -2,7 +2,7 @@
/*
* Project Wok
*
- * Copyright IBM Corp, 2015-2016
+ * Copyright IBM Corp, 2015-2017
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -330,7 +330,7 @@ html {
}
body {
- font-family: "Open Sans", Helvetica, Arial, "Lucida Grande", sans-serif;
+ font-family: Helvetica, Arial, "Lucida Grande", sans-serif;
font-size: 14px;
line-height: 1.42857;
color: #222;
@@ -3901,7 +3901,7 @@ tbody.collapse.in {
height: 55px;
background: transparent url("../images/wok-logo.png") no-repeat 4px 5px;
color: #fff;
- font-family: "Open Sans", Helvetica, Arial, "Lucida Grande", sans-serif;
+ font-family: Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 700;
font-size: 1.571em;
line-height: 55px;
@@ -4157,7 +4157,7 @@ tbody.collapse.in {
display: block;
vertical-align: middle;
color: #fff;
- font-family: "Open Sans", Helvetica, Arial, "Lucida Grande", sans-serif;
+ font-family: Helvetica, Arial, "Lucida Grande", sans-serif;
font-size: 13pt;
font-weight: normal;
line-height: 24px;
@@ -4320,7 +4320,7 @@ tbody.collapse.in {
padding-right: 10px;
margin: 0;
font-size: 12pt;
- font-family: "Open Sans", Helvetica, Arial, "Lucida Grande", sans-serif;
+ font-family: Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 700;
color: #fff;
text-decoration: none;
@@ -4370,7 +4370,7 @@ tbody.collapse.in {
.navbar-default .navbar-nav > .hostname .host-location {
display: inline-block;
- font-family: "Open Sans", Helvetica, Arial, "Lucida Grande", sans-serif;
+ font-family: Helvetica, Arial, "Lucida Grande", sans-serif;
color: #fff;
font-size: 8.5pt;
font-weight: 300;
@@ -6033,7 +6033,7 @@ button.close {
margin: 0;
line-height: 23px;
font-size: 27px;
- font-family: "Open Sans", Helvetica, Arial, "Lucida Grande", sans-serif;
+ font-family: Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 300 !important;
}
@@ -6127,7 +6127,7 @@ button.close {
.modal label {
color: #222;
font-weight: 400;
- font-family: "Open Sans", Helvetica, Arial, "Lucida Grande", sans-serif;
+ font-family: Helvetica, Arial, "Lucida Grande", sans-serif;
font-size: 20px;
}
@@ -6162,7 +6162,7 @@ button.close {
.modal-body .nav-tabs > li > a {
font-size: 17px;
font-weight: 300;
- font-family: "Open Sans", Helvetica, Arial, "Lucida Grande", sans-serif;
+ font-family: Helvetica, Arial, "Lucida Grande", sans-serif;
border: 0;
border-bottom: 5px solid #eee;
text-align: center;
@@ -6178,7 +6178,7 @@ button.close {
position: absolute;
z-index: 1070;
display: block;
- font-family: "Open Sans", Helvetica, Arial, "Lucida Grande", sans-serif;
+ font-family: Helvetica, Arial, "Lucida Grande", sans-serif;
font-style: normal;
font-weight: normal;
letter-spacing: normal;
@@ -6312,7 +6312,7 @@ button.close {
display: none;
max-width: 276px;
padding: 1px;
- font-family: "Open Sans", Helvetica, Arial, "Lucida Grande", sans-serif;
+ font-family: Helvetica, Arial, "Lucida Grande", sans-serif;
font-style: normal;
font-weight: normal;
letter-spacing: normal;
diff --git a/ui/css/opensans/Makefile.am b/ui/css/opensans/Makefile.am
deleted file mode 100644
index a01c208..0000000
--- a/ui/css/opensans/Makefile.am
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# Project Wok
-#
-# Copyright IBM Corp, 2015-2016
-#
-# Code derived from Project Kimchi
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-opensanscssdir = $(datadir)/wok/ui/css/opensans
-dist_opensanscss_DATA = opensans.css
diff --git a/ui/css/opensans/opensans.css b/ui/css/opensans/opensans.css
deleted file mode 100644
index 57a6533..0000000
--- a/ui/css/opensans/opensans.css
+++ /dev/null
@@ -1,100 +0,0 @@
-@charset "UTF-8";
-/*
-* Font license info
-*
-* Open Sans font family is licensed under the Apache License, Version 2.0:
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-/* This file was modified according to Kimchi proposals */
-
-/* BEGIN Light */
-@font-face {
- font-family: 'Open Sans';
- src: local('Open Sans'), local('OpenSans'), url("/fonts/OpenSans-Light.ttf") format("truetype");
- font-weight: 300;
- font-style: normal; }
-/* END Light */
-
-/* BEGIN Light Italic */
-@font-face {
- font-family: 'Open Sans';
- src: local('Open Sans'), local('OpenSans'), url("/fonts/OpenSans-LightItalic.ttf") format("truetype");
- font-weight: 300;
- font-style: italic; }
-/* END Light Italic */
-
-/* BEGIN Regular */
-@font-face {
- font-family: 'Open Sans';
- src: local('Open Sans'), local('OpenSans'), url("/fonts/OpenSans-Regular.ttf") format("truetype");
- font-weight: normal;
- font-style: normal; }
-/* END Regular */
-
-/* BEGIN Italic */
-@font-face {
- font-family: 'Open Sans';
- src: local('Open Sans'), local('OpenSans'), url("/fonts/OpenSans-Italic.ttf") format("truetype");
- font-weight: normal;
- font-style: italic; }
-/* END Italic */
-
-/* BEGIN Semibold */
-@font-face {
- font-family: 'Open Sans';
- src: local('Open Sans'), local('OpenSans'), url("/fonts/OpenSans-Semibold.ttf") format("truetype");
- font-weight: 600;
- font-style: normal; }
-/* END Semibold */
-
-/* BEGIN Semibold Italic */
-@font-face {
- font-family: 'Open Sans';
- src: local('Open Sans'), local('OpenSans'), url("/fonts/OpenSans-SemiboldItalic.ttf") format("truetype");
- font-weight: 600;
- font-style: italic; }
-/* END Semibold Italic */
-
-/* BEGIN Bold */
-@font-face {
- font-family: 'Open Sans';
- src: local('Open Sans'), local('OpenSans'), url("/fonts/OpenSans-Bold.ttf") format("truetype");
- font-weight: bold;
- font-style: normal; }
-/* END Bold */
-
-/* BEGIN Bold Italic */
-@font-face {
- font-family: 'Open Sans';
- src: local('Open Sans'), local('OpenSans'), url("/fonts/OpenSans-BoldItalic.ttf") format("truetype");
- font-weight: bold;
- font-style: italic; }
-/* END Bold Italic */
-
-/* BEGIN Extrabold */
-@font-face {
- font-family: 'Open Sans';
- src: local('Open Sans'), local('OpenSans'), url("/fonts/OpenSans-ExtraBold.ttf") format("truetype");
- font-weight: 800;
- font-style: normal; }
-/* END Extrabold */
-
-/* BEGIN Extrabold Italic */
-@font-face {
- font-family: 'Open Sans';
- src: local('Open Sans'), local('OpenSans'), url("/fonts/OpenSans-ExtraBoldItalic.ttf") format("truetype");
- font-weight: 800;
- font-style: italic; }
-/* END Extrabold Italic */
diff --git a/ui/css/src/modules/_wok-variables.scss b/ui/css/src/modules/_wok-variables.scss
index 5b4b2d8..25037c6 100644
--- a/ui/css/src/modules/_wok-variables.scss
+++ b/ui/css/src/modules/_wok-variables.scss
@@ -1,7 +1,7 @@
//
// Project Wok
//
-// Copyright IBM Corp, 2015-2016
+// Copyright IBM Corp, 2015-2017
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -74,7 +74,7 @@ $link-hover-decoration: underline !default;
//
//## Font, line-height, and color for body text, headings, and more.
-$font-family-sans-serif: 'Open Sans', Helvetica, Arial, "Lucida Grande", sans-serif !default;
+$font-family-sans-serif: Helvetica, Arial, "Lucida Grande", sans-serif !default;
$font-family-serif: Georgia, "Times New Roman", Times, serif !default;
//** Default monospace fonts for `<code>`, `<kbd>`, and `<pre>`.
$font-family-monospace: Menlo, Monaco, Consolas, "Courier New", monospace !default;
diff --git a/ui/css/wok.css b/ui/css/wok.css
index ec269b5..b9b7c92 100644
--- a/ui/css/wok.css
+++ b/ui/css/wok.css
@@ -252,7 +252,7 @@ html.in-progress .disabled {
.login-area .bootstrap-select,
.login-area .selectpicker {
- font-family: "Open Sans", Helvetica, Arial, "Lucida Grande", sans-serif;
+ font-family: Helvetica, Arial, "Lucida Grande", sans-serif;
font-size: 13pt;
}
@@ -292,7 +292,7 @@ html.in-progress .disabled {
}
.navbar-default.toolbar .navbar-right.tools > li > a {
- font-family: "Open Sans", Helvetica, Arial, "Lucida Grande", sans-serif;
+ font-family: Helvetica, Arial, "Lucida Grande", sans-serif;
display: inline-block;
color: #fff;
text-decoration: none;
@@ -323,7 +323,7 @@ html.in-progress .disabled {
}
.btn {
- font-family: "Open Sans", Helvetica, Arial, "Lucida Grande", sans-serif;
+ font-family: Helvetica, Arial, "Lucida Grande", sans-serif;
font-size: 13pt;
}
@@ -484,7 +484,7 @@ fieldset[disabled] .btn-group > span > .btn.active {
background: #4d4c4e !important;
min-width: 160px;
border: 0 !important;
- font-family: "Open Sans", Helvetica, Arial, "Lucida Grande", sans-serif;
+ font-family: Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 700;
font-size: 13.5pt;
text-align: left;
@@ -1056,7 +1056,7 @@ fieldset[disabled] .btn-group > span > .btn.active {
}
.wok-datagrid > .wok-datagrid-header > span {
- font-family: "Open Sans", Helvetica, Arial, "Lucida Grande", sans-serif;
+ font-family: Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 300;
font-size: 12.5pt;
vertical-align: bottom;
@@ -1071,7 +1071,7 @@ fieldset[disabled] .btn-group > span > .btn.active {
}
.wok-datagrid > .wok-datagrid-body > .wok-datagrid-row > span {
- font-family: "Open Sans", Helvetica, Arial, "Lucida Grande", sans-serif;
+ font-family: Helvetica, Arial, "Lucida Grande", sans-serif;
line-height: 2.42857;
vertical-align: top;
font-size: 12.5pt;
@@ -1163,7 +1163,7 @@ fieldset[disabled] .btn-group > span > .btn.active {
label {
font-size: 1.143em;
font-weight: 400;
- font-family: "Open Sans", Helvetica, Arial, "Lucida Grande", sans-serif;
+ font-family: Helvetica, Arial, "Lucida Grande", sans-serif;
}
.form-control-feedback {
diff --git a/ui/pages/login.html.tmpl b/ui/pages/login.html.tmpl
index 6f967cf..13dbc51 100644
--- a/ui/pages/login.html.tmpl
+++ b/ui/pages/login.html.tmpl
@@ -65,7 +65,6 @@
<link rel="stylesheet" href="$href('libs/bootstrap-select/dist/css/bootstrap-select.min.css')">
<link rel="stylesheet" href="$href('libs/datatables/css/datatables.min.css')">
<link rel="stylesheet" href="$href('css/fontawesome/fontawesome.css')">
- <link rel="stylesheet" href="$href('css/opensans/opensans.css')">
<link rel="stylesheet" href="$href('css/bootstrap-select.custom.css')">
<link rel="stylesheet" href="$href('css/datatables.bootstrap.css')">
<link rel="stylesheet" href="$href('css/wok.css')">
diff --git a/ui/pages/wok-ui.html.tmpl b/ui/pages/wok-ui.html.tmpl
index 36a0492..8780e0b 100644
--- a/ui/pages/wok-ui.html.tmpl
+++ b/ui/pages/wok-ui.html.tmpl
@@ -1,7 +1,7 @@
#*
* Project Wok
*
- * Copyright IBM Corp, 2015-2016
+ * Copyright IBM Corp, 2015-2017
*
* Code derived from Project Kimchi
*
@@ -67,7 +67,6 @@
<link rel="stylesheet" href="$href('libs/bootstrap-editable/dist/css/bootstrap-editable.css')">
<link rel="stylesheet" href="$href('libs/datatables/css/datatables.min.css')">
<link rel="stylesheet" href="$href('css/fontawesome/fontawesome.css')">
- <link rel="stylesheet" href="$href('css/opensans/opensans.css')">
<link rel="stylesheet" href="$href('css/bootstrap-select.custom.css')">
<link rel="stylesheet" href="$href('css/datatables.bootstrap.css')">
<link rel="stylesheet" href="$href('css/wok.css')">
--
2.9.3
7 years, 8 months
[PATCH] [Wok] Bug fix #192: Check the specific domain file exists on mo directory
by Aline Manera
Before it was checking the mo directory exists which may fail if it
exists but does not have a specific domain file.
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
src/wok/message.py | 2 +-
src/wok/template.py | 19 +++++++------------
2 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/src/wok/message.py b/src/wok/message.py
index 56cd022..a335881 100644
--- a/src/wok/message.py
+++ b/src/wok/message.py
@@ -73,7 +73,7 @@ class WokMessage(object):
# do translation
domain = app.root.domain
paths = app.root.paths
- lang = validate_language(get_lang())
+ lang = validate_language(get_lang(), domain)
try:
translation = gettext.translation(domain, paths.mo_dir, [lang])
diff --git a/src/wok/template.py b/src/wok/template.py
index 43a34db..b033394 100644
--- a/src/wok/template.py
+++ b/src/wok/template.py
@@ -22,10 +22,9 @@
import cherrypy
import errno
import json
+import os
import time
from Cheetah.Template import Template
-from glob import iglob
-
from wok import config as config
from wok.config import paths
@@ -60,15 +59,10 @@ def get_accept_language():
return langs
-def get_support_languages():
- mopath = "%s/*" % paths.mo_dir
- return [path.rsplit('/', 1)[1] for path in iglob(mopath)]
-
-
-def validate_language(langs):
- supportLangs = get_support_languages()
+def validate_language(langs, domain):
for lang in langs:
- if lang in supportLangs:
+ filepath = os.path.join(paths.mo_dir, lang, domain + '.mo')
+ if os.path.exists(filepath):
return lang
return "en_US"
@@ -96,11 +90,12 @@ def can_accept_html():
def render_cheetah_file(resource, data):
paths = cherrypy.request.app.root.paths
+ domain = cherrypy.request.app.root.domain
filename = paths.get_template_path(resource)
try:
params = {}
- lang = validate_language(get_lang())
- gettext_conf = {'domain': cherrypy.request.app.root.domain,
+ lang = validate_language(get_lang(), domain)
+ gettext_conf = {'domain': domain,
'localedir': paths.mo_dir,
'lang': [lang]}
params['lang'] = gettext_conf
--
2.9.3
7 years, 8 months
[PATCH] [Wok] Bug fix #1109: Specify Content-Type for SVG files
by Aline Manera
Some systems do not have mimetype specified for SVG files which prevents
SVG files to be loaded on Wok UI.
Fix that and also set UIConfig for all plugins to share the same
configuration.
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
src/wok/config.py.in | 41 +++++++++++++++++++++++++++--------------
tests/test_config.py.in | 1 +
2 files changed, 28 insertions(+), 14 deletions(-)
diff --git a/src/wok/config.py.in b/src/wok/config.py.in
index c2bcc28..9fd39d9 100644
--- a/src/wok/config.py.in
+++ b/src/wok/config.py.in
@@ -159,7 +159,7 @@ class PluginPaths(Paths):
class UIConfig(dict):
def __init__(self, paths):
ui_configs = {}
- for sub_dir in ('css', 'js', 'libs', 'images'):
+ for sub_dir in ('css', 'js', 'images'):
ui_configs['/' + sub_dir] = {
'tools.staticdir.on': True,
'tools.staticdir.dir': os.path.join(paths.ui_dir, sub_dir),
@@ -169,17 +169,10 @@ class UIConfig(dict):
ui_configs['/' + sub_dir].update({
'tools.expires.on': True,
'tools.expires.secs': CACHEEXPIRES})
-
- for font, files in FONT_FILES.iteritems():
- font_dir = getattr(paths, "%s_dir" % font)
- for filename in files:
- font_file = os.path.join(font_dir, filename)
- if os.path.exists(font_file):
- ui_configs['/fonts/%s' % filename] = {
- 'tools.staticfile.on': True,
- 'tools.staticfile.filename': font_file,
- 'tools.wokauth.on': False,
- 'tools.nocache.on': False}
+ else:
+ ui_configs['/' + sub_dir].update(
+ {'tools.staticdir.content_types':
+ {'svg': 'image/svg+xml'}})
self.update(ui_configs)
@@ -237,8 +230,27 @@ class WokConfig(dict):
'tools.staticdir.dir': os.path.join(paths.ui_dir,
'pages/help')
},
+ '/libs': {
+ 'tools.staticdir.on': True,
+ 'tools.staticdir.dir': os.path.join(paths.ui_dir, 'libs'),
+ 'tools.wokauth.on': False,
+ 'tools.nocache.on': False,
+ 'tools.expires.on': True,
+ 'tools.expires.secs': CACHEEXPIRES
+ }
}
+ for font, files in FONT_FILES.iteritems():
+ font_dir = getattr(paths, "%s_dir" % font)
+ for filename in files:
+ font_file = os.path.join(font_dir, filename)
+ if os.path.exists(font_file):
+ wok_config['/fonts/%s' % filename] = {
+ 'tools.staticfile.on': True,
+ 'tools.staticfile.filename': font_file,
+ 'tools.wokauth.on': False,
+ 'tools.nocache.on': False}
+
def __init__(self):
super(WokConfig, self).__init__(self)
self.update(self.wok_config)
@@ -248,6 +260,7 @@ class WokConfig(dict):
class PluginConfig(dict):
def __init__(self, plugin_name):
super(PluginConfig, self).__init__(self)
+ paths = PluginPaths(plugin_name)
plugin_config = {
'/': {
'tools.trailing_slash.on': False,
@@ -264,10 +277,10 @@ class PluginConfig(dict):
'/ui/config/tab-ext.xml': {
'tools.staticfile.on': True,
'tools.staticfile.filename':
- os.path.join(PluginPaths(plugin_name).ui_dir,
- 'config/tab-ext.xml'),
+ os.path.join(paths.ui_dir, 'config/tab-ext.xml'),
'tools.nocache.on': True}}
self.update(plugin_config)
+ self.update(UIConfig(paths))
def _get_config():
diff --git a/tests/test_config.py.in b/tests/test_config.py.in
index a4d65bb..31dd1b8 100644
--- a/tests/test_config.py.in
+++ b/tests/test_config.py.in
@@ -147,6 +147,7 @@ class ConfigTests(unittest.TestCase):
'tools.wokauth.on': False,
'tools.nocache.on': False,
'tools.staticdir.dir': '%s/ui/images' % paths.prefix,
+ 'tools.staticdir.content_types': {'svg': 'image/svg+xml'},
'tools.staticdir.on': True
},
'/fonts/fontawesome-webfont.ttf': {
--
2.9.3
7 years, 8 months
[PATCH] [Kimchi] Bug fix: Let Wok specify UI configuration on cherrypy settings
by Aline Manera
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
config.py.in | 14 +-------------
tests/test_config.py.in | 1 +
2 files changed, 2 insertions(+), 13 deletions(-)
---
Depends on Wok patch:
- [PATCH] [Wok] Bug fix #1109: Specify Content-Type for SVG files
---
diff --git a/config.py.in b/config.py.in
index a887670..de7024e 100644
--- a/config.py.in
+++ b/config.py.in
@@ -24,7 +24,7 @@ import platform
import threading
from cherrypy.lib.reprconf import Parser
-from wok.config import CACHEEXPIRES, PluginConfig, PluginPaths
+from wok.config import PluginConfig, PluginPaths
from wok.xmlutils.utils import xpath_get_text
kimchiLock = threading.Lock()
@@ -172,16 +172,4 @@ class KimchiConfig(PluginConfig):
custom_config[uri].update({'tools.staticfile.on': True,
'tools.staticfile.filename': path})
- for dirname in ('css', 'js', 'images'):
- custom_config['/' + dirname] = {
- 'tools.staticdir.on': True,
- 'tools.staticdir.dir': os.path.join(kimchiPaths.ui_dir,
- dirname),
- 'tools.wokauth.on': False,
- 'tools.nocache.on': False}
- if dirname != 'images':
- custom_config['/' + dirname].update({
- 'tools.expires.on': True,
- 'tools.expires.secs': CACHEEXPIRES})
-
self.update(custom_config)
diff --git a/tests/test_config.py.in b/tests/test_config.py.in
index 74ea84a..d8110ea 100644
--- a/tests/test_config.py.in
+++ b/tests/test_config.py.in
@@ -144,6 +144,7 @@ class ConfigTests(unittest.TestCase):
'tools.wokauth.on': False,
'tools.nocache.on': False,
'tools.staticdir.dir': '%s/ui/images' % pluginPrefix,
+ 'tools.staticdir.content_types': {'svg': 'image/svg+xml'},
'tools.staticdir.on': True
},
'/data/screenshots': {
--
2.9.3
7 years, 8 months
Wok 2.4 and Kimchi 2.4 are now released!
by Aline Manera
On behalf of everyone who has worked hard on this release, I am pleased
to announce the availability of *Wok 2.4* and *Kimchi 2.4*!
Kimchi 2.4 depends on *Wok 2.4* and *Ginger Base 2.3*! So make
sure to have both of them properly installed in your system.
Among many features,
Wok 2.4 release includes:
✔ Plugins management
✔ Block authentication request after too many failures
✔ Asynchronous UI notification using Websockets
✔ Bug fixes
Kimchi 2.4 release includes:
✔ Initial s390x systems support
✔ Guest CPU hot plug and unplug
✔ Live migration over RDMA
✔ Live snapshot support
✔ Bug fixes
We have worked hard to ensure that Wok and Kimchi run well on the most
popular Linux distributions including: Fedora 25, Ubuntu 16.10,
openSUSE LEAP 42.2, and CentOS 7. They use standard Linux interfaces so
it should run well on many other distributions too.
You can easily grab this release in tarball format or via git:
✔ https://github.com/kimchi-project/wok/archive/2.4.0.tar.gz
✔ https://github.com/kimchi-project/kimchi/archive/2.4.0.tar.gz
✔ git clone -b stable-2.4.x --recursivehttps://github.com/kimchi-project/wok.git
There are also some packages available for download at:
✔http://kimchi-project.github.io/wok/downloads/
✔http://kimchi-project.github.io/kimchi/downloads/
Go ahead! Give it a try and let us know what you think!
Regards,
Aline Manera
7 years, 8 months