[python-flask-silk] Initial import (#839098).
pcpa
pcpa at fedoraproject.org
Sun Sep 16 14:31:12 UTC 2012
commit 3318f671931834e5d4a013a7f1600fc4c3956416
Author: pcpa <paulo.cesar.pereira.de.andrade at gmail.com>
Date: Sun Sep 16 11:31:00 2012 -0300
Initial import (#839098).
.gitignore | 1 +
LICENSE | 31 +++++++++++++++++++++++
python-flask-silk.spec | 63 ++++++++++++++++++++++++++++++++++++++++++++++++
sources | 1 +
test.py | 36 +++++++++++++++++++++++++++
5 files changed, 132 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..99ec30b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/Flask-Silk-0.1.1.tar.gz
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..3e0fd6a
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,31 @@
+Copyright (c) 2010 by Lee Heung-sub.
+
+Some rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+* Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+
+* The names of the contributors may not be used to endorse or
+ promote products derived from this software without specific
+ prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/python-flask-silk.spec b/python-flask-silk.spec
new file mode 100644
index 0000000..e4913ed
--- /dev/null
+++ b/python-flask-silk.spec
@@ -0,0 +1,63 @@
+%global mod_name Flask-Silk
+
+Name: python-flask-silk
+Version: 0.1.1
+Release: 5%{?dist}
+Summary: Adds silk icons to your Flask application or module, or extension
+Group: Development/Libraries
+License: BSD and CC-BY-SA
+URL: http://github.com/sublee/flask-silk/
+Source0: http://pypi.python.org/packages/source/F/%{mod_name}/%{mod_name}-%{version}.tar.gz
+# Files requested to be added/updated in tarball at issue
+# https://github.com/sublee/flask-silk/issues/1
+# https://github.com/sublee/flask-silk/blob/master/LICENSE
+Source1: LICENSE
+# https://github.com/sublee/flask-silk/blob/master/test.py
+Source2: test.py
+BuildArch: noarch
+BuildRequires: python-devel
+BuildRequires: python-flask
+BuildRequires: python-setuptools
+Requires: python-flask
+
+%description
+Adds silk icons to your Flask application or module, or extension.
+
+%prep
+%setup -q -n %{mod_name}-%{version}
+cp -a %{SOURCE1} %{SOURCE2} .
+# avoid issues due to flaskext added to PYTHONPATH by the time test.py is run
+sed -i 's|^\(from \)flaskext\.\(silk\)|\1\2|' test.py
+
+%build
+%{__python} setup.py build
+
+%install
+%{__python} setup.py install --root $RPM_BUILD_ROOT
+
+%check
+PYTHONPATH=$PWD/build/lib/flaskext:$PYTHONPATH python test.py
+
+%files
+%doc LICENSE PKG-INFO README
+%{python_sitelib}/*-nspkg.pth
+%{python_sitelib}/*.egg-info/
+%{python_sitelib}/flaskext/silk
+
+%changelog
+* Sat Sep 15 2012 pcpa <paulo.cesar.pereira.de.andrade at gmail.com> - 0.1.1-5
+- Correct upstream url (#839098)
+- Update license tag to match package contents (#839098)
+- Add LICENSE and test.py files from upstream scm
+
+* Thu Sep 13 2012 pcpa <paulo.cesar.pereira.de.andrade at gmail.com> - 0.1.1-4
+- Add missing python-setuptools build requires (#839071)
+
+* Fri Aug 17 2012 pcpa <paulo.cesar.pereira.de.andrade at gmail.com> - 0.1.1-3
+- Update build requires for proper chroot build
+
+* Sun Aug 5 2012 pcpa <paulo.cesar.pereira.de.andrade at gmail.com> - 0.1.1-2
+- No need to set CFLAGS for noarch (#839071)
+
+* Tue Jul 10 2012 pcpa <paulo.cesar.pereira.de.andrade at gmail.com> - 0.1.1-1
+- Initial python-flask-silk spec.
diff --git a/sources b/sources
index e69de29..8f3ff80 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+7b5e5a260db010474ce339d812c27c39 Flask-Silk-0.1.1.tar.gz
diff --git a/test.py b/test.py
new file mode 100644
index 0000000..7cbe662
--- /dev/null
+++ b/test.py
@@ -0,0 +1,36 @@
+import unittest
+from flask import Flask, Module
+from flaskext.silk import Silk
+
+
+class ApplicationTestCase(unittest.TestCase):
+
+ def setUp(self):
+ self.app = Flask(__name__)
+ self.silk = Silk(self.app)
+
+ def test_icon(self):
+ rv = self.app.test_client().get("/icons/page_white.png")
+ assert 294 == len(rv.data), "could not found an icon file."
+
+
+class ModuleTestCase(unittest.TestCase):
+
+ def test_urlprefix(self):
+ app = Flask(__name__)
+ mod = Module(__name__ + ".foo", url_prefix="/foo")
+ silk = Silk(mod)
+ app.register_module(mod)
+ rv = app.test_client().get("/foo/icons/page_white.png")
+ assert 294 == len(rv.data), "could not found an icon file."
+
+ def test_subdomain(self):
+ app = Flask(__name__)
+ app.config["SERVER_NAME"] = "example.org"
+ mod = Module(__name__ + ".foo", subdomain="foo")
+ silk = Silk(mod)
+ app.register_module(mod)
+ rv = app.test_client().get("/icons/page_white.png",
+ "http://foo.example.org/")
+ assert 294 == len(rv.data), "could not found an icon file."
+
More information about the scm-commits
mailing list