Add import demo source

This commit is contained in:
Tim Van Baak 2020-08-06 14:43:55 -07:00
parent d72c0326fb
commit a9e313225f
2 changed files with 26 additions and 0 deletions

20
sources/importdemo.py Normal file
View File

@ -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__}"',
}]

View File

@ -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__}'