Skip to content

Commit

Permalink
added/fixed impersonation logic and regenerated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mdipierro committed Oct 23, 2023
1 parent dad8e0f commit a762f6b
Show file tree
Hide file tree
Showing 56 changed files with 1,320 additions and 1,216 deletions.
2 changes: 1 addition & 1 deletion apps/_documentation/static/en/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 6caf0f7db59c0515710115373bfa6456
config: 154aa256a0dfceb4c55d272ea1758345
tags: 645f666f9bcd5a90fca523b33c5a78b7
22 changes: 22 additions & 0 deletions apps/_documentation/static/en/_static/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ a.headerlink {
visibility: hidden;
}

a:visited {
color: #551A8B;
}

h1:hover > a.headerlink,
h2:hover > a.headerlink,
h3:hover > a.headerlink,
Expand Down Expand Up @@ -670,6 +674,16 @@ dd {
margin-left: 30px;
}

.sig dd {
margin-top: 0px;
margin-bottom: 0px;
}

.sig dl {
margin-top: 0px;
margin-bottom: 0px;
}

dl > dd:last-child,
dl > dd:last-child > :last-child {
margin-bottom: 0;
Expand Down Expand Up @@ -738,6 +752,14 @@ abbr, acronym {
cursor: help;
}

.translated {
background-color: rgba(207, 255, 207, 0.2)
}

.untranslated {
background-color: rgba(255, 207, 207, 0.2)
}

/* -- code displays --------------------------------------------------------- */

pre {
Expand Down
2 changes: 1 addition & 1 deletion apps/_documentation/static/en/_static/css/theme.css

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '1.20230507.1',
const DOCUMENTATION_OPTIONS = {
VERSION: '1.20230718.1',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
1 change: 1 addition & 0 deletions apps/_documentation/static/en/_static/pygments.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ span.linenos.special { color: #000000; background-color: #ffffc0; padding-left:
.highlight .cs { color: #3D7B7B; font-style: italic } /* Comment.Special */
.highlight .gd { color: #A00000 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #E40000 } /* Generic.Error */
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #008400 } /* Generic.Inserted */
Expand Down
26 changes: 17 additions & 9 deletions apps/_documentation/static/en/_static/searchtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ const _removeChildren = (element) => {
const _escapeRegExp = (string) =>
string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string

const _displayItem = (item, searchTerms) => {
const _displayItem = (item, searchTerms, highlightTerms) => {
const docBuilder = DOCUMENTATION_OPTIONS.BUILDER;
const docUrlRoot = DOCUMENTATION_OPTIONS.URL_ROOT;
const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX;
const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX;
const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY;
const contentRoot = document.documentElement.dataset.content_root;

const [docName, title, anchor, descr, score, _filename] = item;

Expand All @@ -75,20 +75,24 @@ const _displayItem = (item, searchTerms) => {
if (dirname.match(/\/index\/$/))
dirname = dirname.substring(0, dirname.length - 6);
else if (dirname === "index/") dirname = "";
requestUrl = docUrlRoot + dirname;
requestUrl = contentRoot + dirname;
linkUrl = requestUrl;
} else {
// normal html builders
requestUrl = docUrlRoot + docName + docFileSuffix;
requestUrl = contentRoot + docName + docFileSuffix;
linkUrl = docName + docLinkSuffix;
}
let linkEl = listItem.appendChild(document.createElement("a"));
linkEl.href = linkUrl + anchor;
linkEl.dataset.score = score;
linkEl.innerHTML = title;
if (descr)
if (descr) {
listItem.appendChild(document.createElement("span")).innerHTML =
" (" + descr + ")";
// highlight search terms in the description
if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js
highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted"));
}
else if (showSearchSummary)
fetch(requestUrl)
.then((responseData) => responseData.text())
Expand All @@ -97,6 +101,9 @@ const _displayItem = (item, searchTerms) => {
listItem.appendChild(
Search.makeSearchSummary(data, searchTerms)
);
// highlight search terms in the summary
if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js
highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted"));
});
Search.output.appendChild(listItem);
};
Expand All @@ -115,14 +122,15 @@ const _finishSearch = (resultCount) => {
const _displayNextItem = (
results,
resultCount,
searchTerms
searchTerms,
highlightTerms,
) => {
// results left, load the summary and display it
// this is intended to be dynamic (don't sub resultsCount)
if (results.length) {
_displayItem(results.pop(), searchTerms);
_displayItem(results.pop(), searchTerms, highlightTerms);
setTimeout(
() => _displayNextItem(results, resultCount, searchTerms),
() => _displayNextItem(results, resultCount, searchTerms, highlightTerms),
5
);
}
Expand Down Expand Up @@ -360,7 +368,7 @@ const Search = {
// console.info("search results:", Search.lastresults);

// print the results
_displayNextItem(results, results.length, searchTerms);
_displayNextItem(results, results.length, searchTerms, highlightTerms);
},

/**
Expand Down
24 changes: 12 additions & 12 deletions apps/_documentation/static/en/chapter-01.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>What is py4web? &mdash; py4web 1.20230507.1 documentation</title>
<title>What is py4web? &mdash; py4web 1.20230718.1 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/tabs.css" type="text/css" />
Expand All @@ -14,12 +14,12 @@
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->

<script src="_static/jquery.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<script src="_static/js/toggle.js"></script>
<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=4c9c9fab"></script>
<script src="_static/doctools.js?v=888ff710"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/toggle.js?v=e1b5a5a1"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
Expand All @@ -40,7 +40,7 @@
<img src="_static/logo.png" class="logo" alt="Logo"/>
</a>
<div class="version">
1.20230507.1
1.20230718.1
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
Expand Down Expand Up @@ -98,7 +98,7 @@
<div itemprop="articleBody">

<section id="what-is-py4web">
<h1>What is py4web?<a class="headerlink" href="#what-is-py4web" title="Permalink to this heading"></a></h1>
<h1>What is py4web?<a class="headerlink" href="#what-is-py4web" title="Link to this heading"></a></h1>
<p>PY4WEB is a web framework for rapid development of efficient database
driven web applications. It is an evolution of the popular web2py
framework, but much faster and slicker. Its internal design has been much
Expand Down Expand Up @@ -198,7 +198,7 @@ <h1>What is py4web?<a class="headerlink" href="#what-is-py4web" title="Permalink
development easy and accessible, while producing applications that are
fast and secure.</p>
<section id="acknowledgments">
<h2>Acknowledgments<a class="headerlink" href="#acknowledgments" title="Permalink to this heading"></a></h2>
<h2>Acknowledgments<a class="headerlink" href="#acknowledgments" title="Link to this heading"></a></h2>
<p>Many thanks to everyone who has contributed to the project, and especially:</p>
<ul class="simple">
<li><p><a class="reference external" href="https://github.com/mdipierro">Massimo Di Pierro</a></p></li>
Expand Down Expand Up @@ -256,7 +256,7 @@ <h2>Acknowledgments<a class="headerlink" href="#acknowledgments" title="Permalin
<label for="switch"></label>
</span>

v: 1.20230507.1
v: 1.20230718.1
<span class="fa fa-caret-down"></span>
</span>
<div class="rst-other-versions">
Expand Down
46 changes: 23 additions & 23 deletions apps/_documentation/static/en/chapter-02.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Help, resources and hints &mdash; py4web 1.20230507.1 documentation</title>
<title>Help, resources and hints &mdash; py4web 1.20230718.1 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/tabs.css" type="text/css" />
Expand All @@ -14,12 +14,12 @@
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->

<script src="_static/jquery.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<script src="_static/js/toggle.js"></script>
<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=4c9c9fab"></script>
<script src="_static/doctools.js?v=888ff710"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/toggle.js?v=e1b5a5a1"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
Expand All @@ -40,7 +40,7 @@
<img src="_static/logo.png" class="logo" alt="Logo"/>
</a>
<div class="version">
1.20230507.1
1.20230718.1
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
Expand Down Expand Up @@ -113,26 +113,26 @@
<div itemprop="articleBody">

<section id="help-resources-and-hints">
<h1>Help, resources and hints<a class="headerlink" href="#help-resources-and-hints" title="Permalink to this heading"></a></h1>
<h1>Help, resources and hints<a class="headerlink" href="#help-resources-and-hints" title="Link to this heading"></a></h1>
<p>We’ve made our best to make PY4WEB simple and clean. But you know, modern web programming is a daunting task. It requires an open mind, able to
jump frequently (without being lost!) from python to HTML to javascript to css and even database management.
But don’t be scared, in this manual we’ll assist you side by side in this journey. And there are many other valuable resources that we’re going to show you.</p>
<section id="resources">
<h2>Resources<a class="headerlink" href="#resources" title="Permalink to this heading"></a></h2>
<h2>Resources<a class="headerlink" href="#resources" title="Link to this heading"></a></h2>
<section id="this-manual">
<h3>This manual<a class="headerlink" href="#this-manual" title="Permalink to this heading"></a></h3>
<h3>This manual<a class="headerlink" href="#this-manual" title="Link to this heading"></a></h3>
<p>This manual is the Reference Manual for py4web. It’s available online at <a class="reference external" href="https://py4web.com/_documentation/static/index.html">https://py4web.com/_documentation/static/index.html</a>, where you’ll also find the PDF and EBOOK version, in multiple languages. It written in RestructuredText and generated using Sphinx.</p>
</section>
<section id="the-google-group">
<h3>The Google group<a class="headerlink" href="#the-google-group" title="Permalink to this heading"></a></h3>
<h3>The Google group<a class="headerlink" href="#the-google-group" title="Link to this heading"></a></h3>
<p>There is a dedicated mailing list hosted on Google Groups, see <a class="reference external" href="https://groups.google.com/g/py4web">https://groups.google.com/g/py4web</a>. This is the main source of discussions for developers and simple users. For any problem you should face, this is the right place to search for a hint or a solution.</p>
</section>
<section id="the-discord-server">
<h3>The Discord server<a class="headerlink" href="#the-discord-server" title="Permalink to this heading"></a></h3>
<h3>The Discord server<a class="headerlink" href="#the-discord-server" title="Link to this heading"></a></h3>
<p>For quick questions and chats you can also use the free <a class="reference external" href="https://discord.gg/xCzQ9KTk3W">Discord server dedicated to py4web</a>. You could usually find many py4web developers hanging out in the channel.</p>
</section>
<section id="tutorials-and-video">
<h3>Tutorials and video<a class="headerlink" href="#tutorials-and-video" title="Permalink to this heading"></a></h3>
<h3>Tutorials and video<a class="headerlink" href="#tutorials-and-video" title="Link to this heading"></a></h3>
<p>There are many tutorials and videos available. Here are some of them:</p>
<ul class="simple">
<li><p>the <a class="reference external" href="https://learn-py4web.github.io">Learn Py4Web site</a> by Luca de Alfaro (with lots of excellent training videos)</p></li>
Expand All @@ -143,21 +143,21 @@ <h3>Tutorials and video<a class="headerlink" href="#tutorials-and-video" title="
</ul>
</section>
<section id="the-sources-on-github">
<h3>The sources on GitHub<a class="headerlink" href="#the-sources-on-github" title="Permalink to this heading"></a></h3>
<h3>The sources on GitHub<a class="headerlink" href="#the-sources-on-github" title="Link to this heading"></a></h3>
<p>Last but not least, py4web is Open Source, with a BSD v3 license, hosted on GitHub at <a class="reference external" href="https://github.com/web2py/py4web">https://github.com/web2py/py4web</a>. This means that you can read, study and experiment
with all of its internal details by yourself.</p>
</section>
</section>
<section id="hints-and-tips">
<h2>Hints and tips<a class="headerlink" href="#hints-and-tips" title="Permalink to this heading"></a></h2>
<h2>Hints and tips<a class="headerlink" href="#hints-and-tips" title="Link to this heading"></a></h2>
<p>This paragraph is dedicated to preliminary hints, suggestions and tips that could be helpful to know before starting to learn py4web.</p>
<section id="prerequisites">
<h3>Prerequisites<a class="headerlink" href="#prerequisites" title="Permalink to this heading"></a></h3>
<h3>Prerequisites<a class="headerlink" href="#prerequisites" title="Link to this heading"></a></h3>
<p>In order to understand py4web you need at least a basic python knowledge. There are many books, courses and tutorials available on the web - choose what’s best for you.
The python’s decorators, in particular, are a milestone of any python web framework and you have to fully understand it.</p>
</section>
<section id="a-modern-python-workplace">
<h3>A modern python workplace<a class="headerlink" href="#a-modern-python-workplace" title="Permalink to this heading"></a></h3>
<h3>A modern python workplace<a class="headerlink" href="#a-modern-python-workplace" title="Link to this heading"></a></h3>
<p>In the following chapters you will start coding on your computer. We suggest you to setup a modern python workplace if you plan to do it efficiently and safely.
Even for running simple examples and experimenting a little, we strongly suggest to use an <strong>Integrated Development Environment</strong> (IDE). This will make your programming experience much better, allowing syntax checking, linting and visual debugging.
Nowadays there are two free and multi-platform main choices: Microsoft Visual Studio Code aka <a class="reference external" href="https://code.visualstudio.com/">VScode</a> and
Expand All @@ -176,7 +176,7 @@ <h3>A modern python workplace<a class="headerlink" href="#a-modern-python-workpl
</ul>
</section>
<section id="debugging-py4web-with-vscode">
<h3>Debugging py4web with VScode<a class="headerlink" href="#debugging-py4web-with-vscode" title="Permalink to this heading"></a></h3>
<h3>Debugging py4web with VScode<a class="headerlink" href="#debugging-py4web-with-vscode" title="Link to this heading"></a></h3>
<p>It’s quite simple to run and debug py4web within VScode.</p>
<p>If you have <strong>installed py4web from source</strong>, you just need to open the main py4web folder (not the apps folder!) with VScode and add:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>&quot;args&quot;: [&quot;run&quot;, &quot;apps&quot;],
Expand Down Expand Up @@ -209,12 +209,12 @@ <h3>Debugging py4web with VScode<a class="headerlink" href="#debugging-py4web-wi
</div>
</section>
<section id="debugging-py4web-with-pycharm">
<h3>Debugging py4web with PyCharm<a class="headerlink" href="#debugging-py4web-with-pycharm" title="Permalink to this heading"></a></h3>
<h3>Debugging py4web with PyCharm<a class="headerlink" href="#debugging-py4web-with-pycharm" title="Link to this heading"></a></h3>
<p>In PyCharm, if you should get gevent errors you need to enable Settings | Build, Execution, Deployment | Python Debugger | Gevent compatible.</p>
</section>
</section>
<section id="how-to-contribute">
<h2>How to contribute<a class="headerlink" href="#how-to-contribute" title="Permalink to this heading"></a></h2>
<h2>How to contribute<a class="headerlink" href="#how-to-contribute" title="Link to this heading"></a></h2>
<p>We need help from everyone: support our efforts! You can just participate in the Google group trying to answer other’s questions, submit bugs using or create pull requests on the GitHub
repository.</p>
<p>If you wish to correct and expand this manual, or even translate it in a new foreign language, you can read all the needed information directly on the
Expand Down Expand Up @@ -261,7 +261,7 @@ <h2>How to contribute<a class="headerlink" href="#how-to-contribute" title="Perm
<label for="switch"></label>
</span>

v: 1.20230507.1
v: 1.20230718.1
<span class="fa fa-caret-down"></span>
</span>
<div class="rst-other-versions">
Expand Down
Loading

0 comments on commit a762f6b

Please sign in to comment.