diff --git a/README.md b/README.md index 619ced27..01241cac 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,10 @@ Python catalogs of objects providers. Example: ```python +""" +Concept example of objects catalogs. +""" + import objects import sqlite3 @@ -27,15 +31,15 @@ class Catalog(objects.Catalog): Objects catalog. """ - database = objects.Singleton(sqlite3.Connection, + database = objects.Singleton(provides=sqlite3.Connection, database='example.db') """ :type: (objects.Provider) -> sqlite3.Connection """ - object_a = objects.NewInstance(A, + object_a = objects.NewInstance(provides=A, db=database) """ :type: (objects.Provider) -> A """ - object_b = objects.NewInstance(B, + object_b = objects.NewInstance(provides=B, a=object_a, db=database) """ :type: (objects.Provider) -> B """ diff --git a/examples/concept.py b/examples/concept.py index 5b16c5da..0bfadb7c 100644 --- a/examples/concept.py +++ b/examples/concept.py @@ -22,15 +22,15 @@ class Catalog(objects.Catalog): Objects catalog. """ - database = objects.Singleton(sqlite3.Connection, + database = objects.Singleton(provides=sqlite3.Connection, database='example.db') """ :type: (objects.Provider) -> sqlite3.Connection """ - object_a = objects.NewInstance(A, + object_a = objects.NewInstance(provides=A, db=database) """ :type: (objects.Provider) -> A """ - object_b = objects.NewInstance(B, + object_b = objects.NewInstance(provides=B, a=object_a, db=database) """ :type: (objects.Provider) -> B """