You've already forked MicroPythonOS
mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
Fix typo
This commit is contained in:
@@ -9,3 +9,4 @@ from .package_manager import PackageManager
|
||||
from .app.activities.chooser import ChooserActivity
|
||||
from .app.activities.view import ViewActivity
|
||||
from .app.activities.share import ShareActivity
|
||||
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
from ..activity import Activity
|
||||
|
||||
#from ..activity import Activity
|
||||
|
||||
#import mpos.app.activity
|
||||
|
||||
#import mpos.app.activity
|
||||
|
||||
#from mpos.app import Activity
|
||||
|
||||
import mpos.package_manager
|
||||
|
||||
class ChooserActivity(Activity):
|
||||
@@ -18,7 +10,7 @@ class ChooserActivity(Activity):
|
||||
screen = lv.obj()
|
||||
# Get handlers from intent extras
|
||||
original_intent = self.getIntent().extras.get("original_intent")
|
||||
handlers = self.getIntent().extras.gepackage_managert("handlers", [])
|
||||
handlers = self.getIntent().extras.get("handlers", [])
|
||||
label = lv.label(screen)
|
||||
label.set_text("Choose an app")
|
||||
label.set_pos(10, 10)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import ujson
|
||||
from ..content.intent import Intent # optional, if App uses Intent
|
||||
#from ..content.intent import Intent # optional, if App uses Intent
|
||||
|
||||
|
||||
class App:
|
||||
|
||||
@@ -1,17 +1,23 @@
|
||||
import utime
|
||||
from .content.intent import Intent
|
||||
#from .app.activity import Activity
|
||||
|
||||
# circular import issue:
|
||||
#import mpos.package_manager
|
||||
#from .package_manager import PackageManager
|
||||
#from mpos import PackageManager
|
||||
#from mpos import *
|
||||
|
||||
import mpos.ui
|
||||
|
||||
class ActivityNavigator:
|
||||
#handlersa = PackageManager.APP_REGISTRY.get(intent.action, [])
|
||||
|
||||
@staticmethod
|
||||
def startActivity(intent):
|
||||
if not isinstance(intent, Intent):
|
||||
raise ValueError("Must provide an Intent")
|
||||
if intent.action: # Implicit intent: resolve handlers
|
||||
#handlers = mpos.package_manager.PackageManager.APP_REGISTRY.get(intent.action, [])
|
||||
#handlers = PackageManager.APP_REGISTRY.get(intent.action, [])
|
||||
if len(handlers) == 1:
|
||||
intent.activity_class = handlers[0]
|
||||
ActivityNavigator._launch_activity(intent)
|
||||
|
||||
Reference in New Issue
Block a user