Skip to content

Commit

Permalink
Merge 7c06a0d into 8f91397
Browse files Browse the repository at this point in the history
  • Loading branch information
Natim committed Apr 10, 2020
2 parents 8f91397 + 7c06a0d commit a5af22e
Show file tree
Hide file tree
Showing 22 changed files with 439 additions and 379 deletions.
37 changes: 37 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
exclude: '^tinymce/(static/tinymce|media/tiny_mce|static/.*min.js$)'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-yaml
- id: debug-statements
- id: detect-private-key
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: 19.10b0
hooks:
- id: black
args: [--exclude=static]

- repo: https://github.com/asottile/seed-isort-config
rev: v2.1.0
hooks:
- id: seed-isort-config
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21
hooks:
- id: isort
additional_dependencies:
- toml

- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.9
hooks:
- id: flake8
args: [--max-line-length=110]
10 changes: 7 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ python:
- 3.6
- 3.7
- 3.8
matrix:
jobs:
fast_finish: true
include:
- python: 3.8
env: TOX_ENV=flake8
- name: "Code checks"
python: 3.8
install: pip install pre-commit
script:
pre-commit run --all-files --show-diff-on-failure

addons:
apt:
packages:
Expand Down
1 change: 0 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,3 @@ htmlsvn: html
`find .build/html -name .svn -type f -prune -o -name *.png`
svn propset -R svn:mime-type text/html \
`find .build/html -name .svn -type f -prune -o -name *.html`

21 changes: 10 additions & 11 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
templates_path = []

# The suffix of source filenames.
source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# General substitutions.
project = "django-tinymce"
Expand All @@ -50,7 +50,7 @@
# non-false value, then it is used:
# today = ''
# Else, today_fmt is used as the format for a strftime call.
today_fmt = '%B %d, %Y'
today_fmt = "%B %d, %Y"

# List of documents that shouldn't be included in the build.
# unused_docs = []
Expand All @@ -75,7 +75,7 @@
show_authors = False

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"


# Options for HTML output
Expand All @@ -84,7 +84,7 @@
# The style sheet to use for HTML and HTML Help pages. A file of that name
# must exist either in Sphinx' static/ path, or in one of the custom paths
# given in html_static_path.
html_style = 'default.css'
html_style = "default.css"

# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
Expand All @@ -105,11 +105,11 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['.static']
html_static_path = [".static"]

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
html_last_updated_fmt = '%b %d, %Y'
html_last_updated_fmt = "%b %d, %Y"

# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
Expand Down Expand Up @@ -140,10 +140,10 @@
# html_use_opensearch = ''

# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
html_file_suffix = '.html'
html_file_suffix = ".html"

# Output file base name for HTML help builder.
htmlhelp_basename = f'{project}doc'
htmlhelp_basename = f"{project}doc"


# Options for LaTeX output
Expand All @@ -158,8 +158,7 @@
# Grouping the document tree into LaTeX files. List of tuples (source
# start file, target name, title, author, document class [howto/manual]).
latex_documents = [
(master_doc, f'{project}.tex', f'{project} Documentation',
authors, 'manual'),
(master_doc, f"{project}.tex", f"{project} Documentation", authors, "manual"),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down
1 change: 0 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,3 @@ Documentation
installation
usage
history

12 changes: 7 additions & 5 deletions runtests.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'testtinymce.settings'
test_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, test_dir)

import django
from django.conf import settings
from django.test.utils import get_runner

os.environ["DJANGO_SETTINGS_MODULE"] = "testtinymce.settings"
test_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, test_dir)


def runtests():
django.setup()
TestRunner = get_runner(settings)
test_runner = TestRunner(verbosity=1, interactive=True)
failures = test_runner.run_tests(['tinymce'])
failures = test_runner.run_tests(["tinymce"])
sys.exit(bool(failures))

if __name__ == '__main__':

if __name__ == "__main__":
runtests()
52 changes: 28 additions & 24 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,52 +1,56 @@
#!/usr/bin/env python
import codecs
import os
from setuptools import setup, find_packages

from setuptools import find_packages, setup

here = os.path.abspath(os.path.dirname(__file__))


def read_file(filename):
"""Open a related file and return its content."""
with codecs.open(os.path.join(here, filename), encoding='utf-8') as f:
with codecs.open(os.path.join(here, filename), encoding="utf-8") as f:
content = f.read()
return content

README = read_file('README.rst')
CHANGELOG = read_file('CHANGELOG.rst')

README = read_file("README.rst")
CHANGELOG = read_file("CHANGELOG.rst")


setup(
name="django-tinymce",
version='3.0.0.dev0',
version="3.0.0.dev0",
packages=find_packages(),
include_package_data=True,
author="Aljosa Mohorovic",
author_email="aljosa.mohorovic@gmail.com",
description=("A Django application that contains a widget to render a "
"form field as a TinyMCE editor."),
description=(
"A Django application that contains a widget to render a "
"form field as a TinyMCE editor."
),
long_description=README + "\n\n" + CHANGELOG,
license="MIT License",
keywords="django widget tinymce",
zip_safe=False,
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Topic :: Software Development :: Libraries :: Application Frameworks',
'Topic :: Software Development :: Libraries :: Python Modules',
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Django",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Topic :: Software Development :: Libraries :: Application Frameworks",
"Topic :: Software Development :: Libraries :: Python Modules",
],
platforms=['any'],
platforms=["any"],
url="https://github.com/aljosa/django-tinymce",
test_suite='runtests.runtests',
test_suite="runtests.runtests",
)
74 changes: 37 additions & 37 deletions testtinymce/settings.py
Original file line number Diff line number Diff line change
@@ -1,77 +1,77 @@
# Django settings for testtinymce project.

from os.path import join, dirname, realpath
from os.path import dirname, join, realpath

ROOT_PATH = dirname(realpath(__file__))
DEBUG = True

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': join(ROOT_PATH, "testtinymce.sqlite"),
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": join(ROOT_PATH, "testtinymce.sqlite"),
"USER": "",
"PASSWORD": "",
"HOST": "",
"PORT": "",
}
}

TIME_ZONE = 'America/Chicago'
LANGUAGE_CODE = 'en-us'
TIME_ZONE = "America/Chicago"
LANGUAGE_CODE = "en-us"
SITE_ID = 1
USE_I18N = True
USE_L10N = True

MEDIA_ROOT = join(ROOT_PATH, "media")
MEDIA_URL = '/media/'
ADMIN_MEDIA_PREFIX = '/static/admin/'
MEDIA_URL = "/media/"
ADMIN_MEDIA_PREFIX = "/static/admin/"
STATIC_ROOT = join(ROOT_PATH, "static")
STATIC_URL = "/static/"

MIDDLEWARE = [
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
]
MIDDLEWARE_CLASSES = MIDDLEWARE

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
"BACKEND": "django.template.backends.django.DjangoTemplates",
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
]
},
},
]

SECRET_KEY = 'w4o4x^&b4h4zne9&3b1m-_p-=+&n_i_sdf@oz=gd+6h6v1$sd9'
SECRET_KEY = "w4o4x^&b4h4zne9&3b1m-_p-=+&n_i_sdf@oz=gd+6h6v1$sd9"

ROOT_URLCONF = 'testtinymce.urls'
ROOT_URLCONF = "testtinymce.urls"

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.flatpages',
'tinymce',
'testtinymce.testapp',
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.sites",
"django.contrib.messages",
"django.contrib.staticfiles",
"django.contrib.admin",
"django.contrib.flatpages",
"tinymce",
"testtinymce.testapp",
)

TINYMCE_SPELLCHECKER = True
TINYMCE_COMPRESSOR = True
TINYMCE_DEFAULT_CONFIG = {
'theme': "advanced",
'plugins': "spellchecker",
'theme_advanced_buttons3_add': "|,spellchecker",
"theme": "advanced",
"plugins": "spellchecker",
"theme_advanced_buttons3_add": "|,spellchecker",
}

0 comments on commit a5af22e

Please sign in to comment.