Add import demo source
This commit is contained in:
parent
d72c0326fb
commit
a9e313225f
|
@ -0,0 +1,20 @@
|
||||||
|
"""
|
||||||
|
Demonstrates the behavior of imports in sources.
|
||||||
|
"""
|
||||||
|
# Standard library imports
|
||||||
|
from datetime import datetime
|
||||||
|
import random
|
||||||
|
|
||||||
|
# Environment import
|
||||||
|
import flask
|
||||||
|
|
||||||
|
# Local import
|
||||||
|
from importdemohelper import secret
|
||||||
|
|
||||||
|
def fetch_new(state):
|
||||||
|
return [{
|
||||||
|
'source': 'importdemo',
|
||||||
|
'id': '{:x}'.format(random.getrandbits(16 * 4)),
|
||||||
|
'title': f'The secret is "{secret}"',
|
||||||
|
'body': f'And flask\'s name is "{flask.__name__}"',
|
||||||
|
}]
|
|
@ -0,0 +1,6 @@
|
||||||
|
"""
|
||||||
|
Demonstrates the behavior of imports in sources.
|
||||||
|
This python file is not a source and will not
|
||||||
|
"""
|
||||||
|
|
||||||
|
secret = f'This string is from {__file__}'
|
Loading…
Reference in New Issue