foo, bar, baz rename
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
print(f' Importing {__name__} '.center(50, '='))
|
||||
|
||||
from .motion import Motion
|
||||
from .my_sub_pkg.hello import HelloWorldSub
|
||||
from .foo import Foo
|
||||
from .my_sub_pkg.bar import Bar
|
||||
|
||||
print(' Done '.center(50, '='))
|
||||
18
apps/my_repo/my_pkg/foo.py
Normal file
18
apps/my_repo/my_pkg/foo.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from pathlib import Path
|
||||
|
||||
from appdaemon.adbase import ADBase
|
||||
|
||||
filename = Path(__file__).name
|
||||
print(f' Importing {filename} '.center(50, '-'))
|
||||
|
||||
class Foo(ADBase):
|
||||
changes: bool = False
|
||||
|
||||
def initialize(self):
|
||||
self.adapi = self.get_ad_api()
|
||||
|
||||
self.adapi.log(f'Initialized app from {filename} new line changes: {self.changes}')
|
||||
# self.adapi.log(f'New log line: {self.changes}')
|
||||
# self.adapi.log(f'Even newer log line: {self.changes}')
|
||||
|
||||
print(f'Done, motion.changes = {Foo.changes}'.center(50, '-'))
|
||||
@@ -1,14 +0,0 @@
|
||||
from pathlib import Path
|
||||
|
||||
import appdaemon.adbase as ad
|
||||
|
||||
print(f' Importing {Path(__file__).name} '.center(50, '-'))
|
||||
|
||||
class Motion(ad.ADBase):
|
||||
def initialize(self):
|
||||
self.adapi = self.get_ad_api()
|
||||
|
||||
self.changes = False
|
||||
self.adapi.log(f'Initialized app from {__file__} new line changes: {self.changes}')
|
||||
|
||||
print(f'Done, motion.changes = {Motion.changes}'.center(50, '-'))
|
||||
@@ -0,0 +1,5 @@
|
||||
print(f' Importing {__name__} '.center(50, '+'))
|
||||
|
||||
from .bar import Bar
|
||||
|
||||
print(f' Done {__name__} '.center(50, '='))
|
||||
12
apps/my_repo/my_pkg/my_sub_pkg/bar.py
Normal file
12
apps/my_repo/my_pkg/my_sub_pkg/bar.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from pathlib import Path
|
||||
|
||||
from appdaemon.adbase import ADBase
|
||||
|
||||
filename = Path(__file__).name
|
||||
print(f' Importing {filename} '.center(50, '-'))
|
||||
|
||||
class Bar(ADBase):
|
||||
def initialize(self):
|
||||
self.adapi = self.get_ad_api()
|
||||
self.adapi.log(f'Initialized app from {__file__}')
|
||||
# self.adapi.log(f'CHANGED')
|
||||
12
apps/my_repo/my_pkg/my_sub_pkg/baz.py
Normal file
12
apps/my_repo/my_pkg/my_sub_pkg/baz.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from pathlib import Path
|
||||
|
||||
from appdaemon.adbase import ADBase
|
||||
|
||||
filename = Path(__file__).name
|
||||
print(f' Importing {filename} '.center(50, '-'))
|
||||
|
||||
class Baz(ADBase):
|
||||
def initialize(self):
|
||||
self.adapi = self.get_ad_api()
|
||||
self.adapi.log(f'Initialized app from {__file__}')
|
||||
# self.adapi.log(f'CHANGED')
|
||||
@@ -1,8 +0,0 @@
|
||||
import appdaemon.adbase as ad
|
||||
|
||||
class HelloWorldSub(ad.ADBase):
|
||||
def initialize(self):
|
||||
self.adapi = self.get_ad_api()
|
||||
self.log = self.adapi.log
|
||||
self.log(f'Initialized app from {__file__}')
|
||||
# self.log(f'CHANGED')
|
||||
Reference in New Issue
Block a user