Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
0.0.1 | ||
initial import |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from xml.sax.saxutils import escape, unescape | ||
|
||
# https://wiki.python.org/moin/EscapingHtml | ||
# escape() and unescape() takes care of &, < and > - we need to handle quotes, so we don't break things | ||
html_attribute_escape_table = { | ||
'"': """, | ||
"'": "'" | ||
} | ||
html_attribute_unescape_table = {v:k for k, v in html_attribute_escape_table.items()} | ||
def html_attribute_escape(text): | ||
return escape(text, html_attribute_escape_table) | ||
def html_attribute_unescape(text): | ||
return unescape(text, html_attribute_unescape_table) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[easy_install] | ||
zip_ok = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
"""metadata_utils installation script. | ||
""" | ||
import os | ||
|
||
from setuptools import setup | ||
from setuptools import find_packages | ||
|
||
here = os.path.abspath(os.path.dirname(__file__)) | ||
README = '' | ||
try: | ||
README = open(os.path.join(here, "README.md")).read() | ||
README = README.split("\n\n", 1)[0] + "\n" | ||
except: | ||
pass | ||
|
||
requires = [] | ||
|
||
setup(name="metadata_utils", | ||
version="0.0.1", | ||
description="Lightweight Metadata Support", | ||
long_description=README, | ||
classifiers=[ | ||
"Intended Audience :: Developers", | ||
"Programming Language :: Python", | ||
"License :: OSI Approved :: MIT License", | ||
], | ||
keywords="web", | ||
author="Jonathan Vanasco", | ||
author_email="jonathan@findmeon.com", | ||
url="https://github.com/jvanasco/metadata_utils", | ||
license="MIT", | ||
py_modules=['metadata_utils'], | ||
packages=find_packages(), | ||
include_package_data=True, | ||
zip_safe=False, | ||
tests_require = requires, | ||
install_requires = requires, | ||
test_suite="tests", | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|