Update icons_keyboard.py for 1.7.37+ (API 9)

• Additional code which was added for compatibility between different versions of API 8 was removed;
• Removed PLUGIN functionality (not required anymore)
• Use default `# ba_meta export` class
• No longer imports the whole babase module, only the necessary one's
This commit is contained in:
! Freaku 2025-02-08 01:54:51 +05:30 committed by GitHub
parent 5e531ef747
commit 8d46d713bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,13 +7,13 @@
# Tap bottom-left bomb button to cycle through different icons
# ba_meta require api 8
# ba_meta require api 9
import bauiv1
import babase
from babase import SpecialChar
from babase import charstr
list_of_icons = [i for i in babase.SpecialChar]
list_of_icons = [i for i in SpecialChar]
list_of_icons = [charstr(i) for i in list_of_icons]
list_of_icons.reverse()
@ -21,7 +21,8 @@ for i in range(26 - (len(list_of_icons) % 26)):
list_of_icons.append('')
class IconKeyboard(babase.Keyboard if hasattr(babase, 'Keyboard') else bauiv1.Keyboard):
# ba_meta export bauiv1.Keyboard
class IconKeyboard(bauiv1.Keyboard):
"""Keyboard go brrrrrrr"""
name = 'Icons by \ue048Freaku'
chars = [(list_of_icons[0:10]),
@ -31,11 +32,4 @@ class IconKeyboard(babase.Keyboard if hasattr(babase, 'Keyboard') else bauiv1.Ke
pages = {
f'icon{i//26+1}': tuple(list_of_icons[i:i+26])
for i in range(26, len(list_of_icons), 26)
}
# ba_meta export plugin
class byFreaku(babase.Plugin):
def __init__(self):
babase.app.meta.scanresults.exports['babase.Keyboard' if hasattr(
babase, 'Keyboard') else 'bauiv1.Keyboard'].append(__name__+'.IconKeyboard')
}