| @@ -0,0 +1,77 @@ | |||||
| [app:kotti_ai] | |||||
| use = egg:kotti | |||||
| pyramid.reload_templates = true | |||||
| pyramid.debug_templates = true | |||||
| pyramid.debug_authorization = false | |||||
| pyramid.debug_notfound = true | |||||
| pyramid.debug_routematch = false | |||||
| pyramid.includes = | |||||
| pyramid_debugtoolbar | |||||
| pyramid_tm | |||||
| pyramid.default_locale_name = en | |||||
| sqlalchemy.url = sqlite:///%(here)s/kotti_ai.db | |||||
| #mail.default_sender = yourname@yourhost | |||||
| kotti.configurators = | |||||
| kotti_tinymce.kotti_configure | |||||
| kotti_ai.kotti_configure | |||||
| # kotti_image.kotti_configure | |||||
| kotti.site_title = AIRoot 新时代AI+互联网简单应用 | |||||
| kotti.secret = qwerty | |||||
| [filter:fanstatic] | |||||
| use = egg:fanstatic#fanstatic | |||||
| [pipeline:main] | |||||
| pipeline = | |||||
| fanstatic | |||||
| kotti_ai | |||||
| [server:main] | |||||
| use = egg:waitress#main | |||||
| #port = 5000 | |||||
| port = %(http_port)s | |||||
| [alembic] | |||||
| script_location = kotti_ai:alembic | |||||
| # Begin logging configuration | |||||
| [loggers] | |||||
| keys = root, kotti_ai, sqlalchemy | |||||
| [handlers] | |||||
| keys = console | |||||
| [formatters] | |||||
| keys = generic | |||||
| [logger_root] | |||||
| level = INFO | |||||
| handlers = console | |||||
| [logger_kotti_ai] | |||||
| level = DEBUG | |||||
| handlers = | |||||
| qualname = kotti_ai | |||||
| [logger_sqlalchemy] | |||||
| level = INFO | |||||
| handlers = | |||||
| qualname = sqlalchemy.engine | |||||
| # "level = INFO" logs SQL queries. | |||||
| # "level = DEBUG" logs SQL queries and results. | |||||
| # "level = WARN" logs neither. (Recommended for production systems.) | |||||
| [handler_console] | |||||
| class = StreamHandler | |||||
| args = (sys.stderr,) | |||||
| level = NOTSET | |||||
| formatter = generic | |||||
| [formatter_generic] | |||||
| format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s | |||||
| # End logging configuration | |||||
| @@ -0,0 +1,76 @@ | |||||
| [app:kotti_ai] | |||||
| use = egg:kotti | |||||
| pyramid.reload_templates = true | |||||
| pyramid.debug_templates = true | |||||
| pyramid.debug_authorization = false | |||||
| pyramid.debug_notfound = true | |||||
| pyramid.debug_routematch = false | |||||
| pyramid.includes = | |||||
| pyramid_debugtoolbar | |||||
| pyramid_tm | |||||
| pyramid.default_locale_name = en | |||||
| sqlalchemy.url = sqlite:///%(here)s/kotti_ai.db | |||||
| #mail.default_sender = yourname@yourhost | |||||
| kotti.configurators = | |||||
| kotti_tinymce.kotti_configure | |||||
| kotti_ai.kotti_configure | |||||
| # kotti_image.kotti_configure | |||||
| kotti.site_title = kotti_ai site | |||||
| kotti.secret = qwerty | |||||
| [filter:fanstatic] | |||||
| use = egg:fanstatic#fanstatic | |||||
| [pipeline:main] | |||||
| pipeline = | |||||
| fanstatic | |||||
| kotti_ai | |||||
| [server:main] | |||||
| use = egg:waitress#main | |||||
| port = 5000 | |||||
| [alembic] | |||||
| script_location = kotti_ai:alembic | |||||
| # Begin logging configuration | |||||
| [loggers] | |||||
| keys = root, kotti_ai, sqlalchemy | |||||
| [handlers] | |||||
| keys = console | |||||
| [formatters] | |||||
| keys = generic | |||||
| [logger_root] | |||||
| level = INFO | |||||
| handlers = console | |||||
| [logger_kotti_ai] | |||||
| level = DEBUG | |||||
| handlers = | |||||
| qualname = kotti_ai | |||||
| [logger_sqlalchemy] | |||||
| level = INFO | |||||
| handlers = | |||||
| qualname = sqlalchemy.engine | |||||
| # "level = INFO" logs SQL queries. | |||||
| # "level = DEBUG" logs SQL queries and results. | |||||
| # "level = WARN" logs neither. (Recommended for production systems.) | |||||
| [handler_console] | |||||
| class = StreamHandler | |||||
| args = (sys.stderr,) | |||||
| level = NOTSET | |||||
| formatter = generic | |||||
| [formatter_generic] | |||||
| format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s | |||||
| # End logging configuration | |||||
| @@ -0,0 +1,47 @@ | |||||
| #!/bin/bash | |||||
| # Usage: | |||||
| # Initial catalog creation (lang is the language identifier): | |||||
| # ./i18n.sh lang | |||||
| # Updating translation and compile catalog: | |||||
| # ./i18n.sh | |||||
| # configuration | |||||
| DOMAIN="kotti_ai" | |||||
| SEARCH_PATH="kotti_ai" | |||||
| LOCALES_PATH="kotti_ai/locale" | |||||
| # end configuration | |||||
| # create locales folder if not exists | |||||
| if [ ! -d "$LOCALES_PATH" ]; then | |||||
| echo "Locales directory not exists, create" | |||||
| mkdir -p "$LOCALES_PATH" | |||||
| fi | |||||
| # create pot if not exists | |||||
| if [ ! -f "$LOCALES_PATH"/$DOMAIN.pot ]; then | |||||
| echo "Create pot file" | |||||
| touch "$LOCALES_PATH"/$DOMAIN.pot | |||||
| fi | |||||
| # no arguments, extract and update | |||||
| if [ $# -eq 0 ]; then | |||||
| echo "Extract messages" | |||||
| pot-create "$SEARCH_PATH" -d $DOMAIN -o "$LOCALES_PATH"/$DOMAIN.pot | |||||
| echo "Update translations" | |||||
| for po in "$LOCALES_PATH"/*/LC_MESSAGES/$DOMAIN.po; do | |||||
| msgmerge --no-wrap -o "$po" "$po" "$LOCALES_PATH"/$DOMAIN.pot | |||||
| done | |||||
| echo "Compile message catalogs" | |||||
| for po in "$LOCALES_PATH"/*/LC_MESSAGES/*.po; do | |||||
| echo "Compiling file $po..." | |||||
| msgfmt --statistics -o "${po%.*}.mo" "$po" | |||||
| done | |||||
| # first argument represents language identifier, create catalog | |||||
| else | |||||
| cd "$LOCALES_PATH" | |||||
| mkdir -p $1/LC_MESSAGES | |||||
| msginit -i $DOMAIN.pot -o $1/LC_MESSAGES/$DOMAIN.po -l $1 | |||||
| fi | |||||
| @@ -0,0 +1,17 @@ | |||||
| [pytest] | |||||
| addopts = | |||||
| --doctest-modules | |||||
| --doctest-glob='*.txt' | |||||
| --capture=no | |||||
| --cov=kotti_ai | |||||
| --cov-report=term-missing | |||||
| --cov-config .coveragerc | |||||
| --ignore=kotti_ai/templates/ | |||||
| --strict | |||||
| --pep8 | |||||
| kotti_ai/tests | |||||
| python_files = test*py | |||||
| markers = | |||||
| user: mark test to be run as the given user | |||||
| pep8: pep8 marker | |||||
| pep8ignore = E501 E122 E123 E125 E128 E711 E402 | |||||
| @@ -0,0 +1,12 @@ | |||||
| # ``master`` is where development happens: | |||||
| # -e git://github.com/Kotti/Kotti.git#egg=kotti | |||||
| # ``testing`` is *always* the latest non final release (alpha, beta, etc.): | |||||
| # -e git://github.com/Kotti/Kotti.git@testing#egg=kotti | |||||
| # ``production`` is *always* the latest final release: | |||||
| # -e git://github.com/Kotti/Kotti.git@production#egg=kotti | |||||
| # You can also install a specific version with its pinned requirements: | |||||
| -r https://raw.githubusercontent.com/Kotti/Kotti/2.0.0b2/requirements.txt | |||||
| Kotti == 2.0.0b2 | |||||
| @@ -0,0 +1,6 @@ | |||||
| repoze.sphinx.autointerface | |||||
| setuptools-git # needed to make "python setup.py install" on rtd. | |||||
| pytest # needed for testing apidocs | |||||
| # include requirements.txt | |||||
| -r requirements.txt | |||||
| @@ -0,0 +1,7 @@ | |||||
| [egg_info] | |||||
| tag_build = dev | |||||
| tag_svn_revision = true | |||||
| [aliases] | |||||
| dev = develop easy_install kotti[testing] kotti[development] | |||||
| docs = develop easy_install kotti[docs] | |||||
| @@ -0,0 +1,78 @@ | |||||
| # -*- coding: utf-8 -*- | |||||
| import os | |||||
| from setuptools import setup | |||||
| from setuptools import find_packages | |||||
| here = os.path.abspath(os.path.dirname(__file__)) | |||||
| try: | |||||
| README = open(os.path.join(here, 'README.rst')).read() | |||||
| except IOError: | |||||
| README = '' | |||||
| try: | |||||
| CHANGES = open(os.path.join(here, 'CHANGES.rst')).read() | |||||
| except IOError: | |||||
| CHANGES = '' | |||||
| version = '0.0.1dev' | |||||
| install_requires = [ | |||||
| 'Kotti>=1.3.0', | |||||
| 'kotti_tinymce', | |||||
| ] | |||||
| tests_require = [ | |||||
| 'pytest-cov', | |||||
| 'pytest-pep8', | |||||
| 'mock', | |||||
| 'webtest', | |||||
| ] | |||||
| setup( | |||||
| name='kotti_ai', | |||||
| version=version, | |||||
| description="A Kotti addon generated with cookiecutter", | |||||
| long_description='\n\n'.join([README, CHANGES]), | |||||
| classifiers=[ | |||||
| 'Development Status :: 3 - Alpha', | |||||
| # 'Development Status :: 4 - Beta', | |||||
| # 'Development Status :: 5 - Production/Stable', | |||||
| 'Environment :: Web Environment', | |||||
| 'Framework :: Pylons', | |||||
| 'Framework :: Pyramid', | |||||
| 'License :: Repoze Public License', | |||||
| 'Operating System :: POSIX', | |||||
| 'Operating System :: Unix', | |||||
| 'Programming Language :: JavaScript', | |||||
| 'Programming Language :: Python', | |||||
| 'Programming Language :: Python :: 3', | |||||
| 'Programming Language :: Python :: 3.3', | |||||
| 'Programming Language :: Python :: 3.4', | |||||
| 'Programming Language :: Python :: 3.5', | |||||
| 'Programming Language :: Python :: 3.6', | |||||
| 'Topic :: Internet', | |||||
| 'Topic :: Internet :: WWW/HTTP', | |||||
| 'Topic :: Internet :: WWW/HTTP :: WSGI', | |||||
| 'Topic :: Internet :: WWW/HTTP :: WSGI :: Application', | |||||
| ], | |||||
| author='', | |||||
| author_email='', | |||||
| url='https://github.com//kotti_ai', | |||||
| keywords='kotti web cms wcms pylons pyramid sqlalchemy bootstrap', | |||||
| license="BSD-derived (http://www.repoze.org/LICENSE.txt)", | |||||
| packages=find_packages(), | |||||
| include_package_data=True, | |||||
| zip_safe=False, | |||||
| install_requires=install_requires, | |||||
| tests_require=[], | |||||
| dependency_links=[], | |||||
| entry_points={ | |||||
| 'fanstatic.libraries': [ | |||||
| 'kotti_ai = kotti_ai.fanstatic:library', | |||||
| ], | |||||
| }, | |||||
| extras_require={ | |||||
| 'tests': tests_require, | |||||
| }, | |||||
| ) | |||||
| @@ -0,0 +1,9 @@ | |||||
| [tox] | |||||
| envlist = py36 | |||||
| [testenv] | |||||
| deps = | |||||
| -rrequirements.txt | |||||
| -e.[tests] | |||||
| commands = | |||||
| py.test {posargs} | |||||