-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:TeskaLabs/asab into docs/mkdocs-m…
…igration
- Loading branch information
Showing
2 changed files
with
73 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env python3 | ||
import asab | ||
import logging | ||
|
||
# | ||
|
||
L = logging.getLogger(__name__) | ||
|
||
# | ||
|
||
asab.Config.read_string( | ||
""" | ||
[places] | ||
visited: | ||
Praha | ||
Brno | ||
Pardubice Plzeň | ||
""" | ||
) | ||
|
||
|
||
class MyApplication(asab.Application): | ||
|
||
async def main(self): | ||
visited = asab.Config.getmultiline("places", "visited") | ||
unvisited = asab.Config.getmultiline("places", "unvisited", fallback=[]) | ||
nonexisting = asab.Config.getmultiline("places", "nonexisting", fallback=["Gottwaldov"]) | ||
L.log(asab.LOG_NOTICE, "Places I've already visited: {}".format(visited)) | ||
L.log(asab.LOG_NOTICE, "Places I want to visit: {}".format(unvisited)) | ||
L.log(asab.LOG_NOTICE, "Places that don't exist: {}".format(nonexisting)) | ||
self.stop() | ||
|
||
|
||
if __name__ == "__main__": | ||
app = MyApplication() | ||
app.run() |