Skip to content

Commit 2944b86

Browse files
Music Player app: simplify imports
1 parent 8953724 commit 2944b86

File tree

1 file changed

+4
-5
lines changed
  • internal_filesystem/apps/com.micropythonos.musicplayer/assets

1 file changed

+4
-5
lines changed

internal_filesystem/apps/com.micropythonos.musicplayer/assets/music_player.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
import os
33
import time
44

5-
from mpos import Activity, Intent, sdcard
6-
import mpos.ui
5+
from mpos import Activity, Intent, sdcard, get_event_name
76
import mpos.audio.audioflinger as AudioFlinger
87

98
class MusicPlayer(Activity):
@@ -14,7 +13,7 @@ class MusicPlayer(Activity):
1413
def onCreate(self):
1514
screen = lv.obj()
1615
# the user might have recently plugged in the sd card so try to mount it
17-
mpos.sdcard.mount_with_optional_format('/sdcard')
16+
sdcard.mount_with_optional_format('/sdcard')
1817
self.file_explorer = lv.file_explorer(screen)
1918
self.file_explorer.explorer_open_dir('M:/')
2019
self.file_explorer.align(lv.ALIGN.CENTER, 0, 0)
@@ -29,12 +28,12 @@ def onCreate(self):
2928

3029
def onResume(self, screen):
3130
# the user might have recently plugged in the sd card so try to mount it
32-
mpos.sdcard.mount_with_optional_format('/sdcard') # would be good to refresh the file_explorer so the /sdcard folder shows up
31+
sdcard.mount_with_optional_format('/sdcard') # would be good to refresh the file_explorer so the /sdcard folder shows up
3332

3433
def file_explorer_event_cb(self, event):
3534
event_code = event.get_code()
3635
if event_code not in [2,19,23,24,25,26,27,28,29,30,31,32,33,47,49,52]:
37-
name = mpos.ui.get_event_name(event_code)
36+
name = get_event_name(event_code)
3837
#print(f"file_explorer_event_cb {event_code} with name {name}")
3938
if event_code == lv.EVENT.VALUE_CHANGED:
4039
path = self.file_explorer.explorer_get_current_path()

0 commit comments

Comments
 (0)