website
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,3 @@
|
|||||||
__pycache__/
|
__pycache__/
|
||||||
website/
|
|
||||||
ms.py
|
ms.py
|
||||||
tape*
|
tape*
|
||||||
@ -15,7 +15,7 @@ for snippet in snippets:
|
|||||||
file_to_write_to.close()
|
file_to_write_to.close()
|
||||||
test_file.write(f'''
|
test_file.write(f'''
|
||||||
import types,functools
|
import types,functools
|
||||||
from tape import test
|
from pytape import test
|
||||||
from {snippet} import {snippet}
|
from {snippet} import {snippet}
|
||||||
def {snippet}_test(t):
|
def {snippet}_test(t):
|
||||||
t.true(isinstance({snippet}, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'{snippet} is a function')
|
t.true(isinstance({snippet}, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'{snippet} is a function')
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import types,functools
|
import types,functools
|
||||||
from tape import test
|
from pytape import test
|
||||||
from average import average
|
from average import average
|
||||||
def average_test(t):
|
def average_test(t):
|
||||||
t.true(isinstance(average, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'average is a function')
|
t.true(isinstance(average, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'average is a function')
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import types,functools
|
import types,functools
|
||||||
from tape import test
|
from pytape import test
|
||||||
from byte_size import byte_size
|
from byte_size import byte_size
|
||||||
def byte_size_test(t):
|
def byte_size_test(t):
|
||||||
t.true(isinstance(byte_size, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'byte_size is a function')
|
t.true(isinstance(byte_size, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'byte_size is a function')
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import types,functools
|
import types,functools
|
||||||
from tape import test
|
from pytape import test
|
||||||
from capitalize import capitalize
|
from capitalize import capitalize
|
||||||
def capitalize_test(t):
|
def capitalize_test(t):
|
||||||
t.true(isinstance(capitalize, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'capitalize is a function')
|
t.true(isinstance(capitalize, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'capitalize is a function')
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import types,functools
|
import types,functools
|
||||||
from tape import test
|
from pytape import test
|
||||||
from capitalize_every_word import capitalize_every_word
|
from capitalize_every_word import capitalize_every_word
|
||||||
def capitalize_every_word_test(t):
|
def capitalize_every_word_test(t):
|
||||||
t.true(isinstance(capitalize_every_word, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'capitalize_every_word is a function')
|
t.true(isinstance(capitalize_every_word, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'capitalize_every_word is a function')
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import types,functools
|
import types,functools
|
||||||
from tape import test
|
from pytape import test
|
||||||
from chunk import chunk
|
from chunk import chunk
|
||||||
def chunk_test(t):
|
def chunk_test(t):
|
||||||
t.true(isinstance(chunk, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'chunk is a function')
|
t.true(isinstance(chunk, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'chunk is a function')
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import types,functools
|
import types,functools
|
||||||
from tape import test
|
from pytape import test
|
||||||
from compact import compact
|
from compact import compact
|
||||||
def compact_test(t):
|
def compact_test(t):
|
||||||
t.true(isinstance(compact, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'compact is a function')
|
t.true(isinstance(compact, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'compact is a function')
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import types,functools
|
import types,functools
|
||||||
from tape import test
|
from pytape import test
|
||||||
from count_by import count_by
|
from count_by import count_by
|
||||||
def count_by_test(t):
|
def count_by_test(t):
|
||||||
t.true(isinstance(count_by, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'count_by is a function')
|
t.true(isinstance(count_by, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'count_by is a function')
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import types,functools
|
import types,functools
|
||||||
from tape import test
|
from pytape import test
|
||||||
from count_occurences import count_occurences
|
from count_occurences import count_occurences
|
||||||
def count_occurences_test(t):
|
def count_occurences_test(t):
|
||||||
t.true(isinstance(count_occurences, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'count_occurences is a function')
|
t.true(isinstance(count_occurences, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'count_occurences is a function')
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import types,functools
|
import types,functools
|
||||||
from tape import test
|
from pytape import test
|
||||||
from count_vowels import count_vowels
|
from count_vowels import count_vowels
|
||||||
def count_vowels_test(t):
|
def count_vowels_test(t):
|
||||||
t.true(isinstance(count_vowels, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'count_vowels is a function')
|
t.true(isinstance(count_vowels, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'count_vowels is a function')
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import types,functools
|
import types,functools
|
||||||
from tape import test
|
from pytape import test
|
||||||
from decapitalize import decapitalize
|
from decapitalize import decapitalize
|
||||||
def decapitalize_test(t):
|
def decapitalize_test(t):
|
||||||
t.true(isinstance(decapitalize, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'decapitalize is a function')
|
t.true(isinstance(decapitalize, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'decapitalize is a function')
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import types,functools
|
import types,functools
|
||||||
from tape import test
|
from pytape import test
|
||||||
from deep_flatten import deep_flatten
|
from deep_flatten import deep_flatten
|
||||||
def deep_flatten_test(t):
|
def deep_flatten_test(t):
|
||||||
t.true(isinstance(deep_flatten, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'deep_flatten is a function')
|
t.true(isinstance(deep_flatten, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'deep_flatten is a function')
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import types,functools
|
import types,functools
|
||||||
from tape import test
|
from pytape import test
|
||||||
from difference import difference
|
from difference import difference
|
||||||
def difference_test(t):
|
def difference_test(t):
|
||||||
t.true(isinstance(difference, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'difference is a function')
|
t.true(isinstance(difference, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'difference is a function')
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import types,functools
|
import types,functools
|
||||||
from tape import test
|
from pytape import test
|
||||||
from difference_by import difference_by
|
from difference_by import difference_by
|
||||||
def difference_by_test(t):
|
def difference_by_test(t):
|
||||||
t.true(isinstance(difference_by, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'difference_by is a function')
|
t.true(isinstance(difference_by, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'difference_by is a function')
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import types,functools
|
import types,functools
|
||||||
from tape import test
|
from pytape import test
|
||||||
from factorial import factorial
|
from factorial import factorial
|
||||||
def factorial_test(t):
|
def factorial_test(t):
|
||||||
t.true(isinstance(factorial, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'factorial is a function')
|
t.true(isinstance(factorial, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'factorial is a function')
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import types,functools
|
import types,functools
|
||||||
from tape import test
|
from pytape import test
|
||||||
from gcd import gcd
|
from gcd import gcd
|
||||||
def gcd_test(t):
|
def gcd_test(t):
|
||||||
t.true(isinstance(gcd, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'gcd is a function')
|
t.true(isinstance(gcd, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'gcd is a function')
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import types,functools
|
import types,functools
|
||||||
from tape import test
|
from pytape import test
|
||||||
from is_lower_case import is_lower_case
|
from is_lower_case import is_lower_case
|
||||||
def is_lower_case_test(t):
|
def is_lower_case_test(t):
|
||||||
t.true(isinstance(is_lower_case, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'is_lower_case is a function')
|
t.true(isinstance(is_lower_case, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'is_lower_case is a function')
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import types,functools
|
import types,functools
|
||||||
from tape import test
|
from pytape import test
|
||||||
from is_upper_case import is_upper_case
|
from is_upper_case import is_upper_case
|
||||||
def is_upper_case_test(t):
|
def is_upper_case_test(t):
|
||||||
t.true(isinstance(is_upper_case, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'is_upper_case is a function')
|
t.true(isinstance(is_upper_case, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'is_upper_case is a function')
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import types,functools
|
import types,functools
|
||||||
from tape import test
|
from pytape import test
|
||||||
from lcm import lcm
|
from lcm import lcm
|
||||||
def lcm_test(t):
|
def lcm_test(t):
|
||||||
t.true(isinstance(lcm, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'lcm is a function')
|
t.true(isinstance(lcm, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'lcm is a function')
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import types,functools
|
import types,functools
|
||||||
from tape import test
|
from pytape import test
|
||||||
from max_n import max_n
|
from max_n import max_n
|
||||||
def max_n_test(t):
|
def max_n_test(t):
|
||||||
t.true(isinstance(max_n, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'max_n is a function')
|
t.true(isinstance(max_n, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'max_n is a function')
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import types,functools
|
import types,functools
|
||||||
from tape import test
|
from pytape import test
|
||||||
from min_n import min_n
|
from min_n import min_n
|
||||||
def min_n_test(t):
|
def min_n_test(t):
|
||||||
t.true(isinstance(min_n, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'min_n is a function')
|
t.true(isinstance(min_n, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'min_n is a function')
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import types,functools
|
import types,functools
|
||||||
from tape import test
|
from pytape import test
|
||||||
from palindrome import palindrome
|
from palindrome import palindrome
|
||||||
def palindrome_test(t):
|
def palindrome_test(t):
|
||||||
t.true(isinstance(palindrome, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'palindrome is a function')
|
t.true(isinstance(palindrome, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'palindrome is a function')
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import types,functools
|
import types,functools
|
||||||
from tape import test
|
from pytape import test
|
||||||
from shuffle import shuffle
|
from shuffle import shuffle
|
||||||
def shuffle_test(t):
|
def shuffle_test(t):
|
||||||
t.true(isinstance(shuffle, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'shuffle is a function')
|
t.true(isinstance(shuffle, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'shuffle is a function')
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import types,functools
|
import types,functools
|
||||||
from tape import test
|
from pytape import test
|
||||||
from spread import spread
|
from spread import spread
|
||||||
def spread_test(t):
|
def spread_test(t):
|
||||||
t.true(isinstance(spread, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'spread is a function')
|
t.true(isinstance(spread, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'spread is a function')
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import types,functools
|
import types,functools
|
||||||
from tape import test
|
from pytape import test
|
||||||
from zip import zip
|
from zip import zip
|
||||||
def zip_test(t):
|
def zip_test(t):
|
||||||
t.true(isinstance(zip, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'zip is a function')
|
t.true(isinstance(zip, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'zip is a function')
|
||||||
|
|||||||
1
website/Procfile
Normal file
1
website/Procfile
Normal file
@ -0,0 +1 @@
|
|||||||
|
web: gunicorn run:app
|
||||||
8
website/app/__init__.py
Normal file
8
website/app/__init__.py
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
from flask import Flask
|
||||||
|
|
||||||
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 0
|
||||||
|
app.secret_key = 'thedarklordisgreat'
|
||||||
|
|
||||||
|
from app import routes,vote
|
||||||
2
website/app/etc/hosts
Normal file
2
website/app/etc/hosts
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
127.0.0.1 localwebsite
|
||||||
|
127.0.0.1 blog.localwebsite
|
||||||
124
website/app/prism.css
Normal file
124
website/app/prism.css
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
/* PrismJS 1.10.0
|
||||||
|
http://prismjs.com/download.html?themes=prism-okaidia&languages=python */
|
||||||
|
/**
|
||||||
|
* okaidia theme for JavaScript, CSS and HTML
|
||||||
|
* Loosely based on Monokai textmate theme by http://www.monokai.nl/
|
||||||
|
* @author ocodia
|
||||||
|
*/
|
||||||
|
|
||||||
|
code[class*="language-"],
|
||||||
|
pre[class*="language-"] {
|
||||||
|
color: #f8f8f2;
|
||||||
|
background: none;
|
||||||
|
text-shadow: 0 1px rgba(0, 0, 0, 0.3);
|
||||||
|
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
||||||
|
text-align: left;
|
||||||
|
white-space: pre;
|
||||||
|
word-spacing: normal;
|
||||||
|
word-break: normal;
|
||||||
|
word-wrap: normal;
|
||||||
|
line-height: 1.5;
|
||||||
|
|
||||||
|
-moz-tab-size: 4;
|
||||||
|
-o-tab-size: 4;
|
||||||
|
tab-size: 4;
|
||||||
|
|
||||||
|
-webkit-hyphens: none;
|
||||||
|
-moz-hyphens: none;
|
||||||
|
-ms-hyphens: none;
|
||||||
|
hyphens: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Code blocks */
|
||||||
|
pre[class*="language-"] {
|
||||||
|
padding: 1em;
|
||||||
|
margin: .5em 0;
|
||||||
|
overflow: auto;
|
||||||
|
border-radius: 0.3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
:not(pre) > code[class*="language-"],
|
||||||
|
pre[class*="language-"] {
|
||||||
|
background: #272822;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Inline code */
|
||||||
|
:not(pre) > code[class*="language-"] {
|
||||||
|
padding: .1em;
|
||||||
|
border-radius: .3em;
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.comment,
|
||||||
|
.token.prolog,
|
||||||
|
.token.doctype,
|
||||||
|
.token.cdata {
|
||||||
|
color: slategray;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.punctuation {
|
||||||
|
color: #f8f8f2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.namespace {
|
||||||
|
opacity: .7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.property,
|
||||||
|
.token.tag,
|
||||||
|
.token.constant,
|
||||||
|
.token.symbol,
|
||||||
|
.token.deleted {
|
||||||
|
color: #f92672;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.boolean,
|
||||||
|
.token.number {
|
||||||
|
color: #ae81ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.selector,
|
||||||
|
.token.attr-name,
|
||||||
|
.token.string,
|
||||||
|
.token.char,
|
||||||
|
.token.builtin,
|
||||||
|
.token.inserted {
|
||||||
|
color: #a6e22e;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.operator,
|
||||||
|
.token.entity,
|
||||||
|
.token.url,
|
||||||
|
.language-css .token.string,
|
||||||
|
.style .token.string,
|
||||||
|
.token.variable {
|
||||||
|
color: #f8f8f2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.atrule,
|
||||||
|
.token.attr-value,
|
||||||
|
.token.function {
|
||||||
|
color: #e6db74;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.keyword {
|
||||||
|
color: #66d9ef;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.regex,
|
||||||
|
.token.important {
|
||||||
|
color: #fd971f;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.important,
|
||||||
|
.token.bold {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.token.italic {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.entity {
|
||||||
|
cursor: help;
|
||||||
|
}
|
||||||
|
|
||||||
4
website/app/prism.js
Normal file
4
website/app/prism.js
Normal file
File diff suppressed because one or more lines are too long
23
website/app/routes.py
Normal file
23
website/app/routes.py
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
from flask import render_template, redirect ,request, url_for
|
||||||
|
from app import app, vote, vote_data
|
||||||
|
|
||||||
|
@app.route('/')
|
||||||
|
@app.route('/index')
|
||||||
|
@app.route('/index/')
|
||||||
|
def index():
|
||||||
|
return render_template('index.html',vote={})
|
||||||
|
'''
|
||||||
|
For future when we have logins
|
||||||
|
@app.route('/',methods=['POST'])
|
||||||
|
@app.route('/index',methods=['POST'])
|
||||||
|
@app.route('/index/',methods=['POST'])
|
||||||
|
def post():
|
||||||
|
try:
|
||||||
|
vote.vote(request.form['submit'])
|
||||||
|
except Exception as e:
|
||||||
|
return render_template('index.html', vote=vote_data.vote_data(),err_400=True,message=e)
|
||||||
|
return redirect(f"/#{request.form['submit']}",code=302)
|
||||||
|
'''
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
8
website/app/snippets
Normal file
8
website/app/snippets
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
count_vowels
|
||||||
|
byte_size
|
||||||
|
capitalize
|
||||||
|
capitalize_every_word
|
||||||
|
decapitalize
|
||||||
|
palindrome
|
||||||
|
is_upper_case
|
||||||
|
is_lower_case
|
||||||
1229
website/app/static/css/prism.css
Normal file
1229
website/app/static/css/prism.css
Normal file
File diff suppressed because it is too large
Load Diff
BIN
website/app/static/favicon.1png
Normal file
BIN
website/app/static/favicon.1png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 98 KiB |
BIN
website/app/static/favicon.ico
Normal file
BIN
website/app/static/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
BIN
website/app/static/favicon.png
Normal file
BIN
website/app/static/favicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.8 KiB |
4
website/app/static/js/prism.js
Normal file
4
website/app/static/js/prism.js
Normal file
File diff suppressed because one or more lines are too long
73
website/app/templates/base.html
Normal file
73
website/app/templates/base.html
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link href="/static/css/prism.css" rel = "stylesheet"></link>
|
||||||
|
<script src="/static/js/prism.js"></script>
|
||||||
|
<meta charset="utf-8"><meta name="description" content=" Python implementation of 30-seconds-of-code "><meta name="keywords" content="python, javascript, snippets, code, programming"><meta name="author" content="Rohit Kumar Tanwar (mst10041967@gmail.com)"><meta name="viewport" content="width=device-width,initial-scale=1"><meta property="og:title" content="30 seconds of python code"><meta property="og:description" content="Python implementation of 30 seconds of code"><meta property="og:type" content="website"><meta property="og:image" content="static/favicon.png"><link rel="icon" type="image/ico" href="static/favicon.png">
|
||||||
|
</head>
|
||||||
|
<body onload="loader()">
|
||||||
|
<a href="https://github.com/kriadmin/30-seconds-of-python-code" class="github-corner" aria-label="View source on Github"><svg width="90" height="90" viewBox="0 0 250 250" style="fill:#151513;color:#fff;position:absolute;top:0;border:0;right:0" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin:130px 106px" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>
|
||||||
|
{% if err_400 %}
|
||||||
|
<div class="error">{{ message }}</div>
|
||||||
|
{% endif %}
|
||||||
|
<header style="height:5.5rem"><h1 class="logo"><img src="static/favicon.png" style="height:4rem" alt="logo"><span id="title"> 30 seconds of python code</span> <small>Python Implementation of 30 seconds of code</small></h1><label for="doc-drawer-checkbox" class="button drawer-toggle" id="menu-toggle"></label></header>
|
||||||
|
{% block content %}{% endblock %}
|
||||||
|
<script>
|
||||||
|
const search = (node) => {
|
||||||
|
let matchingTags = [];
|
||||||
|
Array.from(node.parentElement.parentElement.getElementsByTagName('a')).forEach(x => {
|
||||||
|
let data = [x.innerText.toLowerCase(), ...x.getAttribute('tags').split(',')].map(v => !!(v.indexOf(node.value.toLowerCase()) + 1));
|
||||||
|
if(data.includes(true)){
|
||||||
|
x.style.display = '';
|
||||||
|
matchingTags.push(x.getAttribute('tags').split(',')[0]);
|
||||||
|
}
|
||||||
|
else x.style.display = 'none';
|
||||||
|
});
|
||||||
|
Array.from(node.parentElement.parentElement.getElementsByTagName('h3')).forEach(x => {
|
||||||
|
x.style.display = matchingTags.includes(x.innerText.toLowerCase()) ? '' : 'none';
|
||||||
|
})
|
||||||
|
}
|
||||||
|
function scrollToTop(){
|
||||||
|
const c = document.querySelector('main').scrollTop;
|
||||||
|
if (c > 0) {
|
||||||
|
window.requestAnimationFrame(scrollToTop);
|
||||||
|
document.querySelector('main').scrollTo(0, c - c / 4);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
function loader() {
|
||||||
|
registerClickListener();
|
||||||
|
}
|
||||||
|
function registerClickListener() {
|
||||||
|
document.addEventListener('click', function (event) {
|
||||||
|
if ( event.target.classList.contains('collapse') ) {
|
||||||
|
event.target.classList = event.target.classList.contains('toggled') ? 'collapse' : 'collapse toggled';
|
||||||
|
}
|
||||||
|
else if (event.target.classList.contains('clipboard-copy')) {
|
||||||
|
const text = event.target.parentElement.parentElement.querySelector(':not(pre) + pre').textContent;
|
||||||
|
const textArea = document.createElement("textarea");
|
||||||
|
textArea.value = text.trim();
|
||||||
|
document.body.appendChild(textArea);
|
||||||
|
textArea.select();
|
||||||
|
document.execCommand("Copy");
|
||||||
|
document.body.removeChild(textArea);
|
||||||
|
let tst = document.createElement('div');
|
||||||
|
tst.classList = 'toast';
|
||||||
|
tst.innerHTML = 'Snippet copied to clipboard!';
|
||||||
|
document.body.appendChild(tst);
|
||||||
|
setTimeout(function() {
|
||||||
|
tst.style.opacity = 0;
|
||||||
|
setTimeout(function() {
|
||||||
|
document.body.removeChild(tst);
|
||||||
|
},300);
|
||||||
|
},1700);
|
||||||
|
}
|
||||||
|
else if (event.target.classList.contains('scroll-to-top')){
|
||||||
|
scrollToTop();
|
||||||
|
}
|
||||||
|
}, false);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
[...document.getElementsByClassName("language-python")].forEach(el => Prism.highlightElement(el))
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
|
||||||
379
website/app/templates/index.html
Normal file
379
website/app/templates/index.html
Normal file
@ -0,0 +1,379 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block content %}<div class="row" style="height:calc(100vh - 5.875rem);overflow:hidden"><input id="doc-drawer-checkbox" class="drawer" value="on" type="checkbox"><nav class="col-md-4 col-lg-3" style="border-top:0"><div class="group"><input class="search" id="searchInput" onkeyup="search(this)" type="text"><label id="search-label">Search for snippet...</label></div><label for="doc-drawer-checkbox" class="button drawer-close"></label><h3 style = "">Math</h3><a class="sublink-1" tags="math" href="#average" style="">average</a><a class="sublink-1" tags="math" href="#factorial" style="">factorial</a><a class="sublink-1" tags="math" href="#gcd" style="">gcd</a><a class="sublink-1" tags="math" href="#lcm" style="">lcm</a><a class="sublink-1" tags="math" href="#max_n" style="">max_n</a><a class="sublink-1" tags="math" href="#min_n" style="">min_n</a><h3 style = "">List</h3><a class="sublink-1" tags="list" href="#chunk" style="">chunk</a><a class="sublink-1" tags="list" href="#compact" style="">compact</a><a class="sublink-1" tags="list" href="#count_occurences" style="">count_occurences</a><a class="sublink-1" tags="list" href="#deep_flatten" style="">deep_flatten</a><a class="sublink-1" tags="list" href="#difference" style="">difference</a><a class="sublink-1" tags="list" href="#shuffle" style="">shuffle</a><a class="sublink-1" tags="list" href="#spread" style="">spread</a><a class="sublink-1" tags="list" href="#zip" style="">zip</a><a class="sublink-1" tags="list" href="#count_by" style="">count_by</a><a class="sublink-1" tags="list" href="#difference_by" style="">difference_by</a><h3 style = "">String</h3><a class="sublink-1" tags="string" href="#count_vowels" style="">count_vowels</a><a class="sublink-1" tags="string" href="#byte_size" style="">byte_size</a><a class="sublink-1" tags="string" href="#capitalize" style="">capitalize</a><a class="sublink-1" tags="string" href="#capitalize_every_word" style="">capitalize_every_word</a><a class="sublink-1" tags="string" href="#decapitalize" style="">decapitalize</a><a class="sublink-1" tags="string" href="#palindrome" style="">palindrome</a><a class="sublink-1" tags="string" href="#is_upper_case" style="">is_upper_case</a><a class="sublink-1" tags="string" href="#is_lower_case" style="">is_lower_case</a></nav><main class="col-sm-12 col-md-8 col-lg-9" style="height:100%;overflow-y:auto;background:#eceef2;padding:0"><h2 style="text-align:center">Math</h2><div class="card fluid"><h3 id="average" class="section double-padded">average</h3><!--<form action="" method="post"><button type="submit" value="average" name="submit">Vote</button></form><p></p>--><div class="section double-padded">
|
||||||
|
<p><emoji>ℹ</emoji> Already implemented via <code>statistics.mean</code>. <code>statistics.mean</code> takes an array as an argument whereas this function takes variadic arguments.</p>
|
||||||
|
<p>Returns the average of two or more numbers.</p>
|
||||||
|
<p>Takes the sum of all the <code>args</code> and divides it by <code>len(args)</code>. The secind argument <code>0.0</code> in sum is to handle floating point division in <code>python2</code>.</p>
|
||||||
|
|
||||||
|
<pre class="language-python">def average(*args):
|
||||||
|
return sum(args, 0.0) / len(args)</pre>
|
||||||
|
<label class="collapse">Show examples</label>
|
||||||
|
<pre class="language-python">average(*[1, 2, 3]) # 2.0
|
||||||
|
average(1, 2, 3) # 2.0</pre>
|
||||||
|
<button class="primary clipboard-copy">📋 Copy to clipboard</button></div>
|
||||||
|
|
||||||
|
</div><div class="card fluid"><h3 id="factorial" class="section double-padded">factorial</h3><!--<form action="" method="post"><button type="submit" value="factorial" name="submit">Vote</button></form><p></p>--><div class="section double-padded">
|
||||||
|
<p>Calculates the factorial of a number.</p>
|
||||||
|
<p>Use recursion. If <code>num</code> is less than or equal to <code>1</code>, return <code>1</code>. Otherwise, return the product of <code>num</code> and the factorial of <code>num - 1</code>. Throws an exception if <code>num</code> is a negative or a floating point number.</p>
|
||||||
|
|
||||||
|
<pre class="language-python">def factorial(num):
|
||||||
|
if not ((num >= 0) & (num % 1 == 0)):
|
||||||
|
raise Exception(
|
||||||
|
f"Number( {num} ) can't be floating point or negative ")
|
||||||
|
return 1 if num == 0 else num * factorial(num - 1)</pre>
|
||||||
|
<label class="collapse">Show examples</label>
|
||||||
|
<pre class="language-python">factorial(6) # 720</pre>
|
||||||
|
<button class="primary clipboard-copy">📋 Copy to clipboard</button></div>
|
||||||
|
|
||||||
|
</div><div class="card fluid"><h3 id="gcd" class="section double-padded">gcd</h3><!--<form action="" method="post"><button type="submit" value="gcd" name="submit">Vote</button></form><p></p>--><div class="section double-padded">
|
||||||
|
<p><emoji>ℹ</emoji> <code>math.gcd</code> works with only two numbers</p>
|
||||||
|
<p>Calculates the greatest common divisor between two or more numbers/lists.</p>
|
||||||
|
<p>The <code>helperGcdfunction</code> uses recursion. Base case is when <code>y</code> equals <code>0</code>. In this case, return <code>x</code>. Otherwise, return the GCD of <code>y</code> and the remainder of the division <code>x/y</code>.</p>
|
||||||
|
<p>Uses the reduce function from the inbuilt module <code>functools</code>. Also defines a method <code>spread</code> for javascript like spreading of lists.</p>
|
||||||
|
|
||||||
|
<pre class="language-python">from functools import reduce
|
||||||
|
|
||||||
|
|
||||||
|
def spread(arg):
|
||||||
|
ret = []
|
||||||
|
for i in arg:
|
||||||
|
if isinstance(i, list):
|
||||||
|
ret.extend(i)
|
||||||
|
else:
|
||||||
|
ret.append(i)
|
||||||
|
return ret
|
||||||
|
|
||||||
|
|
||||||
|
def gcd(*args):
|
||||||
|
numbers = []
|
||||||
|
numbers.extend(spread(list(args)))
|
||||||
|
|
||||||
|
def _gcd(x, y):
|
||||||
|
return x if not y else gcd(y, x % y)
|
||||||
|
|
||||||
|
return reduce((lambda x, y: _gcd(x, y)), numbers)</pre>
|
||||||
|
<label class="collapse">Show examples</label>
|
||||||
|
<pre class="language-python">gcd(8,36) # 4</pre>
|
||||||
|
<button class="primary clipboard-copy">📋 Copy to clipboard</button></div>
|
||||||
|
|
||||||
|
</div><div class="card fluid"><h3 id="lcm" class="section double-padded">lcm</h3><!--<form action="" method="post"><button type="submit" value="lcm" name="submit">Vote</button></form><p></p>--><div class="section double-padded">
|
||||||
|
<p>Returns the least common multiple of two or more numbers.</p>
|
||||||
|
<p>Use the <code>greatest common divisor (GCD)</code> formula and the fact that <code>lcm(x,y) = x * y / gcd(x,y)</code> to determine the least common multiple. The GCD formula uses recursion.</p>
|
||||||
|
<p>Uses <code>reduce</code> function from the inbuilt module <code>functools</code>. Also defines a method <code>spread</code> for javascript like spreading of lists.</p>
|
||||||
|
|
||||||
|
<pre class="language-python">from functools import reduce
|
||||||
|
|
||||||
|
|
||||||
|
def spread(arg):
|
||||||
|
ret = []
|
||||||
|
for i in arg:
|
||||||
|
if isinstance(i, list):
|
||||||
|
ret.extend(i)
|
||||||
|
else:
|
||||||
|
ret.append(i)
|
||||||
|
return ret
|
||||||
|
|
||||||
|
|
||||||
|
def lcm(*args):
|
||||||
|
numbers = []
|
||||||
|
numbers.extend(spread(list(args)))
|
||||||
|
|
||||||
|
def _gcd(x, y):
|
||||||
|
return x if not y else gcd(y, x % y)
|
||||||
|
|
||||||
|
def _lcm(x, y):
|
||||||
|
return x * y / _gcd(x, y)
|
||||||
|
|
||||||
|
return reduce((lambda x, y: _lcm(x, y)), numbers)</pre>
|
||||||
|
<label class="collapse">Show examples</label>
|
||||||
|
<pre class="language-python">lcm(12, 7) # 84
|
||||||
|
lcm([1, 3, 4], 5) # 60</pre>
|
||||||
|
<button class="primary clipboard-copy">📋 Copy to clipboard</button></div>
|
||||||
|
|
||||||
|
</div><div class="card fluid"><h3 id="max_n" class="section double-padded">max_n</h3><!--<form action="" method="post"><button type="submit" value="max_n" name="submit">Vote</button></form><p></p>--><div class="section double-padded">
|
||||||
|
<p>Returns the <code>n</code> maximum elements from the provided list. If <code>n</code> is greater than or equal to the provided list's length, then return the original list(sorted in descending order).</p>
|
||||||
|
<p>Use <code>list.sort()</code> combined with the <code>deepcopy</code> function from the inbuilt <code>copy</code> module to create a shallow clone of the list and sort it in ascending order and then use <code>list.reverse()</code> reverse it to make it descending order. Use <code>[:n]</code> to get the specified number of elements. Omit the second argument, <code>n</code>, to get a one-element array</p>
|
||||||
|
|
||||||
|
<pre class="language-python">from copy import deepcopy
|
||||||
|
|
||||||
|
|
||||||
|
def max_n(arr, n=1):
|
||||||
|
numbers = deepcopy(arr)
|
||||||
|
numbers.sort()
|
||||||
|
numbers.reverse()
|
||||||
|
return numbers[:n]</pre>
|
||||||
|
<label class="collapse">Show examples</label>
|
||||||
|
<pre class="language-python">max_n([1, 2, 3]) # [3]
|
||||||
|
max_n([1, 2, 3], 2) # [3,2]</pre>
|
||||||
|
<button class="primary clipboard-copy">📋 Copy to clipboard</button></div>
|
||||||
|
|
||||||
|
</div><div class="card fluid"><h3 id="min_n" class="section double-padded">min_n</h3><!--<form action="" method="post"><button type="submit" value="min_n" name="submit">Vote</button></form><p></p>--><div class="section double-padded">
|
||||||
|
<p>Returns the <code>n</code> minimum elements from the provided list. If <code>n</code> is greater than or equal to the provided list's length, then return the original list(sorted in ascending order).</p>
|
||||||
|
<p>Use <code>list.sort()</code> combined with the <code>deepcopy</code> function from the inbuilt <code>copy</code> module to create a shallow clone of the list and sort it in ascending order. Use <code>[:n]</code> to get the specified number of elements. Omit the second argument, <code>n</code>, to get a one-element array</p>
|
||||||
|
|
||||||
|
<pre class="language-python">from copy import deepcopy
|
||||||
|
|
||||||
|
|
||||||
|
def min_n(arr, n=1):
|
||||||
|
numbers = deepcopy(arr)
|
||||||
|
numbers.sort()
|
||||||
|
return numbers[:n]</pre>
|
||||||
|
<label class="collapse">Show examples</label>
|
||||||
|
<pre class="language-python">min_n([1, 2, 3]) # [1]
|
||||||
|
min_n([1, 2, 3], 2) # [1,2]</pre>
|
||||||
|
<button class="primary clipboard-copy">📋 Copy to clipboard</button></div>
|
||||||
|
|
||||||
|
</div><h2 style="text-align:center">List</h2><div class="card fluid"><h3 id="chunk" class="section double-padded">chunk</h3><!--<form action="" method="post"><button type="submit" value="chunk" name="submit">Vote</button></form><p></p>--><div class="section double-padded">
|
||||||
|
<p>Chunks an array into smaller lists of a specified size.</p>
|
||||||
|
<p>Uses <code>range</code> to create a list of desired size. Then use <code>map</code> on this list and fill it with splices of <code>arr</code>.</p>
|
||||||
|
|
||||||
|
<pre class="language-python">from math import ceil
|
||||||
|
|
||||||
|
|
||||||
|
def chunk(arr, size):
|
||||||
|
return list(
|
||||||
|
map(lambda x: arr[x * size:x * size + size],
|
||||||
|
list(range(0, ceil(len(arr) / size)))))</pre>
|
||||||
|
<label class="collapse">Show examples</label>
|
||||||
|
<pre class="language-python">chunk([1,2,3,4,5],2) # [[1,2],[3,4],5]</pre>
|
||||||
|
<button class="primary clipboard-copy">📋 Copy to clipboard</button></div>
|
||||||
|
|
||||||
|
</div><div class="card fluid"><h3 id="compact" class="section double-padded">compact</h3><!--<form action="" method="post"><button type="submit" value="compact" name="submit">Vote</button></form><p></p>--><div class="section double-padded">
|
||||||
|
<p>Removes falsey values from a list.</p>
|
||||||
|
<p>Use <code>filter()</code> to filter out falsey values (False, None, 0, and "").</p>
|
||||||
|
|
||||||
|
<pre class="language-python">def compact(arr):
|
||||||
|
return list(filter(lambda x: bool(x), arr))</pre>
|
||||||
|
<label class="collapse">Show examples</label>
|
||||||
|
<pre class="language-python">compact([0, 1, False, 2, '', 3, 'a', 's', 34]) # [ 1, 2, 3, 'a', 's', 34 ]</pre>
|
||||||
|
<button class="primary clipboard-copy">📋 Copy to clipboard</button></div>
|
||||||
|
|
||||||
|
</div><div class="card fluid"><h3 id="count_occurences" class="section double-padded">count_occurences</h3><!--<form action="" method="post"><button type="submit" value="count_occurences" name="submit">Vote</button></form><p></p>--><div class="section double-padded">
|
||||||
|
<p><emoji>ℹ</emoji> Already implemented via <code>list.count()</code>.</p>
|
||||||
|
<p>Counts the occurrences of a value in an list.</p>
|
||||||
|
<p>Uses the <code>reduce</code> functin from built-in module <code>functools</code> to increment a counter each time you encounter the specific value inside the list.</p>
|
||||||
|
|
||||||
|
<pre class="language-python">def count_occurences(arr, val):
|
||||||
|
return reduce(
|
||||||
|
(lambda x, y: x + 1 if y == val and type(y) == type(val) else x + 0),
|
||||||
|
arr)</pre>
|
||||||
|
<label class="collapse">Show examples</label>
|
||||||
|
<pre class="language-python">count_occurrences([1, 1, 2, 1, 2, 3], 1) # 3</pre>
|
||||||
|
<button class="primary clipboard-copy">📋 Copy to clipboard</button></div>
|
||||||
|
|
||||||
|
</div><div class="card fluid"><h3 id="deep_flatten" class="section double-padded">deep_flatten</h3><!--<form action="" method="post"><button type="submit" value="deep_flatten" name="submit">Vote</button></form><p></p>--><div class="section double-padded">
|
||||||
|
<p>Deep flattens a list.</p>
|
||||||
|
<p>Use recursion. Use <code>list.extend()</code> with an empty array (<code>result</code>) and the spread function to flatten a list. Recursively flatten each element that is a list.</p>
|
||||||
|
|
||||||
|
<pre class="language-python">def spread(arg):
|
||||||
|
ret = []
|
||||||
|
for i in arg:
|
||||||
|
if isinstance(i, list):
|
||||||
|
ret.extend(i)
|
||||||
|
else:
|
||||||
|
ret.append(i)
|
||||||
|
return ret
|
||||||
|
|
||||||
|
|
||||||
|
def deep_flatten(arr):
|
||||||
|
result = []
|
||||||
|
result.extend(
|
||||||
|
spread(list(map(lambda x: deep(x) if type(x) == list else x, arr))))
|
||||||
|
return result</pre>
|
||||||
|
<label class="collapse">Show examples</label>
|
||||||
|
<pre class="language-python">deep_flatten([1, [2], [[3], 4], 5]) # [1,2,3,4,5]</pre>
|
||||||
|
<button class="primary clipboard-copy">📋 Copy to clipboard</button></div>
|
||||||
|
|
||||||
|
</div><div class="card fluid"><h3 id="difference" class="section double-padded">difference</h3><!--<form action="" method="post"><button type="submit" value="difference" name="submit">Vote</button></form><p></p>--><div class="section double-padded">
|
||||||
|
<p>Returns the difference between two arrays.</p>
|
||||||
|
<p>Create a <code>set</code> from <code>b</code>, then use list comprehension to only keep values not contained in <code>b</code></p>
|
||||||
|
|
||||||
|
<pre class="language-python">def difference(a, b):
|
||||||
|
b = set(b)
|
||||||
|
return [item for item in a if item not in b]</pre>
|
||||||
|
<label class="collapse">Show examples</label>
|
||||||
|
<pre class="language-python">difference([1, 2, 3], [1, 2, 4]) # [3]</pre>
|
||||||
|
<button class="primary clipboard-copy">📋 Copy to clipboard</button></div>
|
||||||
|
|
||||||
|
</div><div class="card fluid"><h3 id="shuffle" class="section double-padded">shuffle</h3><!--<form action="" method="post"><button type="submit" value="shuffle" name="submit">Vote</button></form><p></p>--><div class="section double-padded">
|
||||||
|
<p><emoji>ℹ</emoji> The same algorithm is already implemented via <code>random.shuffle</code>.</p>
|
||||||
|
<p>Randomizes the order of the values of an list, returning a new list.</p>
|
||||||
|
<p>Uses the <a href="https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle">Fisher-Yates algorithm</a> to reorder the elements of the list.</p>
|
||||||
|
|
||||||
|
<pre class="language-python">from copy import deepcopy
|
||||||
|
from random import randint
|
||||||
|
|
||||||
|
|
||||||
|
def shuffle(arr):
|
||||||
|
temp_arr = deepcopy(arr)
|
||||||
|
m = len(temp_arr)
|
||||||
|
while (m):
|
||||||
|
m -= 1
|
||||||
|
i = randint(0, m)
|
||||||
|
temp_arr[m], temp_arr[i] = temp_arr[i], temp_arr[m]
|
||||||
|
return temp_arr</pre>
|
||||||
|
<label class="collapse">Show examples</label>
|
||||||
|
<pre class="language-python">foo = [1,2,3]
|
||||||
|
shuffle(foo) # [2,3,1] , foo = [1,2,3]</pre>
|
||||||
|
<button class="primary clipboard-copy">📋 Copy to clipboard</button></div>
|
||||||
|
|
||||||
|
</div><div class="card fluid"><h3 id="spread" class="section double-padded">spread</h3><!--<form action="" method="post"><button type="submit" value="spread" name="submit">Vote</button></form><p></p>--><div class="section double-padded">
|
||||||
|
<p>Implements javascript's <code>[].concat(...arr)</code>. Flattens the list(non-deep) and returns an list.</p>
|
||||||
|
|
||||||
|
<pre class="language-python">def spread(arg):
|
||||||
|
ret = []
|
||||||
|
for i in arg:
|
||||||
|
if isinstance(i, list):
|
||||||
|
ret.extend(i)
|
||||||
|
else:
|
||||||
|
ret.append(i)
|
||||||
|
return ret</pre>
|
||||||
|
<label class="collapse">Show examples</label>
|
||||||
|
<pre class="language-python">spread([1,2,3,[4,5,6],[7],8,9]) # [1,2,3,4,5,6,7,8,9]</pre>
|
||||||
|
<button class="primary clipboard-copy">📋 Copy to clipboard</button></div>
|
||||||
|
|
||||||
|
</div><div class="card fluid"><h3 id="zip" class="section double-padded">zip</h3><!--<form action="" method="post"><button type="submit" value="zip" name="submit">Vote</button></form><p></p>--><div class="section double-padded">
|
||||||
|
<p><emoji>ℹ</emoji> Already implemented via <code>itertools.zip_longest()</code></p>
|
||||||
|
<p>Creates a list of elements, grouped based on the position in the original lists.</p>
|
||||||
|
<p>Use <code>max</code> combined with <code>list comprehension</code> to get the length of the longest list in the arguments. Loops for <code>max_length</code> times grouping elements. If lengths of <code>lists</code> vary <code>fill_value</code> is used. By default <code>fill_value</code> is <code>None</code>.</p>
|
||||||
|
|
||||||
|
<pre class="language-python">def zip(*args, fillvalue=None):
|
||||||
|
max_length = max([len(arr) for arr in args])
|
||||||
|
result = []
|
||||||
|
for i in range(max_length):
|
||||||
|
result.append([
|
||||||
|
args[k][i] if i < len(args[k]) else None for k in range(len(args))
|
||||||
|
])
|
||||||
|
return result</pre>
|
||||||
|
<label class="collapse">Show examples</label>
|
||||||
|
<pre class="language-python">zip(['a', 'b'], [1, 2], [True, False]) # [['a', 1, True], ['b', 2, False]]
|
||||||
|
zip(['a'], [1, 2], [True, False]) # [['a', 1, True], [None, 2, False]]
|
||||||
|
zip(['a'], [1, 2], [True, False], fill_value = '_') # [['a', 1, True], ['_', 2, False]]</pre>
|
||||||
|
<button class="primary clipboard-copy">📋 Copy to clipboard</button></div>
|
||||||
|
|
||||||
|
</div><div class="card fluid"><h3 id="count_by" class="section double-padded">count_by</h3><!--<form action="" method="post"><button type="submit" value="count_by" name="submit">Vote</button></form><p></p>--><div class="section double-padded">
|
||||||
|
<p><emoji>ℹ</emoji> Already implemented via <code>collections.Counter</code></p>
|
||||||
|
<p>Groups the elements of a list based on the given function and returns the count of elements in each group.</p>
|
||||||
|
<p>Use <code>map()</code> to map the values of the list using the given function. Iterate over the map and increase the the elements count each time it occurs.</p>
|
||||||
|
|
||||||
|
<pre class="language-python">def count_by(arr, fn=lambda x: x):
|
||||||
|
key = {}
|
||||||
|
for el in map(fn, arr):
|
||||||
|
key[el] = 0 if not el in key else key[el]
|
||||||
|
key[el] += 1
|
||||||
|
return key</pre>
|
||||||
|
<label class="collapse">Show examples</label>
|
||||||
|
<pre class="language-python">from math import floor
|
||||||
|
count_by([6.1, 4.2, 6.3], floor) # {4: 1, 6: 2}
|
||||||
|
count_by(['one', 'two', 'three'], len) # {3: 2, 5: 1}</pre>
|
||||||
|
<button class="primary clipboard-copy">📋 Copy to clipboard</button></div>
|
||||||
|
|
||||||
|
</div><div class="card fluid"><h3 id="difference_by" class="section double-padded">difference_by</h3><!--<form action="" method="post"><button type="submit" value="difference_by" name="submit">Vote</button></form><p></p>--><div class="section double-padded">
|
||||||
|
<p>Returns the difference between two list, after applying the provided function to each list element of both.</p>
|
||||||
|
<p>Create a <code>set</code> by applying <code>fn</code> to each element in <code>b</code>, then use list comprehension in combination with fn on a to only keep values not contained in the previously created <code>set</code>.</p>
|
||||||
|
|
||||||
|
<pre class="language-python">def difference_by(a, b, fn):
|
||||||
|
b = set(map(fn, b))
|
||||||
|
return [item for item in a if fn(item) not in b]</pre>
|
||||||
|
<label class="collapse">Show examples</label>
|
||||||
|
<pre class="language-python">from math import floor
|
||||||
|
difference_by([2.1, 1.2], [2.3, 3.4],floor) # [1.2]
|
||||||
|
difference_by([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], lambda v : v['x']) # [ { x: 2 } ]</pre>
|
||||||
|
<button class="primary clipboard-copy">📋 Copy to clipboard</button></div>
|
||||||
|
|
||||||
|
</div><h2 style="text-align:center">String</h2><div class="card fluid"><h3 id="count_vowels" class="section double-padded">count_vowels</h3><!--<form action="" method="post"><button type="submit" value="count_vowels" name="submit">Vote</button></form><p></p>--><div class="section double-padded">
|
||||||
|
<p>Retuns <code>number</code> of vowels in provided <code>string</code>.</p>
|
||||||
|
<p>Use a regular expression to count the number of vowels <code>(A, E, I, O, U)</code> in a string.</p>
|
||||||
|
|
||||||
|
<pre class="language-python">import re
|
||||||
|
|
||||||
|
|
||||||
|
def count_vowels(str):
|
||||||
|
return len(len(re.findall(r'[aeiou]', str, re.IGNORECASE)))</pre>
|
||||||
|
<label class="collapse">Show examples</label>
|
||||||
|
<pre class="language-python">count_vowels('foobar') # 3
|
||||||
|
count_vowels('gym') # 0</pre>
|
||||||
|
<button class="primary clipboard-copy">📋 Copy to clipboard</button></div>
|
||||||
|
|
||||||
|
</div><div class="card fluid"><h3 id="byte_size" class="section double-padded">byte_size</h3><!--<form action="" method="post"><button type="submit" value="byte_size" name="submit">Vote</button></form><p></p>--><div class="section double-padded">
|
||||||
|
<p>Returns the length of a string in bytes.</p>
|
||||||
|
<p><code>utf-8</code> encodes a given string and find its length.</p>
|
||||||
|
|
||||||
|
<pre class="language-python">def byte_size(string):
|
||||||
|
return(len(string.encode('utf-8')))</pre>
|
||||||
|
<label class="collapse">Show examples</label>
|
||||||
|
<pre class="language-python">byte_size('😀') # 4
|
||||||
|
byte_size('Hello World') # 11</pre>
|
||||||
|
<button class="primary clipboard-copy">📋 Copy to clipboard</button></div>
|
||||||
|
|
||||||
|
</div><div class="card fluid"><h3 id="capitalize" class="section double-padded">capitalize</h3><!--<form action="" method="post"><button type="submit" value="capitalize" name="submit">Vote</button></form><p></p>--><div class="section double-padded">
|
||||||
|
<p>Capitalizes the first letter of a string.</p>
|
||||||
|
<p>Capitalizes the fist letter of the sring and then adds it with rest of the string. Omit the <code>lower_rest</code> parameter to keep the rest of the string intact, or set it to <code>true</code> to convert to lowercase.</p>
|
||||||
|
|
||||||
|
<pre class="language-python">def capitalize(string, lower_rest=False):
|
||||||
|
return string[:1].upper() + (string[1:].lower() if lower_rest else string[1:])</pre>
|
||||||
|
<label class="collapse">Show examples</label>
|
||||||
|
<pre class="language-python">capitalize('fooBar') # 'FooBar'
|
||||||
|
capitalize('fooBar', True) # 'Foobar'</pre>
|
||||||
|
<button class="primary clipboard-copy">📋 Copy to clipboard</button></div>
|
||||||
|
|
||||||
|
</div><div class="card fluid"><h3 id="capitalize_every_word" class="section double-padded">capitalize_every_word</h3><!--<form action="" method="post"><button type="submit" value="capitalize_every_word" name="submit">Vote</button></form><p></p>--><div class="section double-padded">
|
||||||
|
<p>Capitalizes the first letter of every word in a string.</p>
|
||||||
|
<p>Uses <code>str.title</code> to capitalize first letter of evry word in the string.</p>
|
||||||
|
|
||||||
|
<pre class="language-python">def capitalize_every_word(string):
|
||||||
|
return string.title()</pre>
|
||||||
|
<label class="collapse">Show examples</label>
|
||||||
|
<pre class="language-python">capitalize_every_word('hello world!') # 'Hello World!'</pre>
|
||||||
|
<button class="primary clipboard-copy">📋 Copy to clipboard</button></div>
|
||||||
|
|
||||||
|
</div><div class="card fluid"><h3 id="decapitalize" class="section double-padded">decapitalize</h3><!--<form action="" method="post"><button type="submit" value="decapitalize" name="submit">Vote</button></form><p></p>--><div class="section double-padded">
|
||||||
|
<p>Decapitalizes the first letter of a string.</p>
|
||||||
|
<p>Decapitalizes the fist letter of the sring and then adds it with rest of the string. Omit the <code>upper_rest</code> parameter to keep the rest of the string intact, or set it to <code>true</code> to convert to uppercase.</p>
|
||||||
|
|
||||||
|
<pre class="language-python">def decapitalize(string, upper_rest=False):
|
||||||
|
return str[:1].lower() + (str[1:].upper() if upper_rest else str[1:])</pre>
|
||||||
|
<label class="collapse">Show examples</label>
|
||||||
|
<pre class="language-python">decapitalize('FooBar') # 'fooBar'
|
||||||
|
decapitalize('FooBar', True) # 'fOOBAR'</pre>
|
||||||
|
<button class="primary clipboard-copy">📋 Copy to clipboard</button></div>
|
||||||
|
|
||||||
|
</div><div class="card fluid"><h3 id="palindrome" class="section double-padded">palindrome</h3><!--<form action="" method="post"><button type="submit" value="palindrome" name="submit">Vote</button></form><p></p>--><div class="section double-padded">
|
||||||
|
<p>Returns <code>True</code> if the given string is a palindrome, <code>False</code> otherwise.</p>
|
||||||
|
<p>Convert string <code>str.lower()</code> and use <code>re.sub</code> to remove non-alphanumeric characters from it. Then compare the new string to the reversed.</p>
|
||||||
|
|
||||||
|
<pre class="language-python">def palindrome(string):
|
||||||
|
from re import sub
|
||||||
|
s = sub('[\W_]', '', string.lower())
|
||||||
|
return s == s[::-1]</pre>
|
||||||
|
<label class="collapse">Show examples</label>
|
||||||
|
<pre class="language-python">palindrome('taco cat') # True</pre>
|
||||||
|
<button class="primary clipboard-copy">📋 Copy to clipboard</button></div>
|
||||||
|
|
||||||
|
</div><div class="card fluid"><h3 id="is_upper_case" class="section double-padded">is_upper_case</h3><!--<form action="" method="post"><button type="submit" value="is_upper_case" name="submit">Vote</button></form><p></p>--><div class="section double-padded">
|
||||||
|
<p>Checks if a string is upper case.</p>
|
||||||
|
<p>Convert the given string to upper case, using <code>str.upper()</code> method and compare it to the original.</p>
|
||||||
|
|
||||||
|
<pre class="language-python">def is_upper_case(str):
|
||||||
|
return str == str.upper()</pre>
|
||||||
|
<label class="collapse">Show examples</label>
|
||||||
|
<pre class="language-python">is_upper_case('ABC') # True
|
||||||
|
is_upper_case('a3@$') # True
|
||||||
|
is_upper_case('aB4') # False</pre>
|
||||||
|
<button class="primary clipboard-copy">📋 Copy to clipboard</button></div>
|
||||||
|
|
||||||
|
</div><div class="card fluid"><h3 id="is_lower_case" class="section double-padded">is_lower_case</h3><!--<form action="" method="post"><button type="submit" value="is_lower_case" name="submit">Vote</button></form><p></p>--><div class="section double-padded">
|
||||||
|
<p>Checks if a string is lower case.</p>
|
||||||
|
<p>Convert the given string to lower case, using <code>str.lower()</code> method and compare it to the original.</p>
|
||||||
|
|
||||||
|
<pre class="language-python">def is_lower_case(str):
|
||||||
|
return str == str.lower()</pre>
|
||||||
|
<label class="collapse">Show examples</label>
|
||||||
|
<pre class="language-python">is_lower_case('abc') # True
|
||||||
|
is_lower_case('a3@$') # True
|
||||||
|
is_lower_case('Ab4') # False</pre>
|
||||||
|
<button class="primary clipboard-copy">📋 Copy to clipboard</button></div>
|
||||||
|
|
||||||
|
</div><button class="scroll-to-top">↑</button>
|
||||||
|
<footer><p style="display:inline-block"><strong>30 seconds of python code</strong> is licensed under the <a href="https://github.com/kriadmin/30-seconds-of-python-code/blob/master/LICENSE">GPL-3.0</a> license.<br>Icons made by <a href="https://www.flaticon.com/authors/smashicons">Smashicons</a> from <a href="https://www.flaticon.com/">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/">CC 3.0 BY</a>.<br>Ribbon made by <a href="https://github.com/tholman/github-corners">Tim Holman</a> is licensed by <a href="https://opensource.org/licenses/MIT">The MIT License</a><br>Built with the <a href="https://minicss.org">mini.css framework</a>.</p></footer>
|
||||||
|
</main></div>{% endblock %}
|
||||||
124
website/app/templates/prism.css
Normal file
124
website/app/templates/prism.css
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
/* PrismJS 1.10.0
|
||||||
|
http://prismjs.com/download.html?themes=prism-okaidia&languages=python */
|
||||||
|
/**
|
||||||
|
* okaidia theme for JavaScript, CSS and HTML
|
||||||
|
* Loosely based on Monokai textmate theme by http://www.monokai.nl/
|
||||||
|
* @author ocodia
|
||||||
|
*/
|
||||||
|
|
||||||
|
code[class*="language-"],
|
||||||
|
pre[class*="language-"] {
|
||||||
|
color: #f8f8f2;
|
||||||
|
background: none;
|
||||||
|
text-shadow: 0 1px rgba(0, 0, 0, 0.3);
|
||||||
|
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
||||||
|
text-align: left;
|
||||||
|
white-space: pre;
|
||||||
|
word-spacing: normal;
|
||||||
|
word-break: normal;
|
||||||
|
word-wrap: normal;
|
||||||
|
line-height: 1.5;
|
||||||
|
|
||||||
|
-moz-tab-size: 4;
|
||||||
|
-o-tab-size: 4;
|
||||||
|
tab-size: 4;
|
||||||
|
|
||||||
|
-webkit-hyphens: none;
|
||||||
|
-moz-hyphens: none;
|
||||||
|
-ms-hyphens: none;
|
||||||
|
hyphens: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Code blocks */
|
||||||
|
pre[class*="language-"] {
|
||||||
|
padding: 1em;
|
||||||
|
margin: .5em 0;
|
||||||
|
overflow: auto;
|
||||||
|
border-radius: 0.3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
:not(pre) > code[class*="language-"],
|
||||||
|
pre[class*="language-"] {
|
||||||
|
background: #272822;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Inline code */
|
||||||
|
:not(pre) > code[class*="language-"] {
|
||||||
|
padding: .1em;
|
||||||
|
border-radius: .3em;
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.comment,
|
||||||
|
.token.prolog,
|
||||||
|
.token.doctype,
|
||||||
|
.token.cdata {
|
||||||
|
color: slategray;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.punctuation {
|
||||||
|
color: #f8f8f2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.namespace {
|
||||||
|
opacity: .7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.property,
|
||||||
|
.token.tag,
|
||||||
|
.token.constant,
|
||||||
|
.token.symbol,
|
||||||
|
.token.deleted {
|
||||||
|
color: #f92672;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.boolean,
|
||||||
|
.token.number {
|
||||||
|
color: #ae81ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.selector,
|
||||||
|
.token.attr-name,
|
||||||
|
.token.string,
|
||||||
|
.token.char,
|
||||||
|
.token.builtin,
|
||||||
|
.token.inserted {
|
||||||
|
color: #a6e22e;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.operator,
|
||||||
|
.token.entity,
|
||||||
|
.token.url,
|
||||||
|
.language-css .token.string,
|
||||||
|
.style .token.string,
|
||||||
|
.token.variable {
|
||||||
|
color: #f8f8f2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.atrule,
|
||||||
|
.token.attr-value,
|
||||||
|
.token.function {
|
||||||
|
color: #e6db74;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.keyword {
|
||||||
|
color: #66d9ef;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.regex,
|
||||||
|
.token.important {
|
||||||
|
color: #fd971f;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.important,
|
||||||
|
.token.bold {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.token.italic {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.entity {
|
||||||
|
cursor: help;
|
||||||
|
}
|
||||||
|
|
||||||
2
website/app/templates/prism.js
Normal file
2
website/app/templates/prism.js
Normal file
File diff suppressed because one or more lines are too long
16
website/app/vote.py
Normal file
16
website/app/vote.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import json
|
||||||
|
|
||||||
|
|
||||||
|
def vote(snippet):
|
||||||
|
snippets = open('website/app/snippets').read().split('\n')
|
||||||
|
with open('website/app/votes.json', 'r') as f:
|
||||||
|
if snippet in snippets:
|
||||||
|
data = json.load(f)
|
||||||
|
try:
|
||||||
|
data[snippet]
|
||||||
|
except KeyError:
|
||||||
|
data[snippet] = 0
|
||||||
|
data[snippet] += 1
|
||||||
|
open('website/app/votes.json','w').write(str(data).replace("'",'"'))
|
||||||
|
else:
|
||||||
|
raise Exception(f'{snippet} does not exists ')
|
||||||
16
website/app/vote_data.py
Normal file
16
website/app/vote_data.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import json
|
||||||
|
|
||||||
|
def vote_data():
|
||||||
|
f = open('website/app/snippets')
|
||||||
|
snippets = f.read().split('\n')
|
||||||
|
f.close()
|
||||||
|
|
||||||
|
f = open('website/app/votes.json')
|
||||||
|
votes_data = json.load(f)
|
||||||
|
votes = {}
|
||||||
|
for snippet in snippets:
|
||||||
|
try:
|
||||||
|
votes[snippet] = votes_data[snippet]
|
||||||
|
except KeyError:
|
||||||
|
votes[snippet] = 0
|
||||||
|
return votes
|
||||||
1
website/app/votes.json
Normal file
1
website/app/votes.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{}
|
||||||
2
website/etc/hosts
Normal file
2
website/etc/hosts
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
127.0.0.1 localwebsite
|
||||||
|
127.0.0.1 blog.localwebsite
|
||||||
10
website/index.html
Normal file
10
website/index.html
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link href="prism.css" rel = "stylesheet"></link>
|
||||||
|
</head>
|
||||||
|
<script src="prism.js"></script>
|
||||||
|
<pre><code class="language-python">def Hello_World(val):
|
||||||
|
print(f'Hello {val}')
|
||||||
|
wow!
|
||||||
|
</code></pre>
|
||||||
|
</html>
|
||||||
69
website/main.py
Normal file
69
website/main.py
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
import os
|
||||||
|
import re
|
||||||
|
|
||||||
|
import emoji
|
||||||
|
import mistune
|
||||||
|
|
||||||
|
codeRe = "```\s*python([\s\S]*?)```"
|
||||||
|
def tagger():
|
||||||
|
tag_data = open('tag_database').read()
|
||||||
|
tag_dict = {}
|
||||||
|
tag_list = tag_data.split('\n')
|
||||||
|
for tag in tag_list:
|
||||||
|
category = tag.split(':')[1]
|
||||||
|
snippet = tag.split(':')[0]
|
||||||
|
if category in tag_dict:
|
||||||
|
tag_dict[category].append(snippet)
|
||||||
|
else:
|
||||||
|
tag_dict[category] = [snippet]
|
||||||
|
return tag_dict
|
||||||
|
|
||||||
|
class MyRenderer(mistune.Renderer):
|
||||||
|
def block_code(self, code, lang):
|
||||||
|
if not lang:
|
||||||
|
return f'\n<pre>{mistune.escape(code.strip())}</pre>\n'
|
||||||
|
else:
|
||||||
|
return f'\n<pre class="language-{lang}">{mistune.escape(code.strip())}</pre>\n'
|
||||||
|
|
||||||
|
|
||||||
|
renderer = MyRenderer()
|
||||||
|
md = mistune.Markdown(renderer=renderer,escape=True)
|
||||||
|
def title_case(str):
|
||||||
|
return str[:1].upper() + str[1:].lower()
|
||||||
|
|
||||||
|
rendered = ''
|
||||||
|
|
||||||
|
tag_dict = tagger()
|
||||||
|
|
||||||
|
for category in tag_dict:
|
||||||
|
rendered += f'<h2 style="text-align:center">{title_case(category)}</h2>'
|
||||||
|
snippets = tag_dict[category]
|
||||||
|
for file in snippets:
|
||||||
|
content = open('snippets/'+file+'.md').read()
|
||||||
|
content = re.sub(':(\S+):',r'<emoji>:\1:</emoji>',content)
|
||||||
|
codeParts = re.split(codeRe,content)
|
||||||
|
codeParts[3] = f'\n\n<label class="collapse">Show examples</label>\n\n```python\n{codeParts[3].strip()}\n```\n'
|
||||||
|
content = codeParts[0] + '``` python' + codeParts[1] + '```' + codeParts[2] + codeParts[3]
|
||||||
|
content = f'<div class="card fluid">{emoji.emojize(md.render(content),use_aliases=True)}<button class="primary clipboard-copy">📋 Copy to clipboard</button></div>'+'\n\n'
|
||||||
|
rendered += re.sub('<h3>(\S+)</h3>',r'<h3>\1</h3><div class="section double-padded">',content) + '</div>'
|
||||||
|
rendered = re.sub('<h3>(\S+)</h3>',r'<h3 id="\1" class="section double-padded">\1</h3><!--<form action="" method="post"><button type="submit" value="\1" name="submit">Vote</button></form>'+'<p></p>-->',rendered)
|
||||||
|
nav_string = '<input id="doc-drawer-checkbox" class="drawer" value="on" type="checkbox"><nav class="col-md-4 col-lg-3" style="border-top:0"><div class="group"><input class="search" id="searchInput" onkeyup="search(this)" type="text"><label id="search-label">Search for snippet...</label></div><label for="doc-drawer-checkbox" class="button drawer-close"></label>'
|
||||||
|
for category in tag_dict:
|
||||||
|
nav_string += f'<h3 style = "">{title_case(category)}</h3>'
|
||||||
|
for file in tag_dict[category]:
|
||||||
|
nav_string += f'<a class="sublink-1" tags="{category}" href="#{file}" style="">{file}</a>'
|
||||||
|
nav_string += '</nav>'
|
||||||
|
start = '''{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block content %}'''
|
||||||
|
|
||||||
|
end = '{% endblock %}'
|
||||||
|
|
||||||
|
footer = '''
|
||||||
|
<footer><p style="display:inline-block"><strong>30 seconds of python code</strong> is licensed under the <a href="https://github.com/kriadmin/30-seconds-of-python-code/blob/master/LICENSE">GPL-3.0</a> license.<br>Icons made by <a href="https://www.flaticon.com/authors/smashicons">Smashicons</a> from <a href="https://www.flaticon.com/">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/">CC 3.0 BY</a>.<br>Ribbon made by <a href="https://github.com/tholman/github-corners">Tim Holman</a> is licensed by <a href="https://opensource.org/licenses/MIT">The MIT License</a><br>Built with the <a href="https://minicss.org">mini.css framework</a>.</p></footer>
|
||||||
|
'''
|
||||||
|
rendered = f'<div class="row" style="height:calc(100vh - 5.875rem);overflow:hidden">{nav_string}<main class="col-sm-12 col-md-8 col-lg-9" style="height:100%;overflow-y:auto;background:#eceef2;padding:0">' + rendered + f'<button class="scroll-to-top">↑</button>{footer}</main></div>'
|
||||||
|
rendered = re.sub('<code\s*class=" language-python">','',rendered)
|
||||||
|
open('website/app/templates/index.html','w',encoding='utf-8').write(start + rendered + end)
|
||||||
|
snippets = [snippet.replace('.md','') for snippet in snippets]
|
||||||
|
open('website/app/snippets','w').write('\n'.join(snippets))
|
||||||
11
website/requirements.txt
Normal file
11
website/requirements.txt
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
cffi==1.11.4
|
||||||
|
click==6.7
|
||||||
|
emoji==0.4.5
|
||||||
|
Flask==0.12.2
|
||||||
|
gunicorn==19.7.1
|
||||||
|
itsdangerous==0.24
|
||||||
|
Jinja2==2.10
|
||||||
|
MarkupSafe==1.0
|
||||||
|
misaka==2.1.0
|
||||||
|
pycparser==2.18
|
||||||
|
Werkzeug==0.14.1
|
||||||
6
website/run.py
Normal file
6
website/run.py
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
from app import app
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
app.jinja_env.auto_reload = True
|
||||||
|
app.config['TEMPLATES_AUTO_RELOAD'] = True
|
||||||
|
app.run(debug=True, host='0.0.0.0',port=80)
|
||||||
@ -0,0 +1,46 @@
|
|||||||
|
Flask
|
||||||
|
-----
|
||||||
|
|
||||||
|
Flask is a microframework for Python based on Werkzeug, Jinja 2 and good
|
||||||
|
intentions. And before you ask: It's BSD licensed!
|
||||||
|
|
||||||
|
Flask is Fun
|
||||||
|
````````````
|
||||||
|
|
||||||
|
Save in a hello.py:
|
||||||
|
|
||||||
|
.. code:: python
|
||||||
|
|
||||||
|
from flask import Flask
|
||||||
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
@app.route("/")
|
||||||
|
def hello():
|
||||||
|
return "Hello World!"
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
app.run()
|
||||||
|
|
||||||
|
And Easy to Setup
|
||||||
|
`````````````````
|
||||||
|
|
||||||
|
And run it:
|
||||||
|
|
||||||
|
.. code:: bash
|
||||||
|
|
||||||
|
$ pip install Flask
|
||||||
|
$ python hello.py
|
||||||
|
* Running on http://localhost:5000/
|
||||||
|
|
||||||
|
Ready for production? `Read this first <http://flask.pocoo.org/docs/deploying/>`.
|
||||||
|
|
||||||
|
Links
|
||||||
|
`````
|
||||||
|
|
||||||
|
* `website <http://flask.pocoo.org/>`_
|
||||||
|
* `documentation <http://flask.pocoo.org/docs/>`_
|
||||||
|
* `development version
|
||||||
|
<http://github.com/pallets/flask/zipball/master#egg=Flask-dev>`_
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -0,0 +1 @@
|
|||||||
|
pip
|
||||||
@ -0,0 +1,33 @@
|
|||||||
|
Copyright (c) 2015 by Armin Ronacher and contributors. See AUTHORS
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
Some rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms of the software as well
|
||||||
|
as documentation, with or without modification, are permitted provided
|
||||||
|
that the following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above
|
||||||
|
copyright notice, this list of conditions and the following
|
||||||
|
disclaimer in the documentation and/or other materials provided
|
||||||
|
with the distribution.
|
||||||
|
|
||||||
|
* The names of the contributors may not be used to endorse or
|
||||||
|
promote products derived from this software without specific
|
||||||
|
prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
||||||
|
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
|
||||||
|
NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
|
||||||
|
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||||
|
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
|
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
|
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||||
|
DAMAGE.
|
||||||
@ -0,0 +1,75 @@
|
|||||||
|
Metadata-Version: 2.0
|
||||||
|
Name: Flask
|
||||||
|
Version: 0.12.2
|
||||||
|
Summary: A microframework based on Werkzeug, Jinja2 and good intentions
|
||||||
|
Home-page: http://github.com/pallets/flask/
|
||||||
|
Author: Armin Ronacher
|
||||||
|
Author-email: armin.ronacher@active-4.com
|
||||||
|
License: BSD
|
||||||
|
Platform: any
|
||||||
|
Classifier: Development Status :: 4 - Beta
|
||||||
|
Classifier: Environment :: Web Environment
|
||||||
|
Classifier: Intended Audience :: Developers
|
||||||
|
Classifier: License :: OSI Approved :: BSD License
|
||||||
|
Classifier: Operating System :: OS Independent
|
||||||
|
Classifier: Programming Language :: Python
|
||||||
|
Classifier: Programming Language :: Python :: 2
|
||||||
|
Classifier: Programming Language :: Python :: 2.6
|
||||||
|
Classifier: Programming Language :: Python :: 2.7
|
||||||
|
Classifier: Programming Language :: Python :: 3
|
||||||
|
Classifier: Programming Language :: Python :: 3.3
|
||||||
|
Classifier: Programming Language :: Python :: 3.4
|
||||||
|
Classifier: Programming Language :: Python :: 3.5
|
||||||
|
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
||||||
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
||||||
|
Requires-Dist: Jinja2 (>=2.4)
|
||||||
|
Requires-Dist: Werkzeug (>=0.7)
|
||||||
|
Requires-Dist: click (>=2.0)
|
||||||
|
Requires-Dist: itsdangerous (>=0.21)
|
||||||
|
|
||||||
|
Flask
|
||||||
|
-----
|
||||||
|
|
||||||
|
Flask is a microframework for Python based on Werkzeug, Jinja 2 and good
|
||||||
|
intentions. And before you ask: It's BSD licensed!
|
||||||
|
|
||||||
|
Flask is Fun
|
||||||
|
````````````
|
||||||
|
|
||||||
|
Save in a hello.py:
|
||||||
|
|
||||||
|
.. code:: python
|
||||||
|
|
||||||
|
from flask import Flask
|
||||||
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
@app.route("/")
|
||||||
|
def hello():
|
||||||
|
return "Hello World!"
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
app.run()
|
||||||
|
|
||||||
|
And Easy to Setup
|
||||||
|
`````````````````
|
||||||
|
|
||||||
|
And run it:
|
||||||
|
|
||||||
|
.. code:: bash
|
||||||
|
|
||||||
|
$ pip install Flask
|
||||||
|
$ python hello.py
|
||||||
|
* Running on http://localhost:5000/
|
||||||
|
|
||||||
|
Ready for production? `Read this first <http://flask.pocoo.org/docs/deploying/>`.
|
||||||
|
|
||||||
|
Links
|
||||||
|
`````
|
||||||
|
|
||||||
|
* `website <http://flask.pocoo.org/>`_
|
||||||
|
* `documentation <http://flask.pocoo.org/docs/>`_
|
||||||
|
* `development version
|
||||||
|
<http://github.com/pallets/flask/zipball/master#egg=Flask-dev>`_
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
52
website/web/Lib/site-packages/Flask-0.12.2.dist-info/RECORD
Normal file
52
website/web/Lib/site-packages/Flask-0.12.2.dist-info/RECORD
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
Flask-0.12.2.dist-info/DESCRIPTION.rst,sha256=DmJm8IBlBjl3wkm0Ly23jYvWbvK_mCuE5oUseYCijbI,810
|
||||||
|
Flask-0.12.2.dist-info/LICENSE.txt,sha256=hLgKluMRHSnxG-L0EmrqjmKgG5cHlff6pIh3rCNINeI,1582
|
||||||
|
Flask-0.12.2.dist-info/METADATA,sha256=OgSkJQ_kmrz4qEkS-OzYtL75uZmXAThymkOcGR4kXRQ,1948
|
||||||
|
Flask-0.12.2.dist-info/RECORD,,
|
||||||
|
Flask-0.12.2.dist-info/WHEEL,sha256=o2k-Qa-RMNIJmUdIc7KU6VWR_ErNRbWNlxDIpl7lm34,110
|
||||||
|
Flask-0.12.2.dist-info/entry_points.txt,sha256=jzk2Wy2h30uEcqqzd4CVnlzsMXB-vaD5GXjuPMXmTmI,60
|
||||||
|
Flask-0.12.2.dist-info/metadata.json,sha256=By8kZ1vY9lLEAGnRiWNBhudqKvLPo0HkZVXTYECyPKk,1389
|
||||||
|
Flask-0.12.2.dist-info/top_level.txt,sha256=dvi65F6AeGWVU0TBpYiC04yM60-FX1gJFkK31IKQr5c,6
|
||||||
|
flask/__init__.py,sha256=sHdK1v6WRbVmCN0fEv990EE7rOT2UlamQkSof2d0Dt0,1673
|
||||||
|
flask/__main__.py,sha256=cldbNi5zpjE68XzIWI8uYHNWwBHHVJmwtlXWk6P4CO4,291
|
||||||
|
flask/_compat.py,sha256=VlfjUuLjufsTHJIjr_ZsnnOesSbAXIslBBgRe5tfOok,2802
|
||||||
|
flask/app.py,sha256=6DPjtb5jUJWgL5fXksG5boA49EB3l-k9pWyftitbNNk,83169
|
||||||
|
flask/blueprints.py,sha256=6HVasMcPcaq7tk36kCrgX4bnhTkky4G5WIWCyyJL8HY,16872
|
||||||
|
flask/cli.py,sha256=2NXEdCOu5-4ymklxX4Lf6bjb-89I4VHYeP6xScR3i8E,18328
|
||||||
|
flask/config.py,sha256=Ym5Jenyu6zAZ1fdVLeKekY9-EsKmq8183qnRgauwCMY,9905
|
||||||
|
flask/ctx.py,sha256=UPA0YwoIlHP0txOGanC9lQLSGv6eCqV5Fmw2cVJRmgQ,14739
|
||||||
|
flask/debughelpers.py,sha256=z-uQavKIymOZl0WQDLXsnacA00ERIlCx3S3Tnb_OYsE,6024
|
||||||
|
flask/exthook.py,sha256=SvXs5jwpcOjogwJ7SNquiWTxowoN1-MHFoqAejWnk2o,5762
|
||||||
|
flask/globals.py,sha256=I3m_4RssLhWW1R11zuEI8oFryHUHX3NQwjMkGXOZzg8,1645
|
||||||
|
flask/helpers.py,sha256=KrsQ2Yo3lOVHvBTgQCLvpubgmTOpQdTTyiCOOYlwDuQ,38452
|
||||||
|
flask/json.py,sha256=1zPM-NPLiWoOfGd0P14FxnEkeKtjtUZxMC9pyYyDBYI,9183
|
||||||
|
flask/logging.py,sha256=UG-77jPkRClk9w1B-_ArjjXPuj9AmZz9mG0IRGvptW0,2751
|
||||||
|
flask/sessions.py,sha256=QBKXVYKJ-HKbx9m6Yb5yan_EPq84a5yevVLgAzNKFQY,14394
|
||||||
|
flask/signals.py,sha256=MfZk5qTRj_R_O3aGYlTEnx2g3SvlZncz8Ii73eKK59g,2209
|
||||||
|
flask/templating.py,sha256=u7FbN6j56H_q6CrdJJyJ6gZtqaMa0vh1_GP12gEHRQQ,4912
|
||||||
|
flask/testing.py,sha256=II8EO_NjOT1LvL8Hh_SdIFL_BdlwVPcB9yot5pbltxE,5630
|
||||||
|
flask/views.py,sha256=6OPv7gwu3h14JhqpeeMRWwrxoGHsUr4_nOGSyTRAxAI,5630
|
||||||
|
flask/wrappers.py,sha256=1S_5mmuA1Tlx7D9lXV6xMblrg-PdAauNWahe-henMEE,7612
|
||||||
|
flask/ext/__init__.py,sha256=UEezCApsG4ZJWqwUnX9YmWcNN4OVENgph_9L05n0eOM,842
|
||||||
|
../../Scripts/flask.exe,sha256=WiosIiBPkig5ooCR_yaHUrP5WMPviLDqJxogDFixmOY,98150
|
||||||
|
Flask-0.12.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
||||||
|
flask/ext/__pycache__/__init__.cpython-36.pyc,,
|
||||||
|
flask/__pycache__/app.cpython-36.pyc,,
|
||||||
|
flask/__pycache__/blueprints.cpython-36.pyc,,
|
||||||
|
flask/__pycache__/cli.cpython-36.pyc,,
|
||||||
|
flask/__pycache__/config.cpython-36.pyc,,
|
||||||
|
flask/__pycache__/ctx.cpython-36.pyc,,
|
||||||
|
flask/__pycache__/debughelpers.cpython-36.pyc,,
|
||||||
|
flask/__pycache__/exthook.cpython-36.pyc,,
|
||||||
|
flask/__pycache__/globals.cpython-36.pyc,,
|
||||||
|
flask/__pycache__/helpers.cpython-36.pyc,,
|
||||||
|
flask/__pycache__/json.cpython-36.pyc,,
|
||||||
|
flask/__pycache__/logging.cpython-36.pyc,,
|
||||||
|
flask/__pycache__/sessions.cpython-36.pyc,,
|
||||||
|
flask/__pycache__/signals.cpython-36.pyc,,
|
||||||
|
flask/__pycache__/templating.cpython-36.pyc,,
|
||||||
|
flask/__pycache__/testing.cpython-36.pyc,,
|
||||||
|
flask/__pycache__/views.cpython-36.pyc,,
|
||||||
|
flask/__pycache__/wrappers.cpython-36.pyc,,
|
||||||
|
flask/__pycache__/_compat.cpython-36.pyc,,
|
||||||
|
flask/__pycache__/__init__.cpython-36.pyc,,
|
||||||
|
flask/__pycache__/__main__.cpython-36.pyc,,
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
Wheel-Version: 1.0
|
||||||
|
Generator: bdist_wheel (0.29.0)
|
||||||
|
Root-Is-Purelib: true
|
||||||
|
Tag: py2-none-any
|
||||||
|
Tag: py3-none-any
|
||||||
|
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
[console_scripts]
|
||||||
|
flask=flask.cli:main
|
||||||
|
|
||||||
@ -0,0 +1 @@
|
|||||||
|
{"classifiers": ["Development Status :: 4 - Beta", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules"], "extensions": {"python.commands": {"wrap_console": {"flask": "flask.cli:main"}}, "python.details": {"contacts": [{"email": "armin.ronacher@active-4.com", "name": "Armin Ronacher", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst", "license": "LICENSE.txt"}, "project_urls": {"Home": "http://github.com/pallets/flask/"}}, "python.exports": {"console_scripts": {"flask": "flask.cli:main"}}}, "extras": [], "generator": "bdist_wheel (0.29.0)", "license": "BSD", "metadata_version": "2.0", "name": "Flask", "platform": "any", "run_requires": [{"requires": ["Jinja2 (>=2.4)", "Werkzeug (>=0.7)", "click (>=2.0)", "itsdangerous (>=0.21)"]}], "summary": "A microframework based on Werkzeug, Jinja2 and good intentions", "version": "0.12.2"}
|
||||||
@ -0,0 +1 @@
|
|||||||
|
flask
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
Metadata-Version: 1.1
|
||||||
|
Name: Flask-OAuth
|
||||||
|
Version: 0.12
|
||||||
|
Summary: Adds OAuth support to Flask
|
||||||
|
Home-page: http://github.com/mitsuhiko/flask-oauth
|
||||||
|
Author: Armin Ronacher
|
||||||
|
Author-email: armin.ronacher@active-4.com
|
||||||
|
License: BSD
|
||||||
|
Description:
|
||||||
|
Flask-OAuth
|
||||||
|
-----------
|
||||||
|
|
||||||
|
Adds OAuth support to Flask.
|
||||||
|
|
||||||
|
Links
|
||||||
|
`````
|
||||||
|
|
||||||
|
* `documentation <http://packages.python.org/Flask-OAuth>`_
|
||||||
|
* `development version
|
||||||
|
<http://github.com/mitsuhiko/flask-oauth/zipball/master#egg=Flask-OAuth-dev>`_
|
||||||
|
|
||||||
|
Platform: any
|
||||||
|
Classifier: Development Status :: 4 - Beta
|
||||||
|
Classifier: Environment :: Web Environment
|
||||||
|
Classifier: Intended Audience :: Developers
|
||||||
|
Classifier: License :: OSI Approved :: BSD License
|
||||||
|
Classifier: Operating System :: OS Independent
|
||||||
|
Classifier: Programming Language :: Python
|
||||||
|
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
||||||
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
README
|
||||||
|
flask_oauth.py
|
||||||
|
setup.cfg
|
||||||
|
setup.py
|
||||||
|
Flask_OAuth.egg-info/PKG-INFO
|
||||||
|
Flask_OAuth.egg-info/SOURCES.txt
|
||||||
|
Flask_OAuth.egg-info/dependency_links.txt
|
||||||
|
Flask_OAuth.egg-info/not-zip-safe
|
||||||
|
Flask_OAuth.egg-info/requires.txt
|
||||||
|
Flask_OAuth.egg-info/top_level.txt
|
||||||
@ -0,0 +1 @@
|
|||||||
|
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
..\flask_oauth.py
|
||||||
|
..\__pycache__\flask_oauth.cpython-36.pyc
|
||||||
|
dependency_links.txt
|
||||||
|
not-zip-safe
|
||||||
|
PKG-INFO
|
||||||
|
requires.txt
|
||||||
|
SOURCES.txt
|
||||||
|
top_level.txt
|
||||||
@ -0,0 +1 @@
|
|||||||
|
|
||||||
@ -0,0 +1,2 @@
|
|||||||
|
Flask
|
||||||
|
oauth2
|
||||||
@ -0,0 +1 @@
|
|||||||
|
flask_oauth
|
||||||
@ -0,0 +1,37 @@
|
|||||||
|
|
||||||
|
Jinja2
|
||||||
|
~~~~~~
|
||||||
|
|
||||||
|
Jinja2 is a template engine written in pure Python. It provides a
|
||||||
|
`Django`_ inspired non-XML syntax but supports inline expressions and
|
||||||
|
an optional `sandboxed`_ environment.
|
||||||
|
|
||||||
|
Nutshell
|
||||||
|
--------
|
||||||
|
|
||||||
|
Here a small example of a Jinja template::
|
||||||
|
|
||||||
|
{% extends 'base.html' %}
|
||||||
|
{% block title %}Memberlist{% endblock %}
|
||||||
|
{% block content %}
|
||||||
|
<ul>
|
||||||
|
{% for user in users %}
|
||||||
|
<li><a href="{{ user.url }}">{{ user.username }}</a></li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
Philosophy
|
||||||
|
----------
|
||||||
|
|
||||||
|
Application logic is for the controller but don't try to make the life
|
||||||
|
for the template designer too hard by giving him too few functionality.
|
||||||
|
|
||||||
|
For more informations visit the new `Jinja2 webpage`_ and `documentation`_.
|
||||||
|
|
||||||
|
.. _sandboxed: https://en.wikipedia.org/wiki/Sandbox_(computer_security)
|
||||||
|
.. _Django: https://www.djangoproject.com/
|
||||||
|
.. _Jinja2 webpage: http://jinja.pocoo.org/
|
||||||
|
.. _documentation: http://jinja.pocoo.org/2/documentation/
|
||||||
|
|
||||||
|
|
||||||
@ -0,0 +1 @@
|
|||||||
|
pip
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
Copyright (c) 2009 by the Jinja Team, see AUTHORS for more details.
|
||||||
|
|
||||||
|
Some rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are
|
||||||
|
met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above
|
||||||
|
copyright notice, this list of conditions and the following
|
||||||
|
disclaimer in the documentation and/or other materials provided
|
||||||
|
with the distribution.
|
||||||
|
|
||||||
|
* The names of the contributors may not be used to endorse or
|
||||||
|
promote products derived from this software without specific
|
||||||
|
prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
68
website/web/Lib/site-packages/Jinja2-2.10.dist-info/METADATA
Normal file
68
website/web/Lib/site-packages/Jinja2-2.10.dist-info/METADATA
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
Metadata-Version: 2.0
|
||||||
|
Name: Jinja2
|
||||||
|
Version: 2.10
|
||||||
|
Summary: A small but fast and easy to use stand-alone template engine written in pure python.
|
||||||
|
Home-page: http://jinja.pocoo.org/
|
||||||
|
Author: Armin Ronacher
|
||||||
|
Author-email: armin.ronacher@active-4.com
|
||||||
|
License: BSD
|
||||||
|
Description-Content-Type: UNKNOWN
|
||||||
|
Platform: UNKNOWN
|
||||||
|
Classifier: Development Status :: 5 - Production/Stable
|
||||||
|
Classifier: Environment :: Web Environment
|
||||||
|
Classifier: Intended Audience :: Developers
|
||||||
|
Classifier: License :: OSI Approved :: BSD License
|
||||||
|
Classifier: Operating System :: OS Independent
|
||||||
|
Classifier: Programming Language :: Python
|
||||||
|
Classifier: Programming Language :: Python :: 2
|
||||||
|
Classifier: Programming Language :: Python :: 2.6
|
||||||
|
Classifier: Programming Language :: Python :: 2.7
|
||||||
|
Classifier: Programming Language :: Python :: 3
|
||||||
|
Classifier: Programming Language :: Python :: 3.3
|
||||||
|
Classifier: Programming Language :: Python :: 3.4
|
||||||
|
Classifier: Programming Language :: Python :: 3.5
|
||||||
|
Classifier: Programming Language :: Python :: 3.6
|
||||||
|
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
||||||
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
||||||
|
Classifier: Topic :: Text Processing :: Markup :: HTML
|
||||||
|
Requires-Dist: MarkupSafe (>=0.23)
|
||||||
|
Provides-Extra: i18n
|
||||||
|
Requires-Dist: Babel (>=0.8); extra == 'i18n'
|
||||||
|
|
||||||
|
|
||||||
|
Jinja2
|
||||||
|
~~~~~~
|
||||||
|
|
||||||
|
Jinja2 is a template engine written in pure Python. It provides a
|
||||||
|
`Django`_ inspired non-XML syntax but supports inline expressions and
|
||||||
|
an optional `sandboxed`_ environment.
|
||||||
|
|
||||||
|
Nutshell
|
||||||
|
--------
|
||||||
|
|
||||||
|
Here a small example of a Jinja template::
|
||||||
|
|
||||||
|
{% extends 'base.html' %}
|
||||||
|
{% block title %}Memberlist{% endblock %}
|
||||||
|
{% block content %}
|
||||||
|
<ul>
|
||||||
|
{% for user in users %}
|
||||||
|
<li><a href="{{ user.url }}">{{ user.username }}</a></li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
Philosophy
|
||||||
|
----------
|
||||||
|
|
||||||
|
Application logic is for the controller but don't try to make the life
|
||||||
|
for the template designer too hard by giving him too few functionality.
|
||||||
|
|
||||||
|
For more informations visit the new `Jinja2 webpage`_ and `documentation`_.
|
||||||
|
|
||||||
|
.. _sandboxed: https://en.wikipedia.org/wiki/Sandbox_(computer_security)
|
||||||
|
.. _Django: https://www.djangoproject.com/
|
||||||
|
.. _Jinja2 webpage: http://jinja.pocoo.org/
|
||||||
|
.. _documentation: http://jinja.pocoo.org/2/documentation/
|
||||||
|
|
||||||
|
|
||||||
63
website/web/Lib/site-packages/Jinja2-2.10.dist-info/RECORD
Normal file
63
website/web/Lib/site-packages/Jinja2-2.10.dist-info/RECORD
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
Jinja2-2.10.dist-info/DESCRIPTION.rst,sha256=b5ckFDoM7vVtz_mAsJD4OPteFKCqE7beu353g4COoYI,978
|
||||||
|
Jinja2-2.10.dist-info/LICENSE.txt,sha256=JvzUNv3Io51EiWrAPm8d_SXjhJnEjyDYvB3Tvwqqils,1554
|
||||||
|
Jinja2-2.10.dist-info/METADATA,sha256=18EgU8zR6-av-0-5y_gXebzK4GnBB_76lALUsl-6QHM,2258
|
||||||
|
Jinja2-2.10.dist-info/RECORD,,
|
||||||
|
Jinja2-2.10.dist-info/WHEEL,sha256=kdsN-5OJAZIiHN-iO4Rhl82KyS0bDWf4uBwMbkNafr8,110
|
||||||
|
Jinja2-2.10.dist-info/entry_points.txt,sha256=NdzVcOrqyNyKDxD09aERj__3bFx2paZhizFDsKmVhiA,72
|
||||||
|
Jinja2-2.10.dist-info/metadata.json,sha256=NPUJ9TMBxVQAv_kTJzvU8HwmP-4XZvbK9mz6_4YUVl4,1473
|
||||||
|
Jinja2-2.10.dist-info/top_level.txt,sha256=PkeVWtLb3-CqjWi1fO29OCbj55EhX_chhKrCdrVe_zs,7
|
||||||
|
jinja2/__init__.py,sha256=xJHjaMoy51_KXn1wf0cysH6tUUifUxZCwSOfcJGEYZw,2614
|
||||||
|
jinja2/_compat.py,sha256=xP60CE5Qr8FTYcDE1f54tbZLKGvMwYml4-8T7Q4KG9k,2596
|
||||||
|
jinja2/_identifier.py,sha256=W1QBSY-iJsyt6oR_nKSuNNCzV95vLIOYgUNPUI1d5gU,1726
|
||||||
|
jinja2/asyncfilters.py,sha256=cTDPvrS8Hp_IkwsZ1m9af_lr5nHysw7uTa5gV0NmZVE,4144
|
||||||
|
jinja2/asyncsupport.py,sha256=UErQ3YlTLaSjFb94P4MVn08-aVD9jJxty2JVfMRb-1M,7878
|
||||||
|
jinja2/bccache.py,sha256=nQldx0ZRYANMyfvOihRoYFKSlUdd5vJkS7BjxNwlOZM,12794
|
||||||
|
jinja2/compiler.py,sha256=BqC5U6JxObSRhblyT_a6Tp5GtEU5z3US1a4jLQaxxgo,65386
|
||||||
|
jinja2/constants.py,sha256=uwwV8ZUhHhacAuz5PTwckfsbqBaqM7aKfyJL7kGX5YQ,1626
|
||||||
|
jinja2/debug.py,sha256=WTVeUFGUa4v6ReCsYv-iVPa3pkNB75OinJt3PfxNdXs,12045
|
||||||
|
jinja2/defaults.py,sha256=Em-95hmsJxIenDCZFB1YSvf9CNhe9rBmytN3yUrBcWA,1400
|
||||||
|
jinja2/environment.py,sha256=VnkAkqw8JbjZct4tAyHlpBrka2vqB-Z58RAP-32P1ZY,50849
|
||||||
|
jinja2/exceptions.py,sha256=_Rj-NVi98Q6AiEjYQOsP8dEIdu5AlmRHzcSNOPdWix4,4428
|
||||||
|
jinja2/ext.py,sha256=atMQydEC86tN1zUsdQiHw5L5cF62nDbqGue25Yiu3N4,24500
|
||||||
|
jinja2/filters.py,sha256=yOAJk0MsH-_gEC0i0U6NweVQhbtYaC-uE8xswHFLF4w,36528
|
||||||
|
jinja2/idtracking.py,sha256=2GbDSzIvGArEBGLkovLkqEfmYxmWsEf8c3QZwM4uNsw,9197
|
||||||
|
jinja2/lexer.py,sha256=ySEPoXd1g7wRjsuw23uimS6nkGN5aqrYwcOKxCaVMBQ,28559
|
||||||
|
jinja2/loaders.py,sha256=xiTuURKAEObyym0nU8PCIXu_Qp8fn0AJ5oIADUUm-5Q,17382
|
||||||
|
jinja2/meta.py,sha256=fmKHxkmZYAOm9QyWWy8EMd6eefAIh234rkBMW2X4ZR8,4340
|
||||||
|
jinja2/nativetypes.py,sha256=_sJhS8f-8Q0QMIC0dm1YEdLyxEyoO-kch8qOL5xUDfE,7308
|
||||||
|
jinja2/nodes.py,sha256=L10L_nQDfubLhO3XjpF9qz46FSh2clL-3e49ogVlMmA,30853
|
||||||
|
jinja2/optimizer.py,sha256=MsdlFACJ0FRdPtjmCAdt7JQ9SGrXFaDNUaslsWQaG3M,1722
|
||||||
|
jinja2/parser.py,sha256=lPzTEbcpTRBLw8ii6OYyExHeAhaZLMA05Hpv4ll3ULk,35875
|
||||||
|
jinja2/runtime.py,sha256=DHdD38Pq8gj7uWQC5usJyWFoNWL317A9AvXOW_CLB34,27755
|
||||||
|
jinja2/sandbox.py,sha256=TVyZHlNqqTzsv9fv2NvJNmSdWRHTguhyMHdxjWms32U,16708
|
||||||
|
jinja2/tests.py,sha256=iJQLwbapZr-EKquTG_fVOVdwHUUKf3SX9eNkjQDF8oU,4237
|
||||||
|
jinja2/utils.py,sha256=q24VupGZotQ-uOyrJxCaXtDWhZC1RgsQG7kcdmjck2Q,20629
|
||||||
|
jinja2/visitor.py,sha256=JD1H1cANA29JcntFfN5fPyqQxB4bI4wC00BzZa-XHks,3316
|
||||||
|
Jinja2-2.10.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
||||||
|
jinja2/__pycache__/asyncfilters.cpython-36.pyc,,
|
||||||
|
jinja2/__pycache__/asyncsupport.cpython-36.pyc,,
|
||||||
|
jinja2/__pycache__/bccache.cpython-36.pyc,,
|
||||||
|
jinja2/__pycache__/compiler.cpython-36.pyc,,
|
||||||
|
jinja2/__pycache__/constants.cpython-36.pyc,,
|
||||||
|
jinja2/__pycache__/debug.cpython-36.pyc,,
|
||||||
|
jinja2/__pycache__/defaults.cpython-36.pyc,,
|
||||||
|
jinja2/__pycache__/environment.cpython-36.pyc,,
|
||||||
|
jinja2/__pycache__/exceptions.cpython-36.pyc,,
|
||||||
|
jinja2/__pycache__/ext.cpython-36.pyc,,
|
||||||
|
jinja2/__pycache__/filters.cpython-36.pyc,,
|
||||||
|
jinja2/__pycache__/idtracking.cpython-36.pyc,,
|
||||||
|
jinja2/__pycache__/lexer.cpython-36.pyc,,
|
||||||
|
jinja2/__pycache__/loaders.cpython-36.pyc,,
|
||||||
|
jinja2/__pycache__/meta.cpython-36.pyc,,
|
||||||
|
jinja2/__pycache__/nativetypes.cpython-36.pyc,,
|
||||||
|
jinja2/__pycache__/nodes.cpython-36.pyc,,
|
||||||
|
jinja2/__pycache__/optimizer.cpython-36.pyc,,
|
||||||
|
jinja2/__pycache__/parser.cpython-36.pyc,,
|
||||||
|
jinja2/__pycache__/runtime.cpython-36.pyc,,
|
||||||
|
jinja2/__pycache__/sandbox.cpython-36.pyc,,
|
||||||
|
jinja2/__pycache__/tests.cpython-36.pyc,,
|
||||||
|
jinja2/__pycache__/utils.cpython-36.pyc,,
|
||||||
|
jinja2/__pycache__/visitor.cpython-36.pyc,,
|
||||||
|
jinja2/__pycache__/_compat.cpython-36.pyc,,
|
||||||
|
jinja2/__pycache__/_identifier.cpython-36.pyc,,
|
||||||
|
jinja2/__pycache__/__init__.cpython-36.pyc,,
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
Wheel-Version: 1.0
|
||||||
|
Generator: bdist_wheel (0.30.0)
|
||||||
|
Root-Is-Purelib: true
|
||||||
|
Tag: py2-none-any
|
||||||
|
Tag: py3-none-any
|
||||||
|
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
[babel.extractors]
|
||||||
|
jinja2 = jinja2.ext:babel_extract[i18n]
|
||||||
|
|
||||||
@ -0,0 +1 @@
|
|||||||
|
{"classifiers": ["Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "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 :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Text Processing :: Markup :: HTML"], "description_content_type": "UNKNOWN", "extensions": {"python.details": {"contacts": [{"email": "armin.ronacher@active-4.com", "name": "Armin Ronacher", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst", "license": "LICENSE.txt"}, "project_urls": {"Home": "http://jinja.pocoo.org/"}}, "python.exports": {"babel.extractors": {"jinja2": "jinja2.ext:babel_extract [i18n]"}}}, "extras": ["i18n"], "generator": "bdist_wheel (0.30.0)", "license": "BSD", "metadata_version": "2.0", "name": "Jinja2", "run_requires": [{"extra": "i18n", "requires": ["Babel (>=0.8)"]}, {"requires": ["MarkupSafe (>=0.23)"]}], "summary": "A small but fast and easy to use stand-alone template engine written in pure python.", "version": "2.10"}
|
||||||
@ -0,0 +1 @@
|
|||||||
|
jinja2
|
||||||
@ -0,0 +1,133 @@
|
|||||||
|
Metadata-Version: 1.1
|
||||||
|
Name: MarkupSafe
|
||||||
|
Version: 1.0
|
||||||
|
Summary: Implements a XML/HTML/XHTML Markup safe string for Python
|
||||||
|
Home-page: http://github.com/pallets/markupsafe
|
||||||
|
Author: Armin Ronacher
|
||||||
|
Author-email: armin.ronacher@active-4.com
|
||||||
|
License: BSD
|
||||||
|
Description: MarkupSafe
|
||||||
|
==========
|
||||||
|
|
||||||
|
Implements a unicode subclass that supports HTML strings:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
>>> from markupsafe import Markup, escape
|
||||||
|
>>> escape("<script>alert(document.cookie);</script>")
|
||||||
|
Markup(u'<script>alert(document.cookie);</script>')
|
||||||
|
>>> tmpl = Markup("<em>%s</em>")
|
||||||
|
>>> tmpl % "Peter > Lustig"
|
||||||
|
Markup(u'<em>Peter > Lustig</em>')
|
||||||
|
|
||||||
|
If you want to make an object unicode that is not yet unicode
|
||||||
|
but don't want to lose the taint information, you can use the
|
||||||
|
``soft_unicode`` function. (On Python 3 you can also use ``soft_str`` which
|
||||||
|
is a different name for the same function).
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
>>> from markupsafe import soft_unicode
|
||||||
|
>>> soft_unicode(42)
|
||||||
|
u'42'
|
||||||
|
>>> soft_unicode(Markup('foo'))
|
||||||
|
Markup(u'foo')
|
||||||
|
|
||||||
|
HTML Representations
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
Objects can customize their HTML markup equivalent by overriding
|
||||||
|
the ``__html__`` function:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
>>> class Foo(object):
|
||||||
|
... def __html__(self):
|
||||||
|
... return '<strong>Nice</strong>'
|
||||||
|
...
|
||||||
|
>>> escape(Foo())
|
||||||
|
Markup(u'<strong>Nice</strong>')
|
||||||
|
>>> Markup(Foo())
|
||||||
|
Markup(u'<strong>Nice</strong>')
|
||||||
|
|
||||||
|
Silent Escapes
|
||||||
|
--------------
|
||||||
|
|
||||||
|
Since MarkupSafe 0.10 there is now also a separate escape function
|
||||||
|
called ``escape_silent`` that returns an empty string for ``None`` for
|
||||||
|
consistency with other systems that return empty strings for ``None``
|
||||||
|
when escaping (for instance Pylons' webhelpers).
|
||||||
|
|
||||||
|
If you also want to use this for the escape method of the Markup
|
||||||
|
object, you can create your own subclass that does that:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
from markupsafe import Markup, escape_silent as escape
|
||||||
|
|
||||||
|
class SilentMarkup(Markup):
|
||||||
|
__slots__ = ()
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def escape(cls, s):
|
||||||
|
return cls(escape(s))
|
||||||
|
|
||||||
|
New-Style String Formatting
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
Starting with MarkupSafe 0.21 new style string formats from Python 2.6 and
|
||||||
|
3.x are now fully supported. Previously the escape behavior of those
|
||||||
|
functions was spotty at best. The new implementations operates under the
|
||||||
|
following algorithm:
|
||||||
|
|
||||||
|
1. if an object has an ``__html_format__`` method it is called as
|
||||||
|
replacement for ``__format__`` with the format specifier. It either
|
||||||
|
has to return a string or markup object.
|
||||||
|
2. if an object has an ``__html__`` method it is called.
|
||||||
|
3. otherwise the default format system of Python kicks in and the result
|
||||||
|
is HTML escaped.
|
||||||
|
|
||||||
|
Here is how you can implement your own formatting:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
class User(object):
|
||||||
|
|
||||||
|
def __init__(self, id, username):
|
||||||
|
self.id = id
|
||||||
|
self.username = username
|
||||||
|
|
||||||
|
def __html_format__(self, format_spec):
|
||||||
|
if format_spec == 'link':
|
||||||
|
return Markup('<a href="/user/{0}">{1}</a>').format(
|
||||||
|
self.id,
|
||||||
|
self.__html__(),
|
||||||
|
)
|
||||||
|
elif format_spec:
|
||||||
|
raise ValueError('Invalid format spec')
|
||||||
|
return self.__html__()
|
||||||
|
|
||||||
|
def __html__(self):
|
||||||
|
return Markup('<span class=user>{0}</span>').format(self.username)
|
||||||
|
|
||||||
|
And to format that user:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
>>> user = User(1, 'foo')
|
||||||
|
>>> Markup('<p>User: {0:link}').format(user)
|
||||||
|
Markup(u'<p>User: <a href="/user/1"><span class=user>foo</span></a>')
|
||||||
|
|
||||||
|
Markupsafe supports Python 2.6, 2.7 and Python 3.3 and higher.
|
||||||
|
|
||||||
|
Platform: UNKNOWN
|
||||||
|
Classifier: Development Status :: 5 - Production/Stable
|
||||||
|
Classifier: Environment :: Web Environment
|
||||||
|
Classifier: Intended Audience :: Developers
|
||||||
|
Classifier: License :: OSI Approved :: BSD License
|
||||||
|
Classifier: Operating System :: OS Independent
|
||||||
|
Classifier: Programming Language :: Python
|
||||||
|
Classifier: Programming Language :: Python :: 3
|
||||||
|
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
||||||
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
||||||
|
Classifier: Topic :: Text Processing :: Markup :: HTML
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
AUTHORS
|
||||||
|
CHANGES
|
||||||
|
LICENSE
|
||||||
|
MANIFEST.in
|
||||||
|
README.rst
|
||||||
|
setup.cfg
|
||||||
|
setup.py
|
||||||
|
tests.py
|
||||||
|
MarkupSafe.egg-info/PKG-INFO
|
||||||
|
MarkupSafe.egg-info/SOURCES.txt
|
||||||
|
MarkupSafe.egg-info/dependency_links.txt
|
||||||
|
MarkupSafe.egg-info/not-zip-safe
|
||||||
|
MarkupSafe.egg-info/top_level.txt
|
||||||
|
markupsafe/__init__.py
|
||||||
|
markupsafe/_compat.py
|
||||||
|
markupsafe/_constants.py
|
||||||
|
markupsafe/_native.py
|
||||||
|
markupsafe/_speedups.c
|
||||||
@ -0,0 +1 @@
|
|||||||
|
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
..\markupsafe\_compat.py
|
||||||
|
..\markupsafe\_constants.py
|
||||||
|
..\markupsafe\_native.py
|
||||||
|
..\markupsafe\__init__.py
|
||||||
|
..\markupsafe\_speedups.c
|
||||||
|
..\markupsafe\__pycache__\_compat.cpython-36.pyc
|
||||||
|
..\markupsafe\__pycache__\_constants.cpython-36.pyc
|
||||||
|
..\markupsafe\__pycache__\_native.cpython-36.pyc
|
||||||
|
..\markupsafe\__pycache__\__init__.cpython-36.pyc
|
||||||
|
..\markupsafe\_speedups.cp36-win_amd64.pyd
|
||||||
|
dependency_links.txt
|
||||||
|
not-zip-safe
|
||||||
|
PKG-INFO
|
||||||
|
SOURCES.txt
|
||||||
|
top_level.txt
|
||||||
@ -0,0 +1 @@
|
|||||||
|
|
||||||
@ -0,0 +1 @@
|
|||||||
|
markupsafe
|
||||||
@ -0,0 +1,80 @@
|
|||||||
|
Werkzeug
|
||||||
|
========
|
||||||
|
|
||||||
|
Werkzeug is a comprehensive `WSGI`_ web application library. It began as
|
||||||
|
a simple collection of various utilities for WSGI applications and has
|
||||||
|
become one of the most advanced WSGI utility libraries.
|
||||||
|
|
||||||
|
It includes:
|
||||||
|
|
||||||
|
* An interactive debugger that allows inspecting stack traces and source
|
||||||
|
code in the browser with an interactive interpreter for any frame in
|
||||||
|
the stack.
|
||||||
|
* A full-featured request object with objects to interact with headers,
|
||||||
|
query args, form data, files, and cookies.
|
||||||
|
* A response object that can wrap other WSGI applications and handle
|
||||||
|
streaming data.
|
||||||
|
* A routing system for matching URLs to endpoints and generating URLs
|
||||||
|
for endpoints, with an extensible system for capturing variables from
|
||||||
|
URLs.
|
||||||
|
* HTTP utilities to handle entity tags, cache control, dates, user
|
||||||
|
agents, cookies, files, and more.
|
||||||
|
* A threaded WSGI server for use while developing applications locally.
|
||||||
|
* A test client for simulating HTTP requests during testing without
|
||||||
|
requiring running a server.
|
||||||
|
|
||||||
|
Werkzeug is Unicode aware and doesn't enforce any dependencies. It is up
|
||||||
|
to the developer to choose a template engine, database adapter, and even
|
||||||
|
how to handle requests. It can be used to build all sorts of end user
|
||||||
|
applications such as blogs, wikis, or bulletin boards.
|
||||||
|
|
||||||
|
`Flask`_ wraps Werkzeug, using it to handle the details of WSGI while
|
||||||
|
providing more structure and patterns for defining powerful
|
||||||
|
applications.
|
||||||
|
|
||||||
|
|
||||||
|
Installing
|
||||||
|
----------
|
||||||
|
|
||||||
|
Install and update using `pip`_:
|
||||||
|
|
||||||
|
.. code-block:: text
|
||||||
|
|
||||||
|
pip install -U Werkzeug
|
||||||
|
|
||||||
|
|
||||||
|
A Simple Example
|
||||||
|
----------------
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
from werkzeug.wrappers import Request, Response
|
||||||
|
|
||||||
|
@Request.application
|
||||||
|
def application(request):
|
||||||
|
return Response('Hello, World!')
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
from werkzeug.serving import run_simple
|
||||||
|
run_simple('localhost', 4000, application)
|
||||||
|
|
||||||
|
|
||||||
|
Links
|
||||||
|
-----
|
||||||
|
|
||||||
|
* Website: https://www.palletsprojects.com/p/werkzeug/
|
||||||
|
* Releases: https://pypi.org/project/Werkzeug/
|
||||||
|
* Code: https://github.com/pallets/werkzeug
|
||||||
|
* Issue tracker: https://github.com/pallets/werkzeug/issues
|
||||||
|
* Test status:
|
||||||
|
|
||||||
|
* Linux, Mac: https://travis-ci.org/pallets/werkzeug
|
||||||
|
* Windows: https://ci.appveyor.com/project/davidism/werkzeug
|
||||||
|
|
||||||
|
* Test coverage: https://codecov.io/gh/pallets/werkzeug
|
||||||
|
|
||||||
|
.. _WSGI: https://wsgi.readthedocs.io/en/latest/
|
||||||
|
.. _Flask: https://www.palletsprojects.com/p/flask/
|
||||||
|
.. _pip: https://pip.pypa.io/en/stable/quickstart/
|
||||||
|
|
||||||
|
|
||||||
@ -0,0 +1 @@
|
|||||||
|
pip
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
Copyright © 2007 by the Pallets team.
|
||||||
|
|
||||||
|
Some rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are
|
||||||
|
met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of the copyright holder nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived from
|
||||||
|
this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
||||||
|
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
|
||||||
|
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
||||||
|
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||||
|
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
|
THIS SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGE.
|
||||||
116
website/web/Lib/site-packages/Werkzeug-0.14.1.dist-info/METADATA
Normal file
116
website/web/Lib/site-packages/Werkzeug-0.14.1.dist-info/METADATA
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
Metadata-Version: 2.0
|
||||||
|
Name: Werkzeug
|
||||||
|
Version: 0.14.1
|
||||||
|
Summary: The comprehensive WSGI web application library.
|
||||||
|
Home-page: https://www.palletsprojects.org/p/werkzeug/
|
||||||
|
Author: Armin Ronacher
|
||||||
|
Author-email: armin.ronacher@active-4.com
|
||||||
|
License: BSD
|
||||||
|
Description-Content-Type: UNKNOWN
|
||||||
|
Platform: any
|
||||||
|
Classifier: Development Status :: 5 - Production/Stable
|
||||||
|
Classifier: Environment :: Web Environment
|
||||||
|
Classifier: Intended Audience :: Developers
|
||||||
|
Classifier: License :: OSI Approved :: BSD License
|
||||||
|
Classifier: Operating System :: OS Independent
|
||||||
|
Classifier: Programming Language :: Python
|
||||||
|
Classifier: Programming Language :: Python :: 2
|
||||||
|
Classifier: Programming Language :: Python :: 2.6
|
||||||
|
Classifier: Programming Language :: Python :: 2.7
|
||||||
|
Classifier: Programming Language :: Python :: 3
|
||||||
|
Classifier: Programming Language :: Python :: 3.3
|
||||||
|
Classifier: Programming Language :: Python :: 3.4
|
||||||
|
Classifier: Programming Language :: Python :: 3.5
|
||||||
|
Classifier: Programming Language :: Python :: 3.6
|
||||||
|
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
||||||
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
||||||
|
Provides-Extra: dev
|
||||||
|
Requires-Dist: coverage; extra == 'dev'
|
||||||
|
Requires-Dist: pytest; extra == 'dev'
|
||||||
|
Requires-Dist: sphinx; extra == 'dev'
|
||||||
|
Requires-Dist: tox; extra == 'dev'
|
||||||
|
Provides-Extra: termcolor
|
||||||
|
Requires-Dist: termcolor; extra == 'termcolor'
|
||||||
|
Provides-Extra: watchdog
|
||||||
|
Requires-Dist: watchdog; extra == 'watchdog'
|
||||||
|
|
||||||
|
Werkzeug
|
||||||
|
========
|
||||||
|
|
||||||
|
Werkzeug is a comprehensive `WSGI`_ web application library. It began as
|
||||||
|
a simple collection of various utilities for WSGI applications and has
|
||||||
|
become one of the most advanced WSGI utility libraries.
|
||||||
|
|
||||||
|
It includes:
|
||||||
|
|
||||||
|
* An interactive debugger that allows inspecting stack traces and source
|
||||||
|
code in the browser with an interactive interpreter for any frame in
|
||||||
|
the stack.
|
||||||
|
* A full-featured request object with objects to interact with headers,
|
||||||
|
query args, form data, files, and cookies.
|
||||||
|
* A response object that can wrap other WSGI applications and handle
|
||||||
|
streaming data.
|
||||||
|
* A routing system for matching URLs to endpoints and generating URLs
|
||||||
|
for endpoints, with an extensible system for capturing variables from
|
||||||
|
URLs.
|
||||||
|
* HTTP utilities to handle entity tags, cache control, dates, user
|
||||||
|
agents, cookies, files, and more.
|
||||||
|
* A threaded WSGI server for use while developing applications locally.
|
||||||
|
* A test client for simulating HTTP requests during testing without
|
||||||
|
requiring running a server.
|
||||||
|
|
||||||
|
Werkzeug is Unicode aware and doesn't enforce any dependencies. It is up
|
||||||
|
to the developer to choose a template engine, database adapter, and even
|
||||||
|
how to handle requests. It can be used to build all sorts of end user
|
||||||
|
applications such as blogs, wikis, or bulletin boards.
|
||||||
|
|
||||||
|
`Flask`_ wraps Werkzeug, using it to handle the details of WSGI while
|
||||||
|
providing more structure and patterns for defining powerful
|
||||||
|
applications.
|
||||||
|
|
||||||
|
|
||||||
|
Installing
|
||||||
|
----------
|
||||||
|
|
||||||
|
Install and update using `pip`_:
|
||||||
|
|
||||||
|
.. code-block:: text
|
||||||
|
|
||||||
|
pip install -U Werkzeug
|
||||||
|
|
||||||
|
|
||||||
|
A Simple Example
|
||||||
|
----------------
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
from werkzeug.wrappers import Request, Response
|
||||||
|
|
||||||
|
@Request.application
|
||||||
|
def application(request):
|
||||||
|
return Response('Hello, World!')
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
from werkzeug.serving import run_simple
|
||||||
|
run_simple('localhost', 4000, application)
|
||||||
|
|
||||||
|
|
||||||
|
Links
|
||||||
|
-----
|
||||||
|
|
||||||
|
* Website: https://www.palletsprojects.com/p/werkzeug/
|
||||||
|
* Releases: https://pypi.org/project/Werkzeug/
|
||||||
|
* Code: https://github.com/pallets/werkzeug
|
||||||
|
* Issue tracker: https://github.com/pallets/werkzeug/issues
|
||||||
|
* Test status:
|
||||||
|
|
||||||
|
* Linux, Mac: https://travis-ci.org/pallets/werkzeug
|
||||||
|
* Windows: https://ci.appveyor.com/project/davidism/werkzeug
|
||||||
|
|
||||||
|
* Test coverage: https://codecov.io/gh/pallets/werkzeug
|
||||||
|
|
||||||
|
.. _WSGI: https://wsgi.readthedocs.io/en/latest/
|
||||||
|
.. _Flask: https://www.palletsprojects.com/p/flask/
|
||||||
|
.. _pip: https://pip.pypa.io/en/stable/quickstart/
|
||||||
|
|
||||||
|
|
||||||
@ -0,0 +1,97 @@
|
|||||||
|
Werkzeug-0.14.1.dist-info/DESCRIPTION.rst,sha256=rOCN36jwsWtWsTpqPG96z7FMilB5qI1CIARSKRuUmz8,2452
|
||||||
|
Werkzeug-0.14.1.dist-info/LICENSE.txt,sha256=xndz_dD4m269AF9l_Xbl5V3tM1N3C1LoZC2PEPxWO-8,1534
|
||||||
|
Werkzeug-0.14.1.dist-info/METADATA,sha256=FbfadrPdJNUWAxMOKxGUtHe5R3IDSBKYYmAz3FvI3uY,3872
|
||||||
|
Werkzeug-0.14.1.dist-info/RECORD,,
|
||||||
|
Werkzeug-0.14.1.dist-info/WHEEL,sha256=GrqQvamwgBV4nLoJe0vhYRSWzWsx7xjlt74FT0SWYfE,110
|
||||||
|
Werkzeug-0.14.1.dist-info/metadata.json,sha256=4489UTt6HBp2NQil95-pBkjU4Je93SMHvMxZ_rjOpqA,1452
|
||||||
|
Werkzeug-0.14.1.dist-info/top_level.txt,sha256=QRyj2VjwJoQkrwjwFIOlB8Xg3r9un0NtqVHQF-15xaw,9
|
||||||
|
werkzeug/__init__.py,sha256=NR0d4n_-U9BLVKlOISean3zUt2vBwhvK-AZE6M0sC0k,6842
|
||||||
|
werkzeug/_compat.py,sha256=8c4U9o6A_TR9nKCcTbpZNxpqCXcXDVIbFawwKM2s92c,6311
|
||||||
|
werkzeug/_internal.py,sha256=GhEyGMlsSz_tYjsDWO9TG35VN7304MM8gjKDrXLEdVc,13873
|
||||||
|
werkzeug/_reloader.py,sha256=AyPphcOHPbu6qzW0UbrVvTDJdre5WgpxbhIJN_TqzUc,9264
|
||||||
|
werkzeug/datastructures.py,sha256=3IgNKNqrz-ZjmAG7y3YgEYK-enDiMT_b652PsypWcYg,90080
|
||||||
|
werkzeug/exceptions.py,sha256=3wp95Hqj9FqV8MdikV99JRcHse_fSMn27V8tgP5Hw2c,20505
|
||||||
|
werkzeug/filesystem.py,sha256=hHWeWo_gqLMzTRfYt8-7n2wWcWUNTnDyudQDLOBEICE,2175
|
||||||
|
werkzeug/formparser.py,sha256=mUuCwjzjb8_E4RzrAT2AioLuZSYpqR1KXTK6LScRYzA,21722
|
||||||
|
werkzeug/http.py,sha256=RQg4MJuhRv2isNRiEh__Phh09ebpfT3Kuu_GfrZ54_c,40079
|
||||||
|
werkzeug/local.py,sha256=QdQhWV5L8p1Y1CJ1CDStwxaUs24SuN5aebHwjVD08C8,14553
|
||||||
|
werkzeug/posixemulation.py,sha256=xEF2Bxc-vUCPkiu4IbfWVd3LW7DROYAT-ExW6THqyzw,3519
|
||||||
|
werkzeug/routing.py,sha256=2JVtdSgxKGeANy4Z_FP-dKESvKtkYGCZ1J2fARCLGCY,67214
|
||||||
|
werkzeug/script.py,sha256=DwaVDcXdaOTffdNvlBdLitxWXjKaRVT32VbhDtljFPY,11365
|
||||||
|
werkzeug/security.py,sha256=0m107exslz4QJLWQCpfQJ04z3re4eGHVggRvrQVAdWc,9193
|
||||||
|
werkzeug/serving.py,sha256=A0flnIJHufdn2QJ9oeuHfrXwP3LzP8fn3rNW6hbxKUg,31926
|
||||||
|
werkzeug/test.py,sha256=XmECSmnpASiYQTct4oMiWr0LT5jHWCtKqnpYKZd2ui8,36100
|
||||||
|
werkzeug/testapp.py,sha256=3HQRW1sHZKXuAjCvFMet4KXtQG3loYTFnvn6LWt-4zI,9396
|
||||||
|
werkzeug/urls.py,sha256=dUeLg2IeTm0WLmSvFeD4hBZWGdOs-uHudR5-t8n9zPo,36771
|
||||||
|
werkzeug/useragents.py,sha256=BhYMf4cBTHyN4U0WsQedePIocmNlH_34C-UwqSThGCc,5865
|
||||||
|
werkzeug/utils.py,sha256=BrY1j0DHQ8RTb0K1StIobKuMJhN9SQQkWEARbrh2qpk,22972
|
||||||
|
werkzeug/websocket.py,sha256=PpSeDxXD_0UsPAa5hQhQNM6mxibeUgn8lA8eRqiS0vM,11344
|
||||||
|
werkzeug/wrappers.py,sha256=kbyL_aFjxELwPgMwfNCYjKu-CR6kNkh-oO8wv3GXbk8,84511
|
||||||
|
werkzeug/wsgi.py,sha256=1Nob-aeChWQf7MsiicO8RZt6J90iRzEcik44ev9Qu8s,49347
|
||||||
|
werkzeug/contrib/__init__.py,sha256=f7PfttZhbrImqpr5Ezre8CXgwvcGUJK7zWNpO34WWrw,623
|
||||||
|
werkzeug/contrib/atom.py,sha256=qqfJcfIn2RYY-3hO3Oz0aLq9YuNubcPQ_KZcNsDwVJo,15575
|
||||||
|
werkzeug/contrib/cache.py,sha256=xBImHNj09BmX_7kC5NUCx8f_l4L8_O7zi0jCL21UZKE,32163
|
||||||
|
werkzeug/contrib/fixers.py,sha256=gR06T-w71ur-tHQ_31kP_4jpOncPJ4Wc1dOqTvYusr8,10179
|
||||||
|
werkzeug/contrib/iterio.py,sha256=RlqDvGhz0RneTpzE8dVc-yWCUv4nkPl1jEc_EDp2fH0,10814
|
||||||
|
werkzeug/contrib/jsrouting.py,sha256=QTmgeDoKXvNK02KzXgx9lr3cAH6fAzpwF5bBdPNvJPs,8564
|
||||||
|
werkzeug/contrib/limiter.py,sha256=iS8-ahPZ-JLRnmfIBzxpm7O_s3lPsiDMVWv7llAIDCI,1334
|
||||||
|
werkzeug/contrib/lint.py,sha256=Mj9NeUN7s4zIUWeQOAVjrmtZIcl3Mm2yDe9BSIr9YGE,12558
|
||||||
|
werkzeug/contrib/profiler.py,sha256=ISwCWvwVyGpDLRBRpLjo_qUWma6GXYBrTAco4PEQSHY,5151
|
||||||
|
werkzeug/contrib/securecookie.py,sha256=uWMyHDHY3lkeBRiCSayGqWkAIy4a7xAbSE_Hln9ecqc,12196
|
||||||
|
werkzeug/contrib/sessions.py,sha256=39LVNvLbm5JWpbxM79WC2l87MJFbqeISARjwYbkJatw,12577
|
||||||
|
werkzeug/contrib/testtools.py,sha256=G9xN-qeihJlhExrIZMCahvQOIDxdL9NiX874jiiHFMs,2453
|
||||||
|
werkzeug/contrib/wrappers.py,sha256=v7OYlz7wQtDlS9fey75UiRZ1IkUWqCpzbhsLy4k14Hw,10398
|
||||||
|
werkzeug/debug/__init__.py,sha256=uSn9BqCZ5E3ySgpoZtundpROGsn-uYvZtSFiTfAX24M,17452
|
||||||
|
werkzeug/debug/console.py,sha256=n3-dsKk1TsjnN-u4ZgmuWCU_HO0qw5IA7ttjhyyMM6I,5607
|
||||||
|
werkzeug/debug/repr.py,sha256=bKqstDYGfECpeLerd48s_hxuqK4b6UWnjMu3d_DHO8I,9340
|
||||||
|
werkzeug/debug/tbtools.py,sha256=rBudXCmkVdAKIcdhxANxgf09g6kQjJWW9_5bjSpr4OY,18451
|
||||||
|
werkzeug/debug/shared/FONT_LICENSE,sha256=LwAVEI1oYnvXiNMT9SnCH_TaLCxCpeHziDrMg0gPkAI,4673
|
||||||
|
werkzeug/debug/shared/console.png,sha256=bxax6RXXlvOij_KeqvSNX0ojJf83YbnZ7my-3Gx9w2A,507
|
||||||
|
werkzeug/debug/shared/debugger.js,sha256=PKPVYuyO4SX1hkqLOwCLvmIEO5154WatFYaXE-zIfKI,6264
|
||||||
|
werkzeug/debug/shared/jquery.js,sha256=7LkWEzqTdpEfELxcZZlS6wAx5Ff13zZ83lYO2_ujj7g,95957
|
||||||
|
werkzeug/debug/shared/less.png,sha256=-4-kNRaXJSONVLahrQKUxMwXGm9R4OnZ9SxDGpHlIR4,191
|
||||||
|
werkzeug/debug/shared/more.png,sha256=GngN7CioHQoV58rH6ojnkYi8c_qED2Aka5FO5UXrReY,200
|
||||||
|
werkzeug/debug/shared/source.png,sha256=RoGcBTE4CyCB85GBuDGTFlAnUqxwTBiIfDqW15EpnUQ,818
|
||||||
|
werkzeug/debug/shared/style.css,sha256=IEO0PC2pWmh2aEyGCaN--txuWsRCliuhlbEhPDFwh0A,6270
|
||||||
|
werkzeug/debug/shared/ubuntu.ttf,sha256=1eaHFyepmy4FyDvjLVzpITrGEBu_CZYY94jE0nED1c0,70220
|
||||||
|
Werkzeug-0.14.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
||||||
|
werkzeug/contrib/__pycache__/atom.cpython-36.pyc,,
|
||||||
|
werkzeug/contrib/__pycache__/cache.cpython-36.pyc,,
|
||||||
|
werkzeug/contrib/__pycache__/fixers.cpython-36.pyc,,
|
||||||
|
werkzeug/contrib/__pycache__/iterio.cpython-36.pyc,,
|
||||||
|
werkzeug/contrib/__pycache__/jsrouting.cpython-36.pyc,,
|
||||||
|
werkzeug/contrib/__pycache__/limiter.cpython-36.pyc,,
|
||||||
|
werkzeug/contrib/__pycache__/lint.cpython-36.pyc,,
|
||||||
|
werkzeug/contrib/__pycache__/profiler.cpython-36.pyc,,
|
||||||
|
werkzeug/contrib/__pycache__/securecookie.cpython-36.pyc,,
|
||||||
|
werkzeug/contrib/__pycache__/sessions.cpython-36.pyc,,
|
||||||
|
werkzeug/contrib/__pycache__/testtools.cpython-36.pyc,,
|
||||||
|
werkzeug/contrib/__pycache__/wrappers.cpython-36.pyc,,
|
||||||
|
werkzeug/contrib/__pycache__/__init__.cpython-36.pyc,,
|
||||||
|
werkzeug/debug/__pycache__/console.cpython-36.pyc,,
|
||||||
|
werkzeug/debug/__pycache__/repr.cpython-36.pyc,,
|
||||||
|
werkzeug/debug/__pycache__/tbtools.cpython-36.pyc,,
|
||||||
|
werkzeug/debug/__pycache__/__init__.cpython-36.pyc,,
|
||||||
|
werkzeug/__pycache__/datastructures.cpython-36.pyc,,
|
||||||
|
werkzeug/__pycache__/exceptions.cpython-36.pyc,,
|
||||||
|
werkzeug/__pycache__/filesystem.cpython-36.pyc,,
|
||||||
|
werkzeug/__pycache__/formparser.cpython-36.pyc,,
|
||||||
|
werkzeug/__pycache__/http.cpython-36.pyc,,
|
||||||
|
werkzeug/__pycache__/local.cpython-36.pyc,,
|
||||||
|
werkzeug/__pycache__/posixemulation.cpython-36.pyc,,
|
||||||
|
werkzeug/__pycache__/routing.cpython-36.pyc,,
|
||||||
|
werkzeug/__pycache__/script.cpython-36.pyc,,
|
||||||
|
werkzeug/__pycache__/security.cpython-36.pyc,,
|
||||||
|
werkzeug/__pycache__/serving.cpython-36.pyc,,
|
||||||
|
werkzeug/__pycache__/test.cpython-36.pyc,,
|
||||||
|
werkzeug/__pycache__/testapp.cpython-36.pyc,,
|
||||||
|
werkzeug/__pycache__/urls.cpython-36.pyc,,
|
||||||
|
werkzeug/__pycache__/useragents.cpython-36.pyc,,
|
||||||
|
werkzeug/__pycache__/utils.cpython-36.pyc,,
|
||||||
|
werkzeug/__pycache__/websocket.cpython-36.pyc,,
|
||||||
|
werkzeug/__pycache__/wrappers.cpython-36.pyc,,
|
||||||
|
werkzeug/__pycache__/wsgi.cpython-36.pyc,,
|
||||||
|
werkzeug/__pycache__/_compat.cpython-36.pyc,,
|
||||||
|
werkzeug/__pycache__/_internal.cpython-36.pyc,,
|
||||||
|
werkzeug/__pycache__/_reloader.cpython-36.pyc,,
|
||||||
|
werkzeug/__pycache__/__init__.cpython-36.pyc,,
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
Wheel-Version: 1.0
|
||||||
|
Generator: bdist_wheel (0.26.0)
|
||||||
|
Root-Is-Purelib: true
|
||||||
|
Tag: py2-none-any
|
||||||
|
Tag: py3-none-any
|
||||||
|
|
||||||
@ -0,0 +1 @@
|
|||||||
|
{"generator": "bdist_wheel (0.26.0)", "summary": "The comprehensive WSGI web application library.", "classifiers": ["Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "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 :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules"], "description_content_type": "UNKNOWN", "extensions": {"python.details": {"project_urls": {"Home": "https://www.palletsprojects.org/p/werkzeug/"}, "contacts": [{"email": "armin.ronacher@active-4.com", "name": "Armin Ronacher", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst", "license": "LICENSE.txt"}}}, "license": "BSD", "metadata_version": "2.0", "name": "Werkzeug", "platform": "any", "extras": ["dev", "termcolor", "watchdog"], "run_requires": [{"requires": ["coverage", "pytest", "sphinx", "tox"], "extra": "dev"}, {"requires": ["termcolor"], "extra": "termcolor"}, {"requires": ["watchdog"], "extra": "watchdog"}], "version": "0.14.1"}
|
||||||
@ -0,0 +1 @@
|
|||||||
|
werkzeug
|
||||||
BIN
website/web/Lib/site-packages/_cffi_backend.cp36-win_amd64.pyd
Normal file
BIN
website/web/Lib/site-packages/_cffi_backend.cp36-win_amd64.pyd
Normal file
Binary file not shown.
@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
CFFI
|
||||||
|
====
|
||||||
|
|
||||||
|
Foreign Function Interface for Python calling C code.
|
||||||
|
Please see the `Documentation <http://cffi.readthedocs.org/>`_.
|
||||||
|
|
||||||
|
Contact
|
||||||
|
-------
|
||||||
|
|
||||||
|
`Mailing list <https://groups.google.com/forum/#!forum/python-cffi>`_
|
||||||
|
|
||||||
|
|
||||||
@ -0,0 +1 @@
|
|||||||
|
pip
|
||||||
37
website/web/Lib/site-packages/cffi-1.11.4.dist-info/METADATA
Normal file
37
website/web/Lib/site-packages/cffi-1.11.4.dist-info/METADATA
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
Metadata-Version: 2.0
|
||||||
|
Name: cffi
|
||||||
|
Version: 1.11.4
|
||||||
|
Summary: Foreign Function Interface for Python calling C code.
|
||||||
|
Home-page: http://cffi.readthedocs.org
|
||||||
|
Author: Armin Rigo, Maciej Fijalkowski
|
||||||
|
Author-email: python-cffi@googlegroups.com
|
||||||
|
License: MIT
|
||||||
|
Description-Content-Type: UNKNOWN
|
||||||
|
Platform: UNKNOWN
|
||||||
|
Classifier: Programming Language :: Python
|
||||||
|
Classifier: Programming Language :: Python :: 2
|
||||||
|
Classifier: Programming Language :: Python :: 2.6
|
||||||
|
Classifier: Programming Language :: Python :: 2.7
|
||||||
|
Classifier: Programming Language :: Python :: 3
|
||||||
|
Classifier: Programming Language :: Python :: 3.2
|
||||||
|
Classifier: Programming Language :: Python :: 3.3
|
||||||
|
Classifier: Programming Language :: Python :: 3.4
|
||||||
|
Classifier: Programming Language :: Python :: 3.5
|
||||||
|
Classifier: Programming Language :: Python :: 3.6
|
||||||
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
||||||
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
||||||
|
Requires-Dist: pycparser
|
||||||
|
|
||||||
|
|
||||||
|
CFFI
|
||||||
|
====
|
||||||
|
|
||||||
|
Foreign Function Interface for Python calling C code.
|
||||||
|
Please see the `Documentation <http://cffi.readthedocs.org/>`_.
|
||||||
|
|
||||||
|
Contact
|
||||||
|
-------
|
||||||
|
|
||||||
|
`Mailing list <https://groups.google.com/forum/#!forum/python-cffi>`_
|
||||||
|
|
||||||
|
|
||||||
43
website/web/Lib/site-packages/cffi-1.11.4.dist-info/RECORD
Normal file
43
website/web/Lib/site-packages/cffi-1.11.4.dist-info/RECORD
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
_cffi_backend.cp36-win_amd64.pyd,sha256=likuFoX9C7Qi1bfHpJJHzKgOXmWFdXIN1IbPCbmO7bc,170496
|
||||||
|
cffi/__init__.py,sha256=mewOsqyqnxYpvL3XfQFIRYyxcoW2ic60hMResP7gdJM,479
|
||||||
|
cffi/_cffi_errors.h,sha256=NLNuKgpRUJ4x0ku4pi-Pe1vT1mzovxBTeHjPZTxCB7U,3804
|
||||||
|
cffi/_cffi_include.h,sha256=JuFfmwpRE65vym3Nxr9vDMOIEuv21tXdarkL1l2WNms,12149
|
||||||
|
cffi/_embedding.h,sha256=iSs9APxG4SDy_ahlyV1s46_lvWdVBxnuOwaEBN5jOUg,17643
|
||||||
|
cffi/api.py,sha256=eUXlc8fTxiS3PjpfBU3sMi8gVgeG4yIsPA6teyNWehI,40221
|
||||||
|
cffi/backend_ctypes.py,sha256=XxMfz3Kn_QZhvLLqNXmIL_Z9M8CGlGAa1YWtH6k8wYQ,42086
|
||||||
|
cffi/cffi_opcode.py,sha256=v9RdD_ovA8rCtqsC95Ivki5V667rAOhGgs3fb2q9xpM,5724
|
||||||
|
cffi/commontypes.py,sha256=QS4uxCDI7JhtTyjh1hlnCA-gynmaszWxJaRRLGkJa1A,2689
|
||||||
|
cffi/cparser.py,sha256=R0_gdB8vL1YNf-W5G_5KvV1pOTnZwvuLeioaDvODI6c,39250
|
||||||
|
cffi/error.py,sha256=L_J76qbh6LSxH4A64muOUwJKL6zVHC32E3gG1ntUM-A,666
|
||||||
|
cffi/ffiplatform.py,sha256=HMXqR8ks2wtdsNxGaWpQ_PyqIvtiuos_vf1qKCy-cwg,4046
|
||||||
|
cffi/lock.py,sha256=l9TTdwMIMpi6jDkJGnQgE9cvTIR7CAntIJr8EGHt3pY,747
|
||||||
|
cffi/model.py,sha256=-ZXCFO_EPbX3zN3ecx4H2rR0MZZA16ZwldDuv3CzJXU,21495
|
||||||
|
cffi/parse_c_type.h,sha256=OdwQfwM9ktq6vlCB43exFQmxDBtj2MBNdK8LYl15tjw,5976
|
||||||
|
cffi/recompiler.py,sha256=4qpl0bOTaegsWJbaCvjtRh4q6KH5hWZurnKK1YGEeRk,63092
|
||||||
|
cffi/setuptools_ext.py,sha256=6K2HJn-qNTQL-FvILZCH0T90MR6FVelFClL4f8ZCWaQ,7682
|
||||||
|
cffi/vengine_cpy.py,sha256=hdyjjZNijLrg_uGMnnFyC-7GG_LxWtwB8BlS2vvVDQ0,41470
|
||||||
|
cffi/vengine_gen.py,sha256=Zkq0-EdeZwn6qUvf_CI8iUEs2UxVIvDmKCH1j0-y0GI,26676
|
||||||
|
cffi/verifier.py,sha256=J9Enz2rbJb9CHPqWlWQ5uQESoyr0uc7MNWugchjXBv4,11207
|
||||||
|
cffi-1.11.4.dist-info/DESCRIPTION.rst,sha256=9ijQLbcqTWNF-iV0RznFiBeBCNrjArA0P-eutKUPw98,220
|
||||||
|
cffi-1.11.4.dist-info/METADATA,sha256=uiGWsWy8zEb_-R4-vMutpELIrBKsvCV-_soHfZNjUaw,1174
|
||||||
|
cffi-1.11.4.dist-info/RECORD,,
|
||||||
|
cffi-1.11.4.dist-info/WHEEL,sha256=3o6dJ54ci-MtRFdJCPkLCK5G-vO7QSv3lIQ-NrhglGk,106
|
||||||
|
cffi-1.11.4.dist-info/entry_points.txt,sha256=Q9f5C9IpjYxo0d2PK9eUcnkgxHc9pHWwjEMaANPKNCI,76
|
||||||
|
cffi-1.11.4.dist-info/metadata.json,sha256=8S4WNSCRPXo6P__ARsF2aUGV0Drrh82dQQxr9Xsj9vw,1192
|
||||||
|
cffi-1.11.4.dist-info/top_level.txt,sha256=rE7WR3rZfNKxWI9-jn6hsHCAl7MDkB-FmuQbxWjFehQ,19
|
||||||
|
cffi-1.11.4.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
||||||
|
cffi/__pycache__/api.cpython-36.pyc,,
|
||||||
|
cffi/__pycache__/backend_ctypes.cpython-36.pyc,,
|
||||||
|
cffi/__pycache__/cffi_opcode.cpython-36.pyc,,
|
||||||
|
cffi/__pycache__/commontypes.cpython-36.pyc,,
|
||||||
|
cffi/__pycache__/cparser.cpython-36.pyc,,
|
||||||
|
cffi/__pycache__/error.cpython-36.pyc,,
|
||||||
|
cffi/__pycache__/ffiplatform.cpython-36.pyc,,
|
||||||
|
cffi/__pycache__/lock.cpython-36.pyc,,
|
||||||
|
cffi/__pycache__/model.cpython-36.pyc,,
|
||||||
|
cffi/__pycache__/recompiler.cpython-36.pyc,,
|
||||||
|
cffi/__pycache__/setuptools_ext.cpython-36.pyc,,
|
||||||
|
cffi/__pycache__/vengine_cpy.cpython-36.pyc,,
|
||||||
|
cffi/__pycache__/vengine_gen.cpython-36.pyc,,
|
||||||
|
cffi/__pycache__/verifier.cpython-36.pyc,,
|
||||||
|
cffi/__pycache__/__init__.cpython-36.pyc,,
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
Wheel-Version: 1.0
|
||||||
|
Generator: bdist_wheel (0.30.0)
|
||||||
|
Root-Is-Purelib: false
|
||||||
|
Tag: cp36-cp36m-win_amd64
|
||||||
|
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
[distutils.setup_keywords]
|
||||||
|
cffi_modules = cffi.setuptools_ext:cffi_modules
|
||||||
|
|
||||||
@ -0,0 +1 @@
|
|||||||
|
{"classifiers": ["Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy"], "description_content_type": "UNKNOWN", "extensions": {"python.details": {"contacts": [{"email": "python-cffi@googlegroups.com", "name": "Armin Rigo, Maciej Fijalkowski", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}, "project_urls": {"Home": "http://cffi.readthedocs.org"}}, "python.exports": {"distutils.setup_keywords": {"cffi_modules": "cffi.setuptools_ext:cffi_modules"}}}, "extras": [], "generator": "bdist_wheel (0.30.0)", "license": "MIT", "metadata_version": "2.0", "name": "cffi", "run_requires": [{"requires": ["pycparser"]}], "summary": "Foreign Function Interface for Python calling C code.", "version": "1.11.4"}
|
||||||
@ -0,0 +1,2 @@
|
|||||||
|
_cffi_backend
|
||||||
|
cffi
|
||||||
13
website/web/Lib/site-packages/cffi/__init__.py
Normal file
13
website/web/Lib/site-packages/cffi/__init__.py
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
__all__ = ['FFI', 'VerificationError', 'VerificationMissing', 'CDefError',
|
||||||
|
'FFIError']
|
||||||
|
|
||||||
|
from .api import FFI
|
||||||
|
from .error import CDefError, FFIError, VerificationError, VerificationMissing
|
||||||
|
|
||||||
|
__version__ = "1.11.4"
|
||||||
|
__version_info__ = (1, 11, 4)
|
||||||
|
|
||||||
|
# The verifier module file names are based on the CRC32 of a string that
|
||||||
|
# contains the following version number. It may be older than __version__
|
||||||
|
# if nothing is clearly incompatible.
|
||||||
|
__version_verifier_modules__ = "0.8.6"
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user