mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
add conditional Interface import + app factory
This commit is contained in:
parent
39e7f0d8a5
commit
a318e06e8d
2 changed files with 16 additions and 0 deletions
10
src/__init_.py
Normal file
10
src/__init_.py
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
from yunohost.interface import Interface
|
||||||
|
|
||||||
|
from yunohost.user import app as user_app
|
||||||
|
|
||||||
|
|
||||||
|
def create_interface():
|
||||||
|
app = Interface(root=True)
|
||||||
|
app.add(user_app)
|
||||||
|
|
||||||
|
return app.instance
|
6
src/interface/__init__.py
Normal file
6
src/interface/__init__.py
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
import os
|
||||||
|
|
||||||
|
if os.environ.get("INTERFACE", "cli") == "cli":
|
||||||
|
from yunohost.interface.cli import Interface # noqa
|
||||||
|
else:
|
||||||
|
from yunohost.interface.api import Interface # noqa
|
Loading…
Add table
Reference in a new issue