Skip to content

Commit 98a61be

Browse files
committed
iniital commit
0 parents  commit 98a61be

File tree

1,307 files changed

+203849
-0
lines changed

Some content is hidden

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

1,307 files changed

+203849
-0
lines changed

.flaskenv

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FLASK_APP=microblog.py

__pycache__/microblog.cpython-36.pyc

134 Bytes
Binary file not shown.

app/__init__.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from flask import Flask
2+
from config import Config
3+
4+
app = Flask(__name__)
5+
app.config.from_object(Config)
6+
7+
from app import routes
200 Bytes
Binary file not shown.

app/__pycache__/routes.cpython-36.pyc

535 Bytes
Binary file not shown.

app/forms.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from flask_wtf import FlaskForm
2+
from wtforms import StringField, PasswordField, BooleanField, SubmitField
3+
from wtforms.validators import DataRequired
4+
5+
class LoginForm(FlaskForm):
6+
username = StringField('Username', validators=[DataRequired()])
7+
password = PasswordField('Password', validators=[DataRequired()])
8+
remember_me = BooleanField('Remember Me')
9+
submit = SubmitField('Sign In')

app/routes.py

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from flask import render_template
2+
from app import app
3+
4+
@app.route('/')
5+
@app.route('/index')
6+
def index():
7+
user = {'username': 'Dwarkanath'}
8+
posts = [
9+
{
10+
'author': {'username': 'John'},
11+
'body': 'Beautiful day in Portland!'
12+
},
13+
{
14+
'author': {'username': 'Susan'},
15+
'body': 'The Avengers movie was so cool!'
16+
}
17+
]
18+
return render_template('index.html', title='Home', user=user, posts = posts)

app/templates/base.html

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<html>
2+
<head>
3+
{% if title %}
4+
<title>{{ title }} - Microblog</title>
5+
{% else %}
6+
<title>Welcome to Microblog</title>
7+
{% endif %}
8+
</head>
9+
<body>
10+
<div>Microblog: <a href="/index">Home</a></div>
11+
<hr>
12+
{% block content %}{% endblock %}
13+
</body>
14+
</html>

app/templates/index.html

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
{% extends "base.html" %}
3+
4+
{% block content %}
5+
<h1>Hello, {{ user.username }}!</h1>
6+
{% for post in posts %}
7+
<div><p>{{ post.author.username }} says: <b>{{ post.body }}</b></p></div>
8+
{% endfor %}
9+
10+
{% endblock %}

config.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import os
2+
3+
class Config(object):
4+
SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess'

microblog.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from app import app
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pip
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
Copyright © 2014 by the Pallets team.
2+
3+
Some rights reserved.
4+
5+
Redistribution and use in source and binary forms of the software as
6+
well as documentation, with or without modification, are permitted
7+
provided that the following conditions are met:
8+
9+
- Redistributions of source code must retain the above copyright
10+
notice, this list of conditions and the following disclaimer.
11+
12+
- Redistributions in binary form must reproduce the above copyright
13+
notice, this list of conditions and the following disclaimer in the
14+
documentation and/or other materials provided with the distribution.
15+
16+
- Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21+
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
22+
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
23+
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24+
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25+
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26+
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
27+
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
28+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30+
THIS SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF
31+
SUCH DAMAGE.
32+
33+
----
34+
35+
Click uses parts of optparse written by Gregory P. Ward and maintained
36+
by the Python Software Foundation. This is limited to code in parser.py.
37+
38+
Copyright © 2001-2006 Gregory P. Ward. All rights reserved.
39+
Copyright © 2002-2006 Python Software Foundation. All rights reserved.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
Metadata-Version: 2.1
2+
Name: Click
3+
Version: 7.0
4+
Summary: Composable command line interface toolkit
5+
Home-page: https://palletsprojects.com/p/click/
6+
Author: Armin Ronacher
7+
Author-email: [email protected]
8+
Maintainer: Pallets Team
9+
Maintainer-email: [email protected]
10+
License: BSD
11+
Project-URL: Documentation, https://click.palletsprojects.com/
12+
Project-URL: Code, https://github.com/pallets/click
13+
Project-URL: Issue tracker, https://github.com/pallets/click/issues
14+
Platform: UNKNOWN
15+
Classifier: Development Status :: 5 - Production/Stable
16+
Classifier: Intended Audience :: Developers
17+
Classifier: License :: OSI Approved :: BSD License
18+
Classifier: Operating System :: OS Independent
19+
Classifier: Programming Language :: Python
20+
Classifier: Programming Language :: Python :: 2
21+
Classifier: Programming Language :: Python :: 2.7
22+
Classifier: Programming Language :: Python :: 3
23+
Classifier: Programming Language :: Python :: 3.4
24+
Classifier: Programming Language :: Python :: 3.5
25+
Classifier: Programming Language :: Python :: 3.6
26+
Classifier: Programming Language :: Python :: 3.7
27+
Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
28+
29+
\$ click\_
30+
==========
31+
32+
Click is a Python package for creating beautiful command line interfaces
33+
in a composable way with as little code as necessary. It's the "Command
34+
Line Interface Creation Kit". It's highly configurable but comes with
35+
sensible defaults out of the box.
36+
37+
It aims to make the process of writing command line tools quick and fun
38+
while also preventing any frustration caused by the inability to
39+
implement an intended CLI API.
40+
41+
Click in three points:
42+
43+
- Arbitrary nesting of commands
44+
- Automatic help page generation
45+
- Supports lazy loading of subcommands at runtime
46+
47+
48+
Installing
49+
----------
50+
51+
Install and update using `pip`_:
52+
53+
.. code-block:: text
54+
55+
$ pip install click
56+
57+
Click supports Python 3.4 and newer, Python 2.7, and PyPy.
58+
59+
.. _pip: https://pip.pypa.io/en/stable/quickstart/
60+
61+
62+
A Simple Example
63+
----------------
64+
65+
What does it look like? Here is an example of a simple Click program:
66+
67+
.. code-block:: python
68+
69+
import click
70+
71+
@click.command()
72+
@click.option("--count", default=1, help="Number of greetings.")
73+
@click.option("--name", prompt="Your name",
74+
help="The person to greet.")
75+
def hello(count, name):
76+
"""Simple program that greets NAME for a total of COUNT times."""
77+
for _ in range(count):
78+
click.echo("Hello, %s!" % name)
79+
80+
if __name__ == '__main__':
81+
hello()
82+
83+
And what it looks like when run:
84+
85+
.. code-block:: text
86+
87+
$ python hello.py --count=3
88+
Your name: Click
89+
Hello, Click!
90+
Hello, Click!
91+
Hello, Click!
92+
93+
94+
Donate
95+
------
96+
97+
The Pallets organization develops and supports Click and other popular
98+
packages. In order to grow the community of contributors and users, and
99+
allow the maintainers to devote more time to the projects, `please
100+
donate today`_.
101+
102+
.. _please donate today: https://palletsprojects.com/donate
103+
104+
105+
Links
106+
-----
107+
108+
* Website: https://palletsprojects.com/p/click/
109+
* Documentation: https://click.palletsprojects.com/
110+
* License: `BSD <https://github.com/pallets/click/blob/master/LICENSE.rst>`_
111+
* Releases: https://pypi.org/project/click/
112+
* Code: https://github.com/pallets/click
113+
* Issue tracker: https://github.com/pallets/click/issues
114+
* Test status:
115+
116+
* Linux, Mac: https://travis-ci.org/pallets/click
117+
* Windows: https://ci.appveyor.com/project/pallets/click
118+
119+
* Test coverage: https://codecov.io/gh/pallets/click
120+
121+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
Click-7.0.dist-info/LICENSE.txt,sha256=4hIxn676T0Wcisk3_chVcECjyrivKTZsoqSNI5AlIlw,1876
2+
Click-7.0.dist-info/METADATA,sha256=-r8jeke3Zer4diRvT1MjFZuiJ6yTT_qFP39svLqdaLI,3516
3+
Click-7.0.dist-info/RECORD,,
4+
Click-7.0.dist-info/WHEEL,sha256=gduuPyBvFJQSQ0zdyxF7k0zynDXbIbvg5ZBHoXum5uk,110
5+
Click-7.0.dist-info/top_level.txt,sha256=J1ZQogalYS4pphY_lPECoNMfw0HzTSrZglC4Yfwo4xA,6
6+
click/__init__.py,sha256=HjGThQ7tef9kkwCV371TBnrf0SAi6fKfU_jtEnbYTvQ,2789
7+
click/_bashcomplete.py,sha256=iaNUmtxag0YPfxba3TDYCNietiTMQIrvhRLj-H8okFU,11014
8+
click/_compat.py,sha256=vYmvoj4opPxo-c-2GMQQjYT_r_QkOKybkfGoeVrt0dA,23399
9+
click/_termui_impl.py,sha256=xHmLtOJhKUCVD6168yucJ9fknUJPAMs0eUTPgVUO-GQ,19611
10+
click/_textwrap.py,sha256=gwS4m7bdQiJnzaDG8osFcRb-5vn4t4l2qSCy-5csCEc,1198
11+
click/_unicodefun.py,sha256=QHy2_5jYlX-36O-JVrTHNnHOqg8tquUR0HmQFev7Ics,4364
12+
click/_winconsole.py,sha256=PPWVak8Iikm_gAPsxMrzwsVFCvHgaW3jPaDWZ1JBl3U,8965
13+
click/core.py,sha256=q8FLcDZsagBGSRe5Y9Hi_FGvAeZvusNfoO5EkhkSQ8Y,75305
14+
click/decorators.py,sha256=idKt6duLUUfAFftrHoREi8MJSd39XW36pUVHthdglwk,11226
15+
click/exceptions.py,sha256=CNpAjBAE7qjaV4WChxQeak95e5yUOau8AsvT-8m6wss,7663
16+
click/formatting.py,sha256=eh-cypTUAhpI3HD-K4ZpR3vCiURIO62xXvKkR3tNUTM,8889
17+
click/globals.py,sha256=oQkou3ZQ5DgrbVM6BwIBirwiqozbjfirzsLGAlLRRdg,1514
18+
click/parser.py,sha256=m-nGZz4VwprM42_qtFlWFGo7yRJQxkBlRcZodoH593Y,15510
19+
click/termui.py,sha256=o_ZXB2jyvL2Rce7P_bFGq452iyBq9ykJyRApIPMCZO0,23207
20+
click/testing.py,sha256=aYGqY_iWLu2p4k7lkuJ6t3fqpf6aPGqTsyLzNY_ngKg,13062
21+
click/types.py,sha256=2Q929p-aBP_ZYuMFJqJR-Ipucofv3fmDc5JzBDPmzJU,23287
22+
click/utils.py,sha256=6-D0WkAxvv9FkgHXSHwDIv0l9Gdx9Mm6Z5vuKNLIfZI,15763
23+
Click-7.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
24+
click/__pycache__/core.cpython-36.pyc,,
25+
click/__pycache__/decorators.cpython-36.pyc,,
26+
click/__pycache__/exceptions.cpython-36.pyc,,
27+
click/__pycache__/formatting.cpython-36.pyc,,
28+
click/__pycache__/globals.cpython-36.pyc,,
29+
click/__pycache__/parser.cpython-36.pyc,,
30+
click/__pycache__/termui.cpython-36.pyc,,
31+
click/__pycache__/testing.cpython-36.pyc,,
32+
click/__pycache__/types.cpython-36.pyc,,
33+
click/__pycache__/utils.cpython-36.pyc,,
34+
click/__pycache__/_bashcomplete.cpython-36.pyc,,
35+
click/__pycache__/_compat.cpython-36.pyc,,
36+
click/__pycache__/_termui_impl.cpython-36.pyc,,
37+
click/__pycache__/_textwrap.cpython-36.pyc,,
38+
click/__pycache__/_unicodefun.cpython-36.pyc,,
39+
click/__pycache__/_winconsole.cpython-36.pyc,,
40+
click/__pycache__/__init__.cpython-36.pyc,,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Wheel-Version: 1.0
2+
Generator: bdist_wheel (0.31.1)
3+
Root-Is-Purelib: true
4+
Tag: py2-none-any
5+
Tag: py3-none-any
6+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
click
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pip
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Copyright © 2010 by the Pallets team.
2+
3+
Some rights reserved.
4+
5+
Redistribution and use in source and binary forms of the software as
6+
well as documentation, with or without modification, are permitted
7+
provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice,
10+
this list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright
13+
notice, this list of conditions and the following disclaimer in the
14+
documentation and/or other materials provided with the distribution.
15+
16+
* Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21+
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
22+
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
23+
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24+
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25+
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26+
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
27+
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
28+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30+
THIS SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF
31+
SUCH DAMAGE.

0 commit comments

Comments
 (0)