Skip to content

Commit

Permalink
Support Django 4.2; code base cleaned with black, flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
dakrauth committed Dec 12, 2023
1 parent e32fba3 commit 3f605cb
Show file tree
Hide file tree
Showing 163 changed files with 6,673 additions and 36,709 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v1
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ django_swingtime.egg-info/
venv
Dockerrun.aws.json
.python-version
/temp
/docs/_build
11 changes: 5 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ Django Swingtime
.. image:: https://badge.fury.io/py/django-swingtime.svg
:target: http://badge.fury.io/py/django-swingtime

:Version: 1.3.0
:Version: 1.4.0
:Demo: https://nerdfog.com/swingtime/
:Download: https://pypi.org/project/django-swingtime/
:Source: https://github.com/dakrauth/django-swingtime
:Documentation: http://dakrauth.github.io/django-swingtime/


Welcome
-------
Description
-----------

Swingtime is a `Django <http://www.djangoproject.com/>`_ application similar to
a stripped-down version of iCal for Mac OS X or Google Calendar.
Expand Down Expand Up @@ -100,7 +100,6 @@ Features
Requirements
------------

* Python 3.7+
* `Django 2.2, 3.2+ <http://www.djangoproject.com/download/>`_
* Python 3.8+
* `Django >=3.2,<5.0 <http://www.djangoproject.com/download/>`_
* `python-dateutil <http://labix.org/python-dateutil>`_.

26 changes: 13 additions & 13 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = python -msphinx
SPHINXPROJ = Swingtime
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = src
BUILDDIR = ../docs
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
rm -rf _static
clean:
rm -rf "$(BUILDDIR)"
rm -rf _sources
mv html/* ./
rm html/.buildinfo
rmdir html
rm -rf _static
rm -f *.html *.js *inv

html: clean
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
mv _build/html/* ./
2 changes: 1 addition & 1 deletion docs/_sources/demo.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ time.
Currently, Swingtime does not include any templates of its own. The demo project
provides some sample templates to use as a guide or starting point.

The easiest way to run the demo is to use Docker::
The easiest way to run the demo is to use Docker:

.. code:: bash
Expand Down
10 changes: 5 additions & 5 deletions docs/_sources/installation.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ Development

* Or, download::

$ curl -o swingtime.zip -L https://github.com/dakrauth/django-swingtime/archive/master.zip
$ curl -o swingtime.zip -L https://github.com/dakrauth/django-swingtime/archive/main.zip
$ unzip swingtime.zip
$ cd django-swingtime-master
$ cd django-swingtime-main

* Environment::

Expand All @@ -46,11 +46,11 @@ Development
* Test

Assuming you have `pyenv <https://github.com/pyenv/pyenv>`_ installed and the
following versions installed::
following versions installed (``x`` would be your installed patch version)::

$ pyenv local 3.7.2 3.4.9 3.5.6 3.6.8
$ pyenv local 3.8.x 3.9.x 3.10.x 3.11.x 3.12.x
$ tox # or...
$ tox -e py37-django2.1 # build and test only Python 3.7 and Django 2.1
$ tox -e py38-django3.2 # build and test only Python 3.8 and Django 3.2

* Documentation

Expand Down
4 changes: 4 additions & 0 deletions docs/_sources/intro.rst.txt
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
=====
Intro
=====

.. include:: ../../README.rst
123 changes: 123 additions & 0 deletions docs/_static/_sphinx_javascript_frameworks_compat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
/* Compatability shim for jQuery and underscores.js.
*
* Copyright Sphinx contributors
* Released under the two clause BSD licence
*/

/**
* small helper function to urldecode strings
*
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL
*/
jQuery.urldecode = function(x) {
if (!x) {
return x
}
return decodeURIComponent(x.replace(/\+/g, ' '));
};

/**
* small helper function to urlencode strings
*/
jQuery.urlencode = encodeURIComponent;

/**
* This function returns the parsed url parameters of the
* current request. Multiple values per key are supported,
* it will always return arrays of strings for the value parts.
*/
jQuery.getQueryParameters = function(s) {
if (typeof s === 'undefined')
s = document.location.search;
var parts = s.substr(s.indexOf('?') + 1).split('&');
var result = {};
for (var i = 0; i < parts.length; i++) {
var tmp = parts[i].split('=', 2);
var key = jQuery.urldecode(tmp[0]);
var value = jQuery.urldecode(tmp[1]);
if (key in result)
result[key].push(value);
else
result[key] = [value];
}
return result;
};

/**
* highlight a given string on a jquery object by wrapping it in
* span elements with the given class name.
*/
jQuery.fn.highlightText = function(text, className) {
function highlight(node, addItems) {
if (node.nodeType === 3) {
var val = node.nodeValue;
var pos = val.toLowerCase().indexOf(text);
if (pos >= 0 &&
!jQuery(node.parentNode).hasClass(className) &&
!jQuery(node.parentNode).hasClass("nohighlight")) {
var span;
var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg");
if (isInSVG) {
span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
} else {
span = document.createElement("span");
span.className = className;
}
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
node.parentNode.insertBefore(span, node.parentNode.insertBefore(
document.createTextNode(val.substr(pos + text.length)),
node.nextSibling));
node.nodeValue = val.substr(0, pos);
if (isInSVG) {
var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
var bbox = node.parentElement.getBBox();
rect.x.baseVal.value = bbox.x;
rect.y.baseVal.value = bbox.y;
rect.width.baseVal.value = bbox.width;
rect.height.baseVal.value = bbox.height;
rect.setAttribute('class', className);
addItems.push({
"parent": node.parentNode,
"target": rect});
}
}
}
else if (!jQuery(node).is("button, select, textarea")) {
jQuery.each(node.childNodes, function() {
highlight(this, addItems);
});
}
}
var addItems = [];
var result = this.each(function() {
highlight(this, addItems);
});
for (var i = 0; i < addItems.length; ++i) {
jQuery(addItems[i].parent).before(addItems[i].target);
}
return result;
};

/*
* backward compatibility for jQuery.browser
* This will be supported until firefox bug is fixed.
*/
if (!jQuery.browser) {
jQuery.uaMatch = function(ua) {
ua = ua.toLowerCase();

var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
/(webkit)[ \/]([\w.]+)/.exec(ua) ||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
/(msie) ([\w.]+)/.exec(ua) ||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
[];

return {
browser: match[ 1 ] || "",
version: match[ 2 ] || "0"
};
};
jQuery.browser = {};
jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true;
}
Binary file removed docs/_static/ajax-loader.gif
Binary file not shown.
Loading

0 comments on commit 3f605cb

Please sign in to comment.