Skip to content

Commit 189df85

Browse files
committed
Initial commit to public repository
1 parent 1b5ef3a commit 189df85

File tree

384 files changed

+32163
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

384 files changed

+32163
-2
lines changed

.flake8

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[flake8]
2+
exclude =
3+
.git,.tox,.venv,__pycache__,
4+
build,dist,docs,
5+
Cache,Configs,ErrorMsgs,Logs,Sessions,
6+
WSGIScript.py
7+
max-line-length = 79

.gitattributes

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
* text=auto eol=lf
2+
3+
*.bat text eol=crlf
4+
*.config text eol=lf
5+
*.css text eol=lf
6+
*.html text eol=lf
7+
*.js text eol=lf
8+
*.prefs text
9+
*.py text eol=lf
10+
*.rst text eol=lf
11+
*.sh text eol=lf
12+
*.txt text eol=lf
13+
*.po text eol=lf
14+
*.pot text eol=lf
15+
*.styl text eol=lf
16+
*.xml text
17+
18+
*.gif binary
19+
*.ico binary
20+
*.jpg binary
21+
*.lnk binary
22+
*.mo binary
23+
*.png binary
24+
*.exe binary
25+
*.so binary
26+
*.ppt binary
27+
*.pdf binary
28+
*.gz binary
29+
*.zip binary

.gitignore

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
*~
2+
*.address
3+
*.bak
4+
*.default
5+
*.egg-info
6+
*.log
7+
*.patch
8+
*.pid
9+
*.pstats
10+
*.pyc
11+
*.pyo
12+
*.ses
13+
*.swp
14+
15+
build/
16+
dist/
17+
_build/
18+
19+
Thumbs.db
20+
.DS_Store
21+
22+
Cache/
23+
Logs/
24+
ErrorMsgs/
25+
Sessions/
26+
27+
.idea/
28+
.tox/
29+
.venv/

.pylintrc

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
[MASTER]
2+
3+
ignore =
4+
.git, .tox, .venv, .idea,
5+
build, dist,
6+
Cache, ErrorMsgs, Logs, Sessions,
7+
CGITraceback.py, FieldStorage.py, WSGIScript.py
8+
9+
init-hook = sys.path.insert(0, 'webware')
10+
11+
[MESSAGES CONTROL]
12+
13+
disable =
14+
attribute-defined-outside-init,
15+
broad-except,
16+
cyclic-import,
17+
similarities,
18+
eval-used,
19+
exec-used,
20+
fixme,
21+
global-statement,
22+
inconsistent-return-statements,
23+
missing-docstring,
24+
no-self-use,
25+
protected-access,
26+
redefined-argument-from-local,
27+
redefined-outer-name
28+
29+
[REFACTORING]
30+
31+
max-nested-blocks = 7
32+
33+
[BASIC]
34+
35+
attr-naming-style = camelCase
36+
argument-naming-style = camelCase
37+
class-attribute-naming-style = camelCase
38+
class-naming-style = PascalCase
39+
const-naming-style = any
40+
function-naming-style = camelCase
41+
inlinevar-naming-style = camelCase
42+
method-naming-style = camelCase
43+
module-naming-style = PascalCase
44+
variable-naming-style = camelCase
45+
46+
good-names =
47+
b, c, d, e, f, g, h, i, j, k, m, n, p, q, r, s, t, ,v, w, x, y,
48+
dt, fd, fp, fs, ip, tm, ts, wr,
49+
dir_, id_, input_, type_,
50+
allow_none, entry_point, has_key, start_response, ssl_ctx,
51+
memcache, redis,
52+
index, webware, MixIn,
53+
simple, test1, test2, test3, test4, test5, test5join1, test5join2,
54+
url1, url2, url3, util, vhosts
55+
56+
bad-names = l, o
57+
58+
[FORMAT]
59+
60+
indent-after-paren = 4
61+
62+
[DESIGN]
63+
64+
max-attributes = 35
65+
max-args = 10
66+
max-branches = 40
67+
max-line-length = 79
68+
max-locals = 30
69+
max-module-lines = 1500
70+
max-parents = 10
71+
max-public-methods = 100
72+
max-returns = 10
73+
max-statements = 150
74+
min-public-methods = 0

LICENSE

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2019 Christoph Zwerschke
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

MANIFEST.in

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
include MANIFEST.in
2+
3+
include LICENSE
4+
include README.md
5+
6+
include .flake8
7+
include .pylintrc
8+
9+
include tox.ini
10+
11+
graft bin
12+
13+
graft webware
14+
recursive-include webware/PSP *.config *.psp *.html *.png
15+
16+
prune webware/Cache
17+
prune webware/ErrorMsgs
18+
prune webware/Logs
19+
prune webware/Sessions
20+
21+
graft docs
22+
recursive-include docs *.rst conf.py Makefile make.bat *.png
23+
prune docs/_build
24+
25+
global-exclude *.py[co] *.ses __pycache__

README.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
1-
# w4py3
2-
Webware for Python 3
1+
# Webware for Python 3
2+
3+
Webware for Python is a well proven and platform-independent suite of Python packages and tools for developing object-oriented, web-based applications. The suite uses well known design patterns and includes Servlets, Python Server Pages (PSP), Task Scheduling, Session Management, and many other features. Webware is very modular and easily extended.
4+
5+
Webware for Python 3 is the latest version of the suite, which has been adapted to use Python 3 instead of Python 2 and the WSGI standard instead of the custom Webware threaded application server and various adapters, but otherwise kept compatible with the legacy version.
6+
7+
You can still find the legacy version of Webware for Python at: <https://cito.github.io/w4py/>
8+
9+
The current homepage is at: <https://github.com/Cito/w4py3>

bin/README

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
ErrorMsgs directory
2+
===================
3+
4+
This directory will contain error information captured by Webware while running
5+
as a WSGI application. Each error is saved in its own HTML file. You can also
6+
access these files through the application administration pages (e.g.,
7+
http://localhost:8080/Admin/). You can choose a different location for this
8+
directory by changing the "ErrorMessagesDir" setting in the configuration file
9+
Configs/Application.config.
10+
11+
See the Webware documentation for more information.

bin/editfile.bat

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@echo off
2+
rem Helper script for running editfile.py on Windows
3+
pushd %~dp0
4+
python editfile.py "%1"
5+
popd
6+
rem pause

bin/editfile.py

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#!/usr/bin/env python3
2+
3+
"""Helper script for the feature provided by the IncludeEditLink setting."""
4+
5+
import os
6+
import sys
7+
from email import message_from_file
8+
from subprocess import run
9+
10+
editor = 'Vim' # your favorite editor
11+
12+
defaultArgs = [editor, ' +{line}', '{filename}']
13+
14+
# add an entry for your favorite editor here if it does not already exist
15+
editorArgs = {
16+
'Emacs':
17+
['gnuclient', '+{line}', '{filename}'],
18+
'Geany':
19+
['geany', '-l', '{line}', '{filename}'],
20+
'Geany (Windows)':
21+
['C:/Program Files (x86)/Geany/bin/geany.exe',
22+
'-l', '{line}', '{filename}'],
23+
'gedit':
24+
['gedit', '+{line}', '{filename}'],
25+
'jEdit':
26+
['jedit', '{filename}', '+line:{line}'],
27+
'jEdit (Windows)':
28+
['C:/Program Files/jEdit/jedit.exe', '{filename}', '+line:{line}'],
29+
'Kate':
30+
['kate', '-u', '-l', '{line}', '{filename}'],
31+
'Komodo':
32+
['komodo', '-l', '{line}', '{filename}'],
33+
'KWrite':
34+
['kwrite', '--line', '{line}', '{filename}'],
35+
'Notepad++ (Windows)':
36+
['C:/Program Files/Notepad++/notepad++.exe', '-n{line}', '{filename}'],
37+
'PSPad (Windows)':
38+
['C:/Program Files (x86)/PSPad editor/PSPad.exe',
39+
'-{line}', '{filename}'],
40+
'SciTE':
41+
['scite', '{filename}', '-goto:{line}'],
42+
'SciTE (Windows)':
43+
['C:/wscite/SciTE.exe', '{filename}', '-goto:{line}'],
44+
'Sublime Text (Windows)':
45+
['C:/Program Files/Sublime Text 3/subl.exe', '{filename}:{line}'],
46+
'Vim':
47+
['gvim', '+{line}', '{filename}'],
48+
}
49+
50+
51+
def transform(params):
52+
"""Transform EditFile parameters.
53+
54+
As an example, if you are under Windows and your edit file
55+
has a Unix filename, then it is transformed to a UNC path.
56+
"""
57+
filename = params['filename']
58+
if os.sep == '\\' and filename.startswith('/'):
59+
filename = os.path.normpath(filename[1:])
60+
hostname = params['hostname'].split(':', 1)[0]
61+
smbPath = fr'\\{hostname}\root'
62+
filename = os.path.join(smbPath, filename)
63+
params['filename'] = filename
64+
return params
65+
66+
67+
def openFile(params):
68+
"""Open editor with file specified in parameters."""
69+
params = {key.lower(): value for key, value in params.items()}
70+
params = transform(params)
71+
args = editorArgs.get(editor, defaultArgs)
72+
args[1:] = [arg.format(**params) for arg in args[1:]]
73+
print(' '.join(args))
74+
run(args)
75+
76+
77+
def parseFile(filename):
78+
"""Parse the Webware EditFile."""
79+
openFile(message_from_file(open(filename)))
80+
81+
82+
if __name__ == '__main__':
83+
parseFile(sys.argv[1])

docs/Makefile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

0 commit comments

Comments
 (0)