From 9e60443e79755ba538d2679c13709ba351f6b344 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 9 Oct 2023 13:52:30 +0800 Subject: [PATCH] bugfix --- README.md | 0 docs/blocks.md | 0 docs/changelog.md | 0 docs/cn/binds.md | 0 docs/cn/cdf.md | 0 docs/cn/index.md | 0 docs/cn/intro.md | 0 docs/en/box.md | 0 docs/imgs/hello_window.png | Bin github-speed-up.md | 0 kivyblocks/__init__.py | 0 kivyblocks/android_rotation.py | 0 kivyblocks/anz/__init__.py | 0 kivyblocks/anz/bluetooth.py | 0 kivyblocks/aplayer.py | 0 kivyblocks/backendfunction.py | 0 kivyblocks/baseWidget.py | 21 +- kivyblocks/bgcolorbehavior.py | 0 kivyblocks/block_test.py | 0 kivyblocks/blocks.py | 2 +- kivyblocks/blocksapp.py | 28 +- kivyblocks/boxViewer.py | 0 kivyblocks/circle_progress.py | 0 kivyblocks/clickable.py | 0 kivyblocks/color_definitions.py | 0 kivyblocks/colorcalc.py | 0 kivyblocks/command_action.py | 0 kivyblocks/dataloader.py | 0 kivyblocks/date_picker.py | 0 kivyblocks/dateinput.py | 0 kivyblocks/defaultimage.py | 0 kivyblocks/dg.py | 1298 ++++++++--------- kivyblocks/download.py | 0 kivyblocks/externalwidgetmanager.py | 0 kivyblocks/ffpyplayer_video.py | 0 kivyblocks/filebrowser.py | 0 kivyblocks/form.py | 1 + kivyblocks/gps.py | 0 kivyblocks/hack_ffpyplayer.py | 0 kivyblocks/hierarchy.py | 0 kivyblocks/hostimage.py | 0 kivyblocks/httpvplayer.py | 0 kivyblocks/i18n.py | 0 kivyblocks/imgs/.DS_Store | Bin 14340 -> 12292 bytes kivyblocks/imgs/Mute64x64.png | Bin kivyblocks/imgs/Play64X64.png | Bin kivyblocks/imgs/Sound64x64.png | Bin kivyblocks/imgs/backword.png | Bin kivyblocks/imgs/broken.png | Bin kivyblocks/imgs/bullet_arrow_down.png | Bin kivyblocks/imgs/bullet_arrow_right.png | Bin kivyblocks/imgs/cancel.png | Bin kivyblocks/imgs/checkbox-off.png | Bin kivyblocks/imgs/checkbox-on.png | Bin kivyblocks/imgs/clear.png | Bin kivyblocks/imgs/conform.png | Bin kivyblocks/imgs/crud_add.png | Bin kivyblocks/imgs/crud_browser.png | Bin kivyblocks/imgs/crud_del.png | Bin kivyblocks/imgs/crud_edit.png | Bin kivyblocks/imgs/crud_filter.png | Bin kivyblocks/imgs/delete.png | Bin kivyblocks/imgs/doing.gif | Bin kivyblocks/imgs/download.png | Bin kivyblocks/imgs/error.png | Bin kivyblocks/imgs/folder.png | Bin kivyblocks/imgs/icon_view.png | Bin kivyblocks/imgs/info.png | Bin kivyblocks/imgs/kivymd_512.png | Bin kivyblocks/imgs/kivymd_logo.png | Bin kivyblocks/imgs/list_view.png | Bin kivyblocks/imgs/loading.gif | Bin kivyblocks/imgs/loading1.gif | Bin kivyblocks/imgs/menu.png | Bin kivyblocks/imgs/musictrack.png | Bin kivyblocks/imgs/musictrack_d.png | Bin kivyblocks/imgs/next.png | Bin kivyblocks/imgs/next_d.png | Bin kivyblocks/imgs/org_sound.png | Bin kivyblocks/imgs/org_sound_d.png | Bin kivyblocks/imgs/origin.jpg | Bin kivyblocks/imgs/pause.png | Bin kivyblocks/imgs/pause_d.png | Bin kivyblocks/imgs/photo.png | Bin kivyblocks/imgs/picture_empty.png | Bin kivyblocks/imgs/play.png | Bin kivyblocks/imgs/play_d.png | Bin kivyblocks/imgs/power64x64.png | Bin kivyblocks/imgs/previous.jpg | Bin kivyblocks/imgs/quad_shadow-0.png | Bin kivyblocks/imgs/quad_shadow-1.png | Bin kivyblocks/imgs/quad_shadow-2.png | Bin kivyblocks/imgs/quad_shadow.atlas | 0 kivyblocks/imgs/question.png | Bin kivyblocks/imgs/rec_shadow-0.png | Bin kivyblocks/imgs/rec_shadow-1.png | Bin kivyblocks/imgs/rec_shadow.atlas | 0 kivyblocks/imgs/rec_st_shadow-0.png | Bin kivyblocks/imgs/rec_st_shadow-1.png | Bin kivyblocks/imgs/rec_st_shadow-2.png | Bin kivyblocks/imgs/rec_st_shadow.atlas | 0 kivyblocks/imgs/record.png | Bin kivyblocks/imgs/replay.png | Bin kivyblocks/imgs/replay_d.png | Bin kivyblocks/imgs/return.png | Bin kivyblocks/imgs/right_menu.png | Bin kivyblocks/imgs/round_shadow-0.png | Bin kivyblocks/imgs/round_shadow-1.png | Bin kivyblocks/imgs/round_shadow-2.png | Bin kivyblocks/imgs/round_shadow.atlas | 0 kivyblocks/imgs/running.gif | Bin kivyblocks/imgs/save.png | Bin kivyblocks/imgs/search.png | Bin kivyblocks/imgs/stop.png | Bin kivyblocks/imgs/stop64x64.png | Bin kivyblocks/imgs/transparent.png | Bin kivyblocks/imgs/upload.png | Bin kivyblocks/kivymdPlugin.py | 0 kivyblocks/kivysize.py | 0 kivyblocks/landscopehide.py | 0 kivyblocks/localFolderLoader.py | 0 kivyblocks/login.py | 0 kivyblocks/mapview/__init__.py | 0 kivyblocks/mapview/_version.py | 0 kivyblocks/mapview/clustered_marker_layer.py | 0 kivyblocks/mapview/constants.py | 0 kivyblocks/mapview/downloader.py | 0 kivyblocks/mapview/geojson.py | 0 kivyblocks/mapview/icons/cluster.png | Bin kivyblocks/mapview/icons/marker.png | Bin kivyblocks/mapview/mbtsource.py | 0 kivyblocks/mapview/source.py | 0 kivyblocks/mapview/types.py | 0 kivyblocks/mapview/utils.py | 0 kivyblocks/mapview/view.py | 0 kivyblocks/markdown.py | 0 kivyblocks/material_resources.py | 0 kivyblocks/message.py | 0 kivyblocks/mixin.py | 0 kivyblocks/modalbehavior.py | 0 kivyblocks/multi_select.py | 0 kivyblocks/newvideo.py | 0 kivyblocks/objectViewer.py | 0 kivyblocks/orientationlayout.py | 0 kivyblocks/pagepanel.py | 0 kivyblocks/pagescontainer.py | 0 kivyblocks/paging.py | 0 kivyblocks/player_osc.py | 0 kivyblocks/playlist.py | 0 kivyblocks/price.py | 0 kivyblocks/pyinterpreter.py | 0 kivyblocks/qrdata.py | 0 kivyblocks/ready.py | 0 kivyblocks/register.py | 0 kivyblocks/responsivelayout.py | 0 kivyblocks/script.py | 11 +- kivyblocks/scrollpanel.py | 0 kivyblocks/serverImageViewer.py | 0 kivyblocks/serviceControl.py | 0 kivyblocks/setconfig.py | 0 kivyblocks/sizeposbehavior.py | 0 kivyblocks/swipebehavior.py | 0 kivyblocks/tab.py | 0 kivyblocks/theme_picker.py | 0 kivyblocks/theming.py | 0 kivyblocks/theming_dynamic_text.py | 0 kivyblocks/threadcall.py | 10 +- kivyblocks/toggleitems.py | 0 kivyblocks/toolbar.py | 0 kivyblocks/tree.py | 0 kivyblocks/ttf/Alimama_ShuHeiTi_Bold.ttf | Bin kivyblocks/ttf/DroidSansFallback.ttf | Bin kivyblocks/ttf/Roboto-Bold.ttf | Bin kivyblocks/ttf/Roboto-Italic.ttf | Bin kivyblocks/ttf/Roboto-Light.ttf | Bin kivyblocks/ttf/Roboto-LightItalic.ttf | Bin kivyblocks/ttf/Roboto-Medium.ttf | Bin kivyblocks/ttf/Roboto-MediumItalic.ttf | Bin kivyblocks/ttf/Roboto-Regular.ttf | Bin kivyblocks/ttf/Roboto-Thin.ttf | Bin kivyblocks/ttf/Roboto-ThinItalic.ttf | Bin kivyblocks/ttf/TsangerYuYangT_W01_W01.ttf | Bin kivyblocks/ttf/TsangerYuYangT_W02_W02.ttf | Bin kivyblocks/ttf/TsangerYuYangT_W03_W03.ttf | Bin kivyblocks/ttf/TsangerYuYangT_W04_W04.ttf | Bin kivyblocks/ttf/TsangerYuYangT_W05_W05.ttf | Bin .../ttf/materialdesignicons-webfont.ttf | Bin kivyblocks/twosides.py | 0 kivyblocks/udp_widget.py | 0 kivyblocks/uitype/__init__.py | 0 kivyblocks/uitype/amount.py | 0 kivyblocks/uitype/code.py | 0 kivyblocks/uitype/date.py | 0 kivyblocks/uitype/factory.py | 0 kivyblocks/uitype/float.py | 0 kivyblocks/uitype/int.py | 0 kivyblocks/uitype/password.py | 0 kivyblocks/uitype/text.py | 0 kivyblocks/uitype/viewer.py | 0 kivyblocks/upload.py | 0 kivyblocks/uploadfile.py | 0 kivyblocks/utils.py | 0 kivyblocks/version.py | 2 +- kivyblocks/videobehavior.py | 3 + kivyblocks/vplayer.py | 0 kivyblocks/widgetExt/__init__.py | 0 kivyblocks/widgetExt/androidwebview.py | 0 kivyblocks/widgetExt/binstateimage.py | 0 kivyblocks/widgetExt/camera.py | 0 kivyblocks/widgetExt/camerabutton.py | 0 kivyblocks/widgetExt/dataloader.py | 0 kivyblocks/widgetExt/filedataloader.py | 0 kivyblocks/widgetExt/httpdataloader.py | 0 kivyblocks/widgetExt/inputext.py | 0 kivyblocks/widgetExt/jsoncodeinput.py | 0 kivyblocks/widgetExt/messager.py | 0 kivyblocks/widgetExt/phonebutton.py | 0 kivyblocks/widgetExt/scrollwidget.py | 0 kivyblocks/widgetExt/sqldataloadder.py | 0 kivyblocks/widgetExt/tree.py | 0 kivyblocks/widget_css.py | 0 readme/opencv-android编译出错.md | 0 requirements.txt | 0 setup.py | 0 test/README.md | 0 test/buildozer.spec | 0 test/conf/config.json | 0 test/gadget/conf/config.json | 0 test/gadget/main.py | 0 test/main.py | 0 test/mixin.py | 0 test/rv.py | 0 test/script/conf/config.json | 0 test/script/main.py | 0 test/script/scripts/boxlayout/behavior.ui | 0 .../script/scripts/boxlayout/modalbehavior.ui | 0 test/script/scripts/boxlayout/normal.ui | 0 test/script/scripts/index.ui | 0 test/script/scripts/input_m3u.ui | 0 test/script/scripts/input_url.ui | 0 test/script/scripts/mainmenu.ui | 0 test/script/scripts/python.ui | 0 test/script/scripts/t.ui | 0 test/script/scripts/t1.ui | 0 test/script/scripts/video/behavior.ui | 0 test/script/scripts/video/behavior1.ui | 0 test/script/scripts/welcome.ui | 0 test/scroll.py | 0 test/ttdg.py | 0 249 files changed, 698 insertions(+), 678 deletions(-) mode change 100644 => 100755 README.md mode change 100644 => 100755 docs/blocks.md mode change 100644 => 100755 docs/changelog.md mode change 100644 => 100755 docs/cn/binds.md mode change 100644 => 100755 docs/cn/cdf.md mode change 100644 => 100755 docs/cn/index.md mode change 100644 => 100755 docs/cn/intro.md mode change 100644 => 100755 docs/en/box.md mode change 100644 => 100755 docs/imgs/hello_window.png mode change 100644 => 100755 github-speed-up.md mode change 100644 => 100755 kivyblocks/__init__.py mode change 100644 => 100755 kivyblocks/android_rotation.py mode change 100644 => 100755 kivyblocks/anz/__init__.py mode change 100644 => 100755 kivyblocks/anz/bluetooth.py mode change 100644 => 100755 kivyblocks/aplayer.py mode change 100644 => 100755 kivyblocks/backendfunction.py mode change 100644 => 100755 kivyblocks/baseWidget.py mode change 100644 => 100755 kivyblocks/bgcolorbehavior.py mode change 100644 => 100755 kivyblocks/block_test.py mode change 100644 => 100755 kivyblocks/blocks.py mode change 100644 => 100755 kivyblocks/blocksapp.py mode change 100644 => 100755 kivyblocks/boxViewer.py mode change 100644 => 100755 kivyblocks/circle_progress.py mode change 100644 => 100755 kivyblocks/clickable.py mode change 100644 => 100755 kivyblocks/color_definitions.py mode change 100644 => 100755 kivyblocks/colorcalc.py mode change 100644 => 100755 kivyblocks/command_action.py mode change 100644 => 100755 kivyblocks/dataloader.py mode change 100644 => 100755 kivyblocks/date_picker.py mode change 100644 => 100755 kivyblocks/dateinput.py mode change 100644 => 100755 kivyblocks/defaultimage.py mode change 100644 => 100755 kivyblocks/dg.py mode change 100644 => 100755 kivyblocks/download.py mode change 100644 => 100755 kivyblocks/externalwidgetmanager.py mode change 100644 => 100755 kivyblocks/ffpyplayer_video.py mode change 100644 => 100755 kivyblocks/filebrowser.py mode change 100644 => 100755 kivyblocks/form.py mode change 100644 => 100755 kivyblocks/gps.py mode change 100644 => 100755 kivyblocks/hack_ffpyplayer.py mode change 100644 => 100755 kivyblocks/hierarchy.py mode change 100644 => 100755 kivyblocks/hostimage.py mode change 100644 => 100755 kivyblocks/httpvplayer.py mode change 100644 => 100755 kivyblocks/i18n.py mode change 100644 => 100755 kivyblocks/imgs/.DS_Store mode change 100644 => 100755 kivyblocks/imgs/Mute64x64.png mode change 100644 => 100755 kivyblocks/imgs/Play64X64.png mode change 100644 => 100755 kivyblocks/imgs/Sound64x64.png mode change 100644 => 100755 kivyblocks/imgs/backword.png mode change 100644 => 100755 kivyblocks/imgs/broken.png mode change 100644 => 100755 kivyblocks/imgs/bullet_arrow_down.png mode change 100644 => 100755 kivyblocks/imgs/bullet_arrow_right.png mode change 100644 => 100755 kivyblocks/imgs/cancel.png mode change 100644 => 100755 kivyblocks/imgs/checkbox-off.png mode change 100644 => 100755 kivyblocks/imgs/checkbox-on.png mode change 100644 => 100755 kivyblocks/imgs/clear.png mode change 100644 => 100755 kivyblocks/imgs/conform.png mode change 100644 => 100755 kivyblocks/imgs/crud_add.png mode change 100644 => 100755 kivyblocks/imgs/crud_browser.png mode change 100644 => 100755 kivyblocks/imgs/crud_del.png mode change 100644 => 100755 kivyblocks/imgs/crud_edit.png mode change 100644 => 100755 kivyblocks/imgs/crud_filter.png mode change 100644 => 100755 kivyblocks/imgs/delete.png mode change 100644 => 100755 kivyblocks/imgs/doing.gif mode change 100644 => 100755 kivyblocks/imgs/download.png mode change 100644 => 100755 kivyblocks/imgs/error.png mode change 100644 => 100755 kivyblocks/imgs/folder.png mode change 100644 => 100755 kivyblocks/imgs/icon_view.png mode change 100644 => 100755 kivyblocks/imgs/info.png mode change 100644 => 100755 kivyblocks/imgs/kivymd_512.png mode change 100644 => 100755 kivyblocks/imgs/kivymd_logo.png mode change 100644 => 100755 kivyblocks/imgs/list_view.png mode change 100644 => 100755 kivyblocks/imgs/loading.gif mode change 100644 => 100755 kivyblocks/imgs/loading1.gif mode change 100644 => 100755 kivyblocks/imgs/menu.png mode change 100644 => 100755 kivyblocks/imgs/musictrack.png mode change 100644 => 100755 kivyblocks/imgs/musictrack_d.png mode change 100644 => 100755 kivyblocks/imgs/next.png mode change 100644 => 100755 kivyblocks/imgs/next_d.png mode change 100644 => 100755 kivyblocks/imgs/org_sound.png mode change 100644 => 100755 kivyblocks/imgs/org_sound_d.png mode change 100644 => 100755 kivyblocks/imgs/origin.jpg mode change 100644 => 100755 kivyblocks/imgs/pause.png mode change 100644 => 100755 kivyblocks/imgs/pause_d.png mode change 100644 => 100755 kivyblocks/imgs/photo.png mode change 100644 => 100755 kivyblocks/imgs/picture_empty.png mode change 100644 => 100755 kivyblocks/imgs/play.png mode change 100644 => 100755 kivyblocks/imgs/play_d.png mode change 100644 => 100755 kivyblocks/imgs/power64x64.png mode change 100644 => 100755 kivyblocks/imgs/previous.jpg mode change 100644 => 100755 kivyblocks/imgs/quad_shadow-0.png mode change 100644 => 100755 kivyblocks/imgs/quad_shadow-1.png mode change 100644 => 100755 kivyblocks/imgs/quad_shadow-2.png mode change 100644 => 100755 kivyblocks/imgs/quad_shadow.atlas mode change 100644 => 100755 kivyblocks/imgs/question.png mode change 100644 => 100755 kivyblocks/imgs/rec_shadow-0.png mode change 100644 => 100755 kivyblocks/imgs/rec_shadow-1.png mode change 100644 => 100755 kivyblocks/imgs/rec_shadow.atlas mode change 100644 => 100755 kivyblocks/imgs/rec_st_shadow-0.png mode change 100644 => 100755 kivyblocks/imgs/rec_st_shadow-1.png mode change 100644 => 100755 kivyblocks/imgs/rec_st_shadow-2.png mode change 100644 => 100755 kivyblocks/imgs/rec_st_shadow.atlas mode change 100644 => 100755 kivyblocks/imgs/record.png mode change 100644 => 100755 kivyblocks/imgs/replay.png mode change 100644 => 100755 kivyblocks/imgs/replay_d.png mode change 100644 => 100755 kivyblocks/imgs/return.png mode change 100644 => 100755 kivyblocks/imgs/right_menu.png mode change 100644 => 100755 kivyblocks/imgs/round_shadow-0.png mode change 100644 => 100755 kivyblocks/imgs/round_shadow-1.png mode change 100644 => 100755 kivyblocks/imgs/round_shadow-2.png mode change 100644 => 100755 kivyblocks/imgs/round_shadow.atlas mode change 100644 => 100755 kivyblocks/imgs/running.gif mode change 100644 => 100755 kivyblocks/imgs/save.png mode change 100644 => 100755 kivyblocks/imgs/search.png mode change 100644 => 100755 kivyblocks/imgs/stop.png mode change 100644 => 100755 kivyblocks/imgs/stop64x64.png mode change 100644 => 100755 kivyblocks/imgs/transparent.png mode change 100644 => 100755 kivyblocks/imgs/upload.png mode change 100644 => 100755 kivyblocks/kivymdPlugin.py mode change 100644 => 100755 kivyblocks/kivysize.py mode change 100644 => 100755 kivyblocks/landscopehide.py mode change 100644 => 100755 kivyblocks/localFolderLoader.py mode change 100644 => 100755 kivyblocks/login.py mode change 100644 => 100755 kivyblocks/mapview/__init__.py mode change 100644 => 100755 kivyblocks/mapview/_version.py mode change 100644 => 100755 kivyblocks/mapview/clustered_marker_layer.py mode change 100644 => 100755 kivyblocks/mapview/constants.py mode change 100644 => 100755 kivyblocks/mapview/downloader.py mode change 100644 => 100755 kivyblocks/mapview/geojson.py mode change 100644 => 100755 kivyblocks/mapview/icons/cluster.png mode change 100644 => 100755 kivyblocks/mapview/icons/marker.png mode change 100644 => 100755 kivyblocks/mapview/mbtsource.py mode change 100644 => 100755 kivyblocks/mapview/source.py mode change 100644 => 100755 kivyblocks/mapview/types.py mode change 100644 => 100755 kivyblocks/mapview/utils.py mode change 100644 => 100755 kivyblocks/mapview/view.py mode change 100644 => 100755 kivyblocks/markdown.py mode change 100644 => 100755 kivyblocks/material_resources.py mode change 100644 => 100755 kivyblocks/message.py mode change 100644 => 100755 kivyblocks/mixin.py mode change 100644 => 100755 kivyblocks/modalbehavior.py mode change 100644 => 100755 kivyblocks/multi_select.py mode change 100644 => 100755 kivyblocks/newvideo.py mode change 100644 => 100755 kivyblocks/objectViewer.py mode change 100644 => 100755 kivyblocks/orientationlayout.py mode change 100644 => 100755 kivyblocks/pagepanel.py mode change 100644 => 100755 kivyblocks/pagescontainer.py mode change 100644 => 100755 kivyblocks/paging.py mode change 100644 => 100755 kivyblocks/player_osc.py mode change 100644 => 100755 kivyblocks/playlist.py mode change 100644 => 100755 kivyblocks/price.py mode change 100644 => 100755 kivyblocks/pyinterpreter.py mode change 100644 => 100755 kivyblocks/qrdata.py mode change 100644 => 100755 kivyblocks/ready.py mode change 100644 => 100755 kivyblocks/register.py mode change 100644 => 100755 kivyblocks/responsivelayout.py mode change 100644 => 100755 kivyblocks/script.py mode change 100644 => 100755 kivyblocks/scrollpanel.py mode change 100644 => 100755 kivyblocks/serverImageViewer.py mode change 100644 => 100755 kivyblocks/serviceControl.py mode change 100644 => 100755 kivyblocks/setconfig.py mode change 100644 => 100755 kivyblocks/sizeposbehavior.py mode change 100644 => 100755 kivyblocks/swipebehavior.py mode change 100644 => 100755 kivyblocks/tab.py mode change 100644 => 100755 kivyblocks/theme_picker.py mode change 100644 => 100755 kivyblocks/theming.py mode change 100644 => 100755 kivyblocks/theming_dynamic_text.py mode change 100644 => 100755 kivyblocks/threadcall.py mode change 100644 => 100755 kivyblocks/toggleitems.py mode change 100644 => 100755 kivyblocks/toolbar.py mode change 100644 => 100755 kivyblocks/tree.py mode change 100644 => 100755 kivyblocks/ttf/Alimama_ShuHeiTi_Bold.ttf mode change 100644 => 100755 kivyblocks/ttf/DroidSansFallback.ttf mode change 100644 => 100755 kivyblocks/ttf/Roboto-Bold.ttf mode change 100644 => 100755 kivyblocks/ttf/Roboto-Italic.ttf mode change 100644 => 100755 kivyblocks/ttf/Roboto-Light.ttf mode change 100644 => 100755 kivyblocks/ttf/Roboto-LightItalic.ttf mode change 100644 => 100755 kivyblocks/ttf/Roboto-Medium.ttf mode change 100644 => 100755 kivyblocks/ttf/Roboto-MediumItalic.ttf mode change 100644 => 100755 kivyblocks/ttf/Roboto-Regular.ttf mode change 100644 => 100755 kivyblocks/ttf/Roboto-Thin.ttf mode change 100644 => 100755 kivyblocks/ttf/Roboto-ThinItalic.ttf mode change 100644 => 100755 kivyblocks/ttf/TsangerYuYangT_W01_W01.ttf mode change 100644 => 100755 kivyblocks/ttf/TsangerYuYangT_W02_W02.ttf mode change 100644 => 100755 kivyblocks/ttf/TsangerYuYangT_W03_W03.ttf mode change 100644 => 100755 kivyblocks/ttf/TsangerYuYangT_W04_W04.ttf mode change 100644 => 100755 kivyblocks/ttf/TsangerYuYangT_W05_W05.ttf mode change 100644 => 100755 kivyblocks/ttf/materialdesignicons-webfont.ttf mode change 100644 => 100755 kivyblocks/twosides.py mode change 100644 => 100755 kivyblocks/udp_widget.py mode change 100644 => 100755 kivyblocks/uitype/__init__.py mode change 100644 => 100755 kivyblocks/uitype/amount.py mode change 100644 => 100755 kivyblocks/uitype/code.py mode change 100644 => 100755 kivyblocks/uitype/date.py mode change 100644 => 100755 kivyblocks/uitype/factory.py mode change 100644 => 100755 kivyblocks/uitype/float.py mode change 100644 => 100755 kivyblocks/uitype/int.py mode change 100644 => 100755 kivyblocks/uitype/password.py mode change 100644 => 100755 kivyblocks/uitype/text.py mode change 100644 => 100755 kivyblocks/uitype/viewer.py mode change 100644 => 100755 kivyblocks/upload.py mode change 100644 => 100755 kivyblocks/uploadfile.py mode change 100644 => 100755 kivyblocks/utils.py mode change 100644 => 100755 kivyblocks/version.py mode change 100644 => 100755 kivyblocks/videobehavior.py mode change 100644 => 100755 kivyblocks/vplayer.py mode change 100644 => 100755 kivyblocks/widgetExt/__init__.py mode change 100644 => 100755 kivyblocks/widgetExt/androidwebview.py mode change 100644 => 100755 kivyblocks/widgetExt/binstateimage.py mode change 100644 => 100755 kivyblocks/widgetExt/camera.py mode change 100644 => 100755 kivyblocks/widgetExt/camerabutton.py mode change 100644 => 100755 kivyblocks/widgetExt/dataloader.py mode change 100644 => 100755 kivyblocks/widgetExt/filedataloader.py mode change 100644 => 100755 kivyblocks/widgetExt/httpdataloader.py mode change 100644 => 100755 kivyblocks/widgetExt/inputext.py mode change 100644 => 100755 kivyblocks/widgetExt/jsoncodeinput.py mode change 100644 => 100755 kivyblocks/widgetExt/messager.py mode change 100644 => 100755 kivyblocks/widgetExt/phonebutton.py mode change 100644 => 100755 kivyblocks/widgetExt/scrollwidget.py mode change 100644 => 100755 kivyblocks/widgetExt/sqldataloadder.py mode change 100644 => 100755 kivyblocks/widgetExt/tree.py mode change 100644 => 100755 kivyblocks/widget_css.py mode change 100644 => 100755 readme/opencv-android编译出错.md mode change 100644 => 100755 requirements.txt mode change 100644 => 100755 setup.py mode change 100644 => 100755 test/README.md mode change 100644 => 100755 test/buildozer.spec mode change 100644 => 100755 test/conf/config.json mode change 100644 => 100755 test/gadget/conf/config.json mode change 100644 => 100755 test/gadget/main.py mode change 100644 => 100755 test/main.py mode change 100644 => 100755 test/mixin.py mode change 100644 => 100755 test/rv.py mode change 100644 => 100755 test/script/conf/config.json mode change 100644 => 100755 test/script/main.py mode change 100644 => 100755 test/script/scripts/boxlayout/behavior.ui mode change 100644 => 100755 test/script/scripts/boxlayout/modalbehavior.ui mode change 100644 => 100755 test/script/scripts/boxlayout/normal.ui mode change 100644 => 100755 test/script/scripts/index.ui mode change 100644 => 100755 test/script/scripts/input_m3u.ui mode change 100644 => 100755 test/script/scripts/input_url.ui mode change 100644 => 100755 test/script/scripts/mainmenu.ui mode change 100644 => 100755 test/script/scripts/python.ui mode change 100644 => 100755 test/script/scripts/t.ui mode change 100644 => 100755 test/script/scripts/t1.ui mode change 100644 => 100755 test/script/scripts/video/behavior.ui mode change 100644 => 100755 test/script/scripts/video/behavior1.ui mode change 100644 => 100755 test/script/scripts/welcome.ui mode change 100644 => 100755 test/scroll.py mode change 100644 => 100755 test/ttdg.py diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/docs/blocks.md b/docs/blocks.md old mode 100644 new mode 100755 diff --git a/docs/changelog.md b/docs/changelog.md old mode 100644 new mode 100755 diff --git a/docs/cn/binds.md b/docs/cn/binds.md old mode 100644 new mode 100755 diff --git a/docs/cn/cdf.md b/docs/cn/cdf.md old mode 100644 new mode 100755 diff --git a/docs/cn/index.md b/docs/cn/index.md old mode 100644 new mode 100755 diff --git a/docs/cn/intro.md b/docs/cn/intro.md old mode 100644 new mode 100755 diff --git a/docs/en/box.md b/docs/en/box.md old mode 100644 new mode 100755 diff --git a/docs/imgs/hello_window.png b/docs/imgs/hello_window.png old mode 100644 new mode 100755 diff --git a/github-speed-up.md b/github-speed-up.md old mode 100644 new mode 100755 diff --git a/kivyblocks/__init__.py b/kivyblocks/__init__.py old mode 100644 new mode 100755 diff --git a/kivyblocks/android_rotation.py b/kivyblocks/android_rotation.py old mode 100644 new mode 100755 diff --git a/kivyblocks/anz/__init__.py b/kivyblocks/anz/__init__.py old mode 100644 new mode 100755 diff --git a/kivyblocks/anz/bluetooth.py b/kivyblocks/anz/bluetooth.py old mode 100644 new mode 100755 diff --git a/kivyblocks/aplayer.py b/kivyblocks/aplayer.py old mode 100644 new mode 100755 diff --git a/kivyblocks/backendfunction.py b/kivyblocks/backendfunction.py old mode 100644 new mode 100755 diff --git a/kivyblocks/baseWidget.py b/kivyblocks/baseWidget.py old mode 100644 new mode 100755 index 560d2b0..210801a --- a/kivyblocks/baseWidget.py +++ b/kivyblocks/baseWidget.py @@ -75,7 +75,7 @@ from .threadcall import HttpClient from .i18n import I18n from .widget_css import WidgetCSS from .ready import WidgetReady -from .utils import CSize, SUPER +from .utils import CSize from .swipebehavior import SwipeBehavior from .widgetExt.inputext import MyDropDown @@ -140,7 +140,7 @@ def ScatterBox(WidgetCSS, WidgetReady, ScatterLayout): class Box(WidgetCSS, WidgetReady, BoxLayout): def __init__(self, **kw): try: - SUPER(Box, self, kw) + super(Box, self).__init__(**kw) except Exception as e: print('Box(',kw,') Error') raise e @@ -157,9 +157,7 @@ class VBox(Box): Box.__init__(self, **kw) class SwipeBox(SwipeBehavior, Box): - def __init__(self, **kw): - SUPER(SwipeBox, self, kw) - + pass class Text(Label): lang=StringProperty('') @@ -182,7 +180,7 @@ class Text(Label): if not kwargs.get('text'): kwargs['text'] = kwargs.get('otext','') - SUPER(Text, self, kwargs) + super(Text, self).__init__(**kwargs) if self._i18n: self.i18n.addI18nWidget(self) if self.wrap: @@ -277,6 +275,7 @@ class Modal(VBox): self._target = None super(Modal, self).__init__(**kw) self.set_size_position() + print('size_hint=', self.size_hint, kw) self._target.bind(size=self.set_size_position) self.register_event_type('on_open') self.register_event_type('on_pre_open') @@ -299,7 +298,7 @@ class Modal(VBox): return super().on_touch_down(touch) - def on_target(self): + def on_target(self, o, target): w = Window if self.target is not None: w = Factory.Blocks.getWidgetById(self.target) @@ -324,9 +323,9 @@ class Modal(VBox): self.width = self.size_hint_x * self._target.width if self.size_hint_y: self.height = self.size_hint_y * self._target.height - print(self.width, self.height, - self.size_hint_x, self.size_hint_y, - self._target.size + print("size with target:", self.width, self.height, + self.size_hint, self.size_hint, + "target size=", self._target.size ) self.set_modal_position() @@ -392,7 +391,7 @@ class TimedModal(Modal): show_time = NumericProperty(0) def __init__(self, **kw): self.time_task = None - SUPER(TimedModal, self, kw) + super(TimedModal, self).__init__(**kw) def open(self, *args, **kw): if self.time_task is not None: diff --git a/kivyblocks/bgcolorbehavior.py b/kivyblocks/bgcolorbehavior.py old mode 100644 new mode 100755 diff --git a/kivyblocks/block_test.py b/kivyblocks/block_test.py old mode 100644 new mode 100755 diff --git a/kivyblocks/blocks.py b/kivyblocks/blocks.py old mode 100644 new mode 100755 index cfcd47a..8783844 --- a/kivyblocks/blocks.py +++ b/kivyblocks/blocks.py @@ -204,7 +204,7 @@ x = ClassX{klass_cnt}() return None if url.startswith('file://'): - return self.script.dispatch(url, **params) + return self.script.dispatch(url, params) elif url.startswith('http://') or url.startswith('https://'): try: hc = HttpClient() diff --git a/kivyblocks/blocksapp.py b/kivyblocks/blocksapp.py old mode 100644 new mode 100755 index 262abd7..9de0825 --- a/kivyblocks/blocksapp.py +++ b/kivyblocks/blocksapp.py @@ -60,10 +60,13 @@ class BlocksApp(App): with codecs.open(config.css.css_filename, 'r', 'utf-8') as f: d = json.load(f) self.buildCsses(d) - if config.css.css_url: - hc = HttpClient() - d = hc.get(self.realurl(config.css.css_url)) - self.buildCsses(d) + try: + if config.css.css_url: + hc = HttpClient() + d = hc.get(self.realurl(config.css.css_url)) + self.buildCsses(d) + except: + pass def on_rotate(self,*largs): self.current_rotation = Window.rotation @@ -76,10 +79,19 @@ class BlocksApp(App): register_css(k,v) def build(self): - i18n = I18n() + config = getConfig() + self.workers = Workers(maxworkers=config.maxworkers or 80) + self.workers.start() + try: + i18n = I18n() + except: + i18n = None self.platform = platform self.is_desktop = platform in ['win', 'linux', 'macosx'] - config = getConfig() + self.default_params = {} + if config.default_params: + self.default_params.update(config.default_params) + self.public_headers = { "platform":self.platform } @@ -88,8 +100,6 @@ class BlocksApp(App): Window.bind(on_request_close=self.on_close) Window.bind(on_rotate=self.on_rotate) Window.bind(size=self.device_info) - self.workers = Workers(maxworkers=config.maxworkers or 80) - self.workers.start() self.load_csses() self.running = True if config.root: @@ -163,7 +173,7 @@ class BlocksApp(App): } self.public_headers.update(device) - def on_close(self, *args): + def on_close(self, *args, **kwargs): self.workers.running = False return False diff --git a/kivyblocks/boxViewer.py b/kivyblocks/boxViewer.py old mode 100644 new mode 100755 diff --git a/kivyblocks/circle_progress.py b/kivyblocks/circle_progress.py old mode 100644 new mode 100755 diff --git a/kivyblocks/clickable.py b/kivyblocks/clickable.py old mode 100644 new mode 100755 diff --git a/kivyblocks/color_definitions.py b/kivyblocks/color_definitions.py old mode 100644 new mode 100755 diff --git a/kivyblocks/colorcalc.py b/kivyblocks/colorcalc.py old mode 100644 new mode 100755 diff --git a/kivyblocks/command_action.py b/kivyblocks/command_action.py old mode 100644 new mode 100755 diff --git a/kivyblocks/dataloader.py b/kivyblocks/dataloader.py old mode 100644 new mode 100755 diff --git a/kivyblocks/date_picker.py b/kivyblocks/date_picker.py old mode 100644 new mode 100755 diff --git a/kivyblocks/dateinput.py b/kivyblocks/dateinput.py old mode 100644 new mode 100755 diff --git a/kivyblocks/defaultimage.py b/kivyblocks/defaultimage.py old mode 100644 new mode 100755 diff --git a/kivyblocks/dg.py b/kivyblocks/dg.py old mode 100644 new mode 100755 index 79558d9..e951294 --- a/kivyblocks/dg.py +++ b/kivyblocks/dg.py @@ -1,652 +1,646 @@ -import time -try: - import ujson as json -except: - import json -from functools import partial - -from kivy.logger import Logger -from kivy.uix.gridlayout import GridLayout -from kivy.uix.boxlayout import BoxLayout -from kivy.uix.scrollview import ScrollView -from kivy.uix.label import Label -from kivy.graphics import Fbo -from kivy.uix.button import ButtonBehavior -from kivy.clock import Clock -from kivy.properties import BooleanProperty, StringProperty, \ - OptionProperty, DictProperty, NumericProperty, ListProperty -from kivy.properties import ListProperty -from kivy.graphics import Color, Rectangle -from kivy.app import App -from kivy.factory import Factory - -from appPublic.dictObject import DictObject -from appPublic.uniqueID import getID -from appPublic.myTE import string_template_render - -from .utils import * -from .baseWidget import Text, HBox, VBox, Running -from .scrollpanel import ScrollPanel -from .paging import Paging, RelatedLoader -from .ready import WidgetReady -from .toolbar import Toolbar -from .bgcolorbehavior import BGColorBehavior -from .widget_css import WidgetCSS -from .uitype.factory import UiFactory - -class BLabel(ButtonBehavior, Text): - def __init__(self, **kw): - ButtonBehavior.__init__(self) - Text.__init__(self,**kw) - self.csscls = 'dummy' - -class Cell(ButtonBehavior, WidgetCSS, BoxLayout): - colume_name = StringProperty(None) - cell_type = OptionProperty('data', \ - options=['data', 'header']) - def __init__(self,row,desc, **kw): - """ - desc:{ - width, - datatype:fff - value: - format: - on_press: - } - """ - self.desc = desc - self.row = row - self.part = self.row.part - self.datagrid = self.part.datagrid - super().__init__(size_hint=(None,None), - width = self.desc['width'], - height = self.row.part.datagrid.rowHeight() - ) - self.csscls=self.row.part.datagrid.row_normal_css - if self.row.header: - self.csscls=self.row.part.datagrid.header_css - if desc['header']: - bl = Text(i18n=True, otext=str(desc['value']), - font_size=CSize(1),wrap=True, - halign='left', valign='middle' - ) - self.cell_type = 'header' - else: - self.cell_type = 'data' - bl = UiFactory.build_view_widget(desc,self.row.row_data) - if self.row.header and desc['name'] == '_checkable_action_': - id = self.row.row_data[idfield] - if self.row.part.datagrid.is_checked(id): - bl.setValue(True) - else: - bl.setValue(False) - bl.bind(select_state=self.row.checkable_action) - - self.colume_name = desc['name'] - if bl: - self.add_widget(bl) - -class Row(BoxLayout): - def __init__(self,part, rowdesc,header=False,data=None, **kw): - """ - rowdesc=[ - { - width, - name - value - on_press - } - - """ - self.part = part - self.datagrid = self.part.datagrid - self.header = header - self.row_data = data - self.row_id = None - self.linewidth = self.part.datagrid.linewidth - self.rowdesc = rowdesc - opts = kw.copy() - opts.update({ - "spacing":self.linewidth, - "orientation":"horizontal" - }) - super(Row, self).__init__(**opts) - self.height = self.part.datagrid.rowHeight() - self.init(0) - - def checkable_action(self, o, *args): - self.datagrid.set_checked_rows(self.row_id, o.select_state) - - def on_row_press(self, *args): - pass - - def init(self,t): - w = 0 - h = 0 - for c in self.rowdesc: - c['header'] = self.header - cell = Cell(self,c) - self.add_widget(cell) - cell.bind(on_press=self.part.datagrid.cell_pressed) - w += cell.width - self.size_hint = None,None - self.width = w + self.linewidth * (len(self.rowdesc)+1) - - def unselected(self): - self.select(False) - - def selected(self): - self.select(True) - - def select(self, flag): - for c in self.children: - if flag: - c.csscls = self.part.datagrid.row_selected_css - else: - c.csscls = self.part.datagrid.row_normal_css - -class Header(WidgetReady, ScrollPanel): - def __init__(self,part,**kw): - SUPER(Header, self, kw) - self.part = part - self.init(1) - self.bind(on_scroll_stop=self.part.datagrid.scrollstop) - if self.part.freeze_flag: - self.bar_width = 0 - self.bar_width = 0 - - def init(self,t): - rd = [ f.copy() for f in self.part.rowdesc ] - [ f.update({'value':self.part.fields[i].get('label', \ - self.part.fields[i].get('name'))}) \ - for i,f in enumerate(rd) ] - self.header = Row(self.part,rd,header=True) - self.add_widget(self.header) - self.height = self.header.height - -class Body(WidgetReady, ScrollPanel): - def __init__(self,part,**kw): - self.part = part - SUPER(Body, self, kw) - self._inner.spacing = self.part.datagrid.linewidth - self.size_hint=(1,1) - self.idRow = {} - self.bind(on_scroll_stop=self.part.datagrid.scrollstop) - if self.part.freeze_flag: - self.bar_width = 0 - - def addRow(self,id, data,index=0): - rd = [ f.copy() for f in self.part.rowdesc ] - [ f.update({'value':data.get(f['name'])}) for f in rd ] - row = Row(self.part,rd,data=data) - row.row_id = id - self.add_widget(row,index=index) - self.idRow[id] = row - return row - - def clearRows(self): - self.idRow = {} - self.clear_widgets() - - def delRowById(self,id): - row = self.idRow.get(id) - if row: - self.remove_widget(row) - if self.idRow.get(id): - del self.idRow[id] - - def getRowData(self,rowid): - return self.idRow[rowid].row_data - - def getRowHeight(self): - return self.part.datagrid.rowHeight() - - def get_row_by_id(self, rowid): - return self.idRow.get(rowid) - -class DataGridPart(WidgetReady, BoxLayout): - def __init__(self,dg, freeze_flag, fields): - self.datagrid = dg - self.fields = fields - self.freeze_flag = freeze_flag - self.fields_width = None - BoxLayout.__init__(self, orientation='vertical') - WidgetReady.__init__(self) - self.init(0) - - def setWidth(self): - if self.freeze_flag: - self.size_hint_x = None - self.width = self.getFieldsWidth() - - def getFieldsWidth(self): - if not self.fields_width: - width = 0 - for f in self.rowdesc: - width += f['width'] - self.fields_width = width - return self.fields_width - - def init(self,t): - rd = [] - for f in self.fields: - r = f.copy() - r['width'] = CSize(f.get('width',10)) - rd.append(r) - self.rowdesc = rd - self.setWidth() - kw = {} - if self.freeze_flag: - kw['width'] = self.fields_width - kw['size_hint'] = (None,None) - else: - kw['size_hint'] = (1,None) - kw['height'] = self.datagrid.rowHeight() - - self.header = None - if not self.datagrid.noheader: - self.header = Header(self,**kw) - self.add_widget(self.header) - inner = { - "widgettype":"VBox", - "options":{ - } - } - self.body = Body(self) - self.add_widget(self.body) - if not self.freeze_flag: - self.body.bind(pos=self.datagrid.bodyOnSize, - size=self.datagrid.bodyOnSize) - - def clearRows(self): - return self.body.clearRows() - - def addRow(self,id, data): - return self.body.addRow(id, data) - - def on_size(self, o, s=None): - if not hasattr(self, 'body'): - return - if hasattr(self, '_toolbar'): - if self._toolbar is not None: - self._toolbar.width = self.width - self.body.size_hint_y = None - if self.header: - self.body.height = self.height - self.header.height - else: - self.body.height = self.height - - -class DataGrid(VBox): - """ - DataGrid data format: - { - "widgettype":"DataGrid", - "dataloader":{ - "page":1, - "rows":60, - "dataurl":"eeee", - "params":{ - } - }, - "tailer":{ - "options":{ - } - "info":[ - "total_cnt", - "total_page", - "page_rows", - "curpage" - ], - "others":{ - } - }, - "row_height": CSize, - "header_css":"default", - "body_css":"default", - "spacing":1, - "fields":[ - { - "name":"field1", - "label":"Field1", - "datatype":"str", - "uitype":"code", - "value_field":, - "text_field": - }, - { - "name":"field2", - "label":"Field2", - "viewer":{ - block dic - } - } - ... - ] - "binds":[ - ] - } - """ - checkable = BooleanProperty(False) - row_selected = BooleanProperty(False) - row_normal_css = StringProperty('default') - row_selected_css = StringProperty('default') - header_css = StringProperty('default') - body_css = StringProperty('default') - row_height = NumericProperty(2) - noheader = BooleanProperty(False) - linewidth = NumericProperty(1) - toolbar = DictProperty(None) - dataloader = DictProperty(None) - fields = ListProperty(None) - tailer = DictProperty(None) - def __init__(self,**options): - if self.checkable: - self.fields.insert(0, { - "name":"_checkable_action_", - "label":" ", - "type":"checkbox", - "width":CSize(2), - "freeze_flag":True - }) - - self.checked_rows = [] - self.select_rowid = None - self.rowheight = None - self.on_sizeTask = None - self.selected_rowid = None - self.show_rows = 0 - self._toolbar = None - self.freeze_part = None - self.normal_part = None - SUPER(DataGrid, self, options) - self.freeze_fields = self.getPartFields(freeze_flag=True) - self.normal_fields = self.getPartFields(freeze_flag=False) - if not self.dataloader: - raise Exception('DataGrid need a DataLoader') - self._dataloader = RelatedLoader(target=self, **self.dataloader) - self._dataloader.bind(on_deletepage=self.delete_page) - self._dataloader.bind(on_pageloaded=self.add_page) - self._dataloader.bind(on_pageloaded=self.update_tailer_info) - self._dataloader.bind(on_newbegin=self.clearRows) - self.register_event_type('on_selected') - self.register_event_type('on_rowpress') - self.register_event_type('on_cellpress') - self.register_event_type('on_headerpress') - self.createDataGridPart() - self.createToolbar() - if self._toolbar: - self.add_widget(self._toolbar) - - b = BoxLayout(orientation='horizontal') - if self.freeze_part: - b.add_widget(self.freeze_part) - if self.normal_part: - b.add_widget(self.normal_part) - self.add_widget(b) - if self.tailer: - self.tailer_widgets = {} - self.build_tailer(self.tailer) - - def set_checked_rows(self, rowid, flag): - if flag and rowid not in self.checked_ids: - self.checked_ids.append(rowid) - if not flag: - self.checked_ids = [ id for id in self.checked_ids if id !=rowid] - def on_rowpress(self, *args): - print('on_rowpress fire, args=', args) - - def on_cellpress(self, *args): - print('on_cesspress fire, args=', args) - - def on_headerpress(self, *args): - print('on_headerpress fire, args=', args) - - def cell_pressed(self, o): - if o.cell_type == 'header': - self.dispatch('on_headerpress', o.colume_name) - return - row = o.row - if self.selected_rowid: - self.unselect_row(self.selected_rowid) - - self.selected_rowid = row.row_id - self.select_row(row.row_id) - self.dispatch('on_cellpress', o) - self.dispatch('on_rowpress', row) - self.dispatch('on_selected', row) - - def unselect_row(self, row_id): - if self.freeze_part: - row = self.freeze_part.body.get_row_by_id(row_id) - if not row: - return - row.unselected() - row = self.normal_part.body.get_row_by_id(row_id) - if not row: - return - row.unselected() - - def select_row(self, row_id): - if self.freeze_part: - row = self.freeze_part.body.get_row_by_id(row_id) - row.selected() - row = self.normal_part.body.get_row_by_id(row_id) - row.selected() - - def on_ready(self, *args): - self.loadData() - - def build_tailer(self, tailer_desc): - kw = tailer_desc.get('options', {}) - kw.update({ - 'size_hint_y':None, - 'height':self.rowheight - }) - w = HBox(**kw) - self.add_widget(w) - self.show_infos(w, tailer_desc.get('info')) - if tailer_desc.get('others'): - w1 = self.build_tailer_other(tailer_desc.get('others')) - if w1: - w.add_widget(w1) - - def update_tailer_info(self, *args): - if not hasattr(self, 'tailer_widgets'): - return - for n,w in self.tailer_widgets.items(): - w.text = self.loader_info(n) - - def show_infos(self, tailer_widget, info_names): - for n in info_names: - desc = { - "widgettype":"Text", - "options":{ - "otext":n, - "i18n":True, - } - } - w = Factory.Blocks().widgetBuild(desc) - tailer_widget.add_widget(w) - tailer_widget.add_widget(Label(text=':')) - self.tailer_widgets[n] = Label(text=self.loader_info(n)) - tailer_widget.add_widget(self.tailer_widgets[n]) - - def build_tailer_others(desc): - return Factory.Blocks().widgetBuild(desc) - - def loader_info(self, n): - if hasattr(self._dataloader, n): - txt=getattr(self._dataloader, n, 0) - if txt is None: - txt = '0' - txt = str(txt) - return txt - - def locater(self,pos): - self.normal_part.body.scroll_y = pos - if self.freeze_part: - self.freeze_part.body.scroll_y = pos - - def scrollstop(self,o,v=None): - if not self.noheader and o == self.normal_part.header: - self.normal_part.body.scroll_x = o.scroll_x - return - if o == self.normal_part.body: - if not self.noheader: - self.normal_part.header.scroll_x = o.scroll_x - if self.freeze_part: - self.freeze_part.body.scroll_y = o.scroll_y - if self.freeze_part and o == self.freeze_part.body: - self.normal_part.body.scroll_y = o.scroll_y - - if o.scroll_y <= 0.01: - self._dataloader.loadNextPage() - if o.scroll_y >= 0.99: - self._dataloader.loadPreviousPage() - - def getValue(self): - if not self.select_rowid: - return None - return self._getRowData(self.select_rowid) - - def _getRowData(self, rowid): - d = {} - if self.freeze_part: - d.update(self.freeze_part.body.getRowData(rowid)) - d.update(self.normal_part.body.getRowData(rowid)) - return DictObject(**d) - - def bodyOnSize(self,o,s): - if self.on_sizeTask is not None: - self.on_sizeTask.cancel() - self.on_sizeTask = Clock.schedule_once(self.calculateShowRows,0.3) - - def rowHeight(self): - if not self.rowheight: - self.rowheight = CSize(self.row_height) - return self.rowheight - - def calculateShowRows(self,t): - self.getShowRows() - self._dataloader.setPageRows(self.show_rows * 2) - - def getShowRows(self): - if self.show_rows == 0: - return 60 - self.show_rows = int(self.rowHeight() / self.normal_part.body.height) - return self.show_rows * 2 - - def clearRows(self, *args): - if self.freeze_part: - self.freeze_part.body.clearRows() - self.normal_part.body.clearRows() - - def add_page(self,o,data): - dir = data['dir'] - if not self.show_rows: - self.getShowRows() - - ids = [] - recs = data['data'] - idx = 0 - if dir == 'up': - recs.reverse() - idx = -1 - recs1 = recs[:self.show_rows] - recs2 = recs[self.show_rows:] - self._fbo = Fbo(size=self.size) - with self._fbo: - self._background_color = Color(0,0,0,1) - self._background_rect = Rectangle(size=self.size) - for r in recs1: - id = self.addRow(r,index=idx) - ids.append(id) - with self.canvas: - self._fbo_rect = Rectangle(size=self.size, - texture=self._fbo.texture) - - data['idx'] = idx - data['ids'] = ids - data['data'] = recs2 - f = partial(self.add_page_delay,data) - Clock.schedule_once(f, 0) - - def add_page_delay(self, data, *args): - recs = data['data'] - page = data['page'] - idx = data['idx'] - ids = data['ids'] - self._fbo = Fbo(size=self.size) - with self._fbo: - self._background_color = Color(0,0,0,1) - self._background_rect = Rectangle(size=self.size) - for r in recs: - id = self.addRow(r,index=idx) - ids.append(id) - with self.canvas: - self._fbo_rect = Rectangle(size=self.size, - texture=self._fbo.texture) - self._dataloader.bufferObjects(page,ids) - x = self._dataloader.getLocater() - self.locater(x) - - def delete_page(self,o,data): - for id in data: - self.delRow(id) - - def addRow(self,data, **kw): - id = getID() - f_row = None - if self.freeze_part: - self.freeze_part.body.addRow(id, data, **kw) - self.normal_part.body.addRow(id, data, **kw) - return id - - def delRow(self,id,**kw): - if self.freeze_part: - self.freeze_part.body.delRowById(id) - self.normal_part.body.delRowById(id) - - def createToolbar(self): - if self.toolbar: - self._toolbar = Toolbar(**self.toolbar) - - def on_selected(self,row): - print("DataGrid():on_selected fire") - - def loadData(self,*args, **kwargs): - kwargs['page'] = 1 - self.selected_rowid = None - self._dataloader.do_search(None,kwargs) - - def createDataGridPart(self): - self.freeze_part = None - self.normal_part = None - if self.freeze_fields: - self.freeze_part = DataGridPart(self,True, self.freeze_fields) - if self.normal_fields: - self.normal_part = DataGridPart(self, False, self.normal_fields) - - def getPartFields(self,freeze_flag:bool=False) -> list: - fs = [] - for f in self.fields: - if freeze_flag: - if f.get('freeze',False): - fs.append(f) - else: - if not f.get('freeze',False): - fs.append(f) - return fs - - def get_selected_data(self): - if not self.selected_rowid: - return {} - data = {} - row_id = self.selected_rowid - if self.freeze_part: - row = self.freeze_part.body.get_row_by_id(row_id) - data.update(row.row_data) - row = self.normal_part.body.get_row_by_id(row_id) - data.update(row.row_data) - return data +import time +try: + import ujson as json +except: + import json +from functools import partial + +from kivy.logger import Logger +from kivy.uix.gridlayout import GridLayout +from kivy.uix.boxlayout import BoxLayout +from kivy.uix.scrollview import ScrollView +from kivy.uix.label import Label +from kivy.graphics import Fbo +from kivy.uix.button import ButtonBehavior +from kivy.clock import Clock +from kivy.properties import BooleanProperty, StringProperty, \ + OptionProperty, DictProperty, NumericProperty, ListProperty +from kivy.properties import ListProperty +from kivy.graphics import Color, Rectangle +from kivy.app import App +from kivy.factory import Factory + +from appPublic.dictObject import DictObject +from appPublic.uniqueID import getID +from appPublic.myTE import string_template_render + +from .utils import * +from .baseWidget import Text, HBox, VBox +from .scrollpanel import ScrollPanel +from .paging import Paging, RelatedLoader +from .ready import WidgetReady +from .toolbar import Toolbar +from .bgcolorbehavior import BGColorBehavior +from .widget_css import WidgetCSS +from .uitype.factory import UiFactory + +class BLabel(ButtonBehavior, Text): + def __init__(self, **kw): + ButtonBehavior.__init__(self) + Text.__init__(self,**kw) + self.csscls = 'dummy' + +class Cell(ButtonBehavior, WidgetCSS, BoxLayout): + colume_name = StringProperty(None) + cell_type = OptionProperty('data', \ + options=['data', 'header']) + def __init__(self,row,desc, **kw): + """ + desc:{ + width, + datatype:fff + value: + format: + on_press: + } + """ + self.desc = desc + self.row = row + width = self.desc['width'] + height = self.row.part.datagrid.rowHeight() + print(f'Cell:{width=}, {height=},value={desc["value"]}') + super().__init__(size_hint=(None,None), + width=width, + bgcolor=[0.1,0.5,0.5], + height=height + ) + self.csscls=self.row.part.datagrid.row_normal_css + if self.row.header: + self.csscls=self.row.part.datagrid.header_css + if desc['header']: + bl = Text(i18n=True, text=str(desc['value']), + font_size=CSize(1),wrap=True, + halign='left', valign='middle' + ) + self.cell_type = 'header' + else: + self.cell_type = 'data' + bl = UiFactory.build_view_widget(desc,self.row.row_data) + self.colume_name = desc['name'] + if bl: + self.add_widget(bl) + +class Row(BoxLayout): + def __init__(self,part, rowdesc,header=False,data=None, **kw): + """ + rowdesc=[ + { + width, + name + value + on_press + } + + """ + self.part = part + self.header = header + self.row_data = data + self.row_id = None + self.linewidth = self.part.datagrid.linewidth + self.rowdesc = rowdesc + opts = kw.copy() + opts.update({ + "spacing":self.linewidth, + "orientation":"horizontal" + }) + super(Row, self).__init__(**opts) + self.height = self.part.datagrid.rowHeight() + self.init(0) + + def on_row_press(self, *args): + pass + + def init(self,t): + w = 0 + h = 0 + for c in self.rowdesc: + c['header'] = self.header + cell = Cell(self,c) + self.add_widget(cell) + cell.bind(on_press=self.part.datagrid.cell_pressed) + w += cell.width + self.size_hint = None,None + self.width = w + self.linewidth * (len(self.rowdesc)+1) + + def unselected(self): + self.select(False) + + def selected(self): + self.select(True) + + def select(self, flag): + for c in self.children: + if flag: + c.csscls = self.part.datagrid.row_selected_css + else: + c.csscls = self.part.datagrid.row_normal_css + +class Header(WidgetReady, ScrollPanel): + def __init__(self,part,**kw): + SUPER(Header, self, kw) + self.part = part + self.init(1) + self.bind(on_scroll_stop=self.part.datagrid.scrollstop) + if self.part.freeze_flag: + self.bar_width = 0 + self.bar_width = 0 + + def init(self,t): + rd = [ f.copy() for f in self.part.rowdesc ] + [ f.update({'value':self.part.fields[i].get('label', \ + self.part.fields[i].get('name'))}) \ + for i,f in enumerate(rd) ] + self.header = Row(self.part,rd,header=True) + self.add_widget(self.header) + self.size_hint_y = None + self.height = self.header.height + +class Body(WidgetReady, ScrollPanel): + def __init__(self,part,**kw): + self.part = part + SUPER(Body, self, kw) + self._inner.spacing = self.part.datagrid.linewidth + self.size_hint=(1,1) + self.idRow = {} + self.bind(on_scroll_stop=self.part.datagrid.scrollstop) + if self.part.freeze_flag: + self.bar_width = 0 + + def addRow(self,id, data,index=0): + rd = [ f.copy() for f in self.part.rowdesc ] + [ f.update({'value':data.get(f['name'])}) for f in rd ] + row = Row(self.part,rd,data=data) + row.row_id = id + self.add_widget(row,index=index) + self.idRow[id] = row + print(f'row size={row.size}, hint={row.size_hint}') + return row + + def clearRows(self): + self.idRow = {} + self.clear_widgets() + + def delRowById(self,id): + row = self.idRow.get(id) + if row: + self.remove_widget(row) + if self.idRow.get(id): + del self.idRow[id] + + def getRowData(self,rowid): + return self.idRow[rowid].row_data + + def getRowHeight(self): + return self.part.datagrid.rowHeight() + + def get_row_by_id(self, rowid): + return self.idRow.get(rowid) + +class DataGridPart(WidgetReady, BoxLayout): + def __init__(self,dg, freeze_flag, fields): + self.datagrid = dg + self.fields = fields + self.freeze_flag = freeze_flag + self.fields_width = None + BoxLayout.__init__(self, orientation='vertical') + WidgetReady.__init__(self) + self.init(0) + + def setWidth(self): + if self.freeze_flag: + self.size_hint_x = None + self.width = self.getFieldsWidth() + + def getFieldsWidth(self): + if not self.fields_width: + width = 0 + for f in self.rowdesc: + width += f['width'] + self.fields_width = width + return self.fields_width + + def init(self,t): + rd = [] + for f in self.fields: + r = f.copy() + r['width'] = CSize(f.get('width',10)) + rd.append(r) + self.rowdesc = rd + self.setWidth() + kw = {} + if self.freeze_flag: + kw['width'] = self.fields_width + kw['size_hint'] = (None,None) + else: + kw['size_hint'] = (1,None) + kw['height'] = self.datagrid.rowHeight() + + self.header = None + if not self.datagrid.noheader: + self.header = Header(self,**kw) + self.add_widget(self.header) + inner = { + "widgettype":"VBox", + "options":{ + } + } + self.body = Body(self) + self.add_widget(self.body) + if not self.freeze_flag: + self.body.bind(pos=self.datagrid.bodyOnSize, + size=self.datagrid.bodyOnSize) + + def clearRows(self): + return self.body.clearRows() + + def addRow(self,id, data): + return self.body.addRow(id, data) + + def on_size(self, o, s=None): + if not hasattr(self, 'body'): + return + if hasattr(self, '_toolbar'): + if self._toolbar is not None: + self._toolbar.width = self.width + self.body.size_hint_y = None + if self.header: + self.body.height = self.height - self.header.height + else: + self.body.height = self.height + + +class DataGrid(VBox): + """ + DataGrid data format: + { + "widgettype":"DataGrid", + "dataloader":{ + "page":1, + "rows":60, + "dataurl":"eeee", + "params":{ + } + }, + "tailer":{ + "options":{ + } + "info":[ + "total_cnt", + "total_page", + "page_rows", + "curpage" + ], + "others":{ + } + }, + "row_height": CSize, + "header_css":"default", + "body_css":"default", + "spacing":1, + "fields":[ + { + "name":"field1", + "label":"Field1", + "datatype":"str", + "uitype":"code", + "value_field":, + "text_field": + }, + { + "name":"field2", + "label":"Field2", + "viewer":{ + block dic + } + } + ... + ] + "binds":[ + ] + } + """ + row_selected = BooleanProperty(False) + row_normal_css = StringProperty('default') + row_selected_css = StringProperty('default') + header_css = StringProperty('default') + body_css = StringProperty('default') + row_height = NumericProperty(2) + noheader = BooleanProperty(False) + linewidth = NumericProperty(1) + toolbar = DictProperty(None) + dataloader = DictProperty(None) + fields = ListProperty(None) + tailer = DictProperty(None) + def __init__(self,**options): + self.select_rowid = None + self.rowheight = None + self.on_sizeTask = None + self.selected_rowid = None + self.show_rows = 0 + self._toolbar = None + self.freeze_part = None + self.normal_part = None + SUPER(DataGrid, self, options) + self.freeze_fields = self.getPartFields(freeze_flag=True) + self.normal_fields = self.getPartFields(freeze_flag=False) + if not self.dataloader: + raise Exception('DataGrid need a DataLoader') + self._dataloader = RelatedLoader(target=self, **self.dataloader) + self._dataloader.bind(on_deletepage=self.delete_page) + self._dataloader.bind(on_pageloaded=self.add_page) + self._dataloader.bind(on_pageloaded=self.update_tailer_info) + self._dataloader.bind(on_newbegin=self.clearRows) + self.register_event_type('on_selected') + self.register_event_type('on_rowpress') + self.register_event_type('on_cellpress') + self.register_event_type('on_headerpress') + self.createDataGridPart() + self.createToolbar() + if self._toolbar: + self.add_widget(self._toolbar) + + b = BoxLayout(orientation='horizontal') + if self.freeze_part: + b.add_widget(self.freeze_part) + if self.normal_part: + b.add_widget(self.normal_part) + self.add_widget(b) + if self.tailer: + self.tailer_widgets = {} + self.build_tailer(self.tailer) + + def on_rowpress(self, *args): + print('on_rowpress fire, args=', args) + + def on_cellpress(self, *args): + print('on_cellpress fire, args=', args) + + def on_headerpress(self, *args): + print('on_headerpress fire, args=', args) + + def cell_pressed(self, o): + if o.cell_type == 'header': + self.dispatch('on_headerpress', o.colume_name) + return + row = o.row + if self.selected_rowid: + self.unselect_row(self.selected_rowid) + + self.selected_rowid = row.row_id + self.select_row(row.row_id) + self.dispatch('on_cellpress', o) + self.dispatch('on_rowpress', row) + self.dispatch('on_selected', row) + + def unselect_row(self, row_id): + if self.freeze_part: + row = self.freeze_part.body.get_row_by_id(row_id) + if not row: + return + row.unselected() + row = self.normal_part.body.get_row_by_id(row_id) + if not row: + return + row.unselected() + + def select_row(self, row_id): + if self.freeze_part: + row = self.freeze_part.body.get_row_by_id(row_id) + row.selected() + row = self.normal_part.body.get_row_by_id(row_id) + row.selected() + + def on_ready(self, *args): + self.loadData() + + def build_tailer(self, tailer_desc): + kw = tailer_desc.get('options', {}) + kw.update({ + 'size_hint_y':None, + 'height':self.rowheight + }) + w = HBox(**kw) + self.add_widget(w) + self.show_infos(w, tailer_desc.get('info')) + if tailer_desc.get('others'): + w1 = self.build_tailer_other(tailer_desc.get('others')) + if w1: + w.add_widget(w1) + + def update_tailer_info(self, *args): + if not hasattr(self, 'tailer_widgets'): + return + for n,w in self.tailer_widgets.items(): + w.text = self.loader_info(n) + + def show_infos(self, tailer_widget, info_names): + for n in info_names: + desc = { + "widgettype":"Text", + "options":{ + "text":n, + "i18n":True, + } + } + w = Factory.Blocks().widgetBuild(desc) + tailer_widget.add_widget(w) + tailer_widget.add_widget(Label(text=':')) + self.tailer_widgets[n] = Label(text=self.loader_info(n)) + tailer_widget.add_widget(self.tailer_widgets[n]) + + def build_tailer_others(desc): + return Factory.Blocks().widgetBuild(desc) + + def loader_info(self, n): + if hasattr(self._dataloader, n): + txt=getattr(self._dataloader, n, 0) + if txt is None: + txt = '0' + txt = str(txt) + return txt + + def locater(self,pos): + self.normal_part.body.scroll_y = pos + if self.freeze_part: + self.freeze_part.body.scroll_y = pos + + def scrollstop(self,o,v=None): + if not self.noheader and o == self.normal_part.header: + self.normal_part.body.scroll_x = o.scroll_x + return + if o == self.normal_part.body: + if not self.noheader: + self.normal_part.header.scroll_x = o.scroll_x + if self.freeze_part: + self.freeze_part.body.scroll_y = o.scroll_y + if self.freeze_part and o == self.freeze_part.body: + self.normal_part.body.scroll_y = o.scroll_y + + if o.scroll_y <= 0.01: + self._dataloader.loadNextPage() + if o.scroll_y >= 0.99: + self._dataloader.loadPreviousPage() + + def getValue(self): + if not self.select_rowid: + return None + return self._getRowData(self.select_rowid) + + def _getRowData(self, rowid): + d = {} + if self.freeze_part: + d.update(self.freeze_part.body.getRowData(rowid)) + d.update(self.normal_part.body.getRowData(rowid)) + return DictObject(**d) + + def bodyOnSize(self,o,s): + if self.on_sizeTask is not None: + self.on_sizeTask.cancel() + self.on_sizeTask = Clock.schedule_once(self.calculateShowRows,0.3) + + def rowHeight(self): + if not self.rowheight: + self.rowheight = CSize(self.row_height) + return self.rowheight + + def calculateShowRows(self,t): + self.getShowRows() + self._dataloader.setPageRows(self.show_rows * 2) + + def getShowRows(self): + if self.show_rows == 0: + return 60 + self.show_rows = int(self.rowHeight() / self.normal_part.body.height) + return self.show_rows * 2 + + def clearRows(self, *args): + if self.freeze_part: + self.freeze_part.body.clearRows() + self.normal_part.body.clearRows() + + def add_page(self,o,data): + dir = data['dir'] + if not self.show_rows: + self.getShowRows() + + ids = [] + recs = data['data'] + idx = 0 + if dir == 'up': + recs.reverse() + idx = -1 + recs1 = recs[:self.show_rows] + recs2 = recs[self.show_rows:] + self._fbo = Fbo(size=self.size) + with self._fbo: + self._background_color = Color(0,0,0,1) + self._background_rect = Rectangle(size=self.size) + for r in recs1: + id = self.addRow(r,index=idx) + ids.append(id) + with self.canvas: + self._fbo_rect = Rectangle(size=self.size, + texture=self._fbo.texture) + + data['idx'] = idx + data['ids'] = ids + data['data'] = recs2 + f = partial(self.add_page_delay,data) + Clock.schedule_once(f, 0) + + def add_page_delay(self, data, *args): + recs = data['data'] + page = data['page'] + idx = data['idx'] + ids = data['ids'] + self._fbo = Fbo(size=self.size) + with self._fbo: + self._background_color = Color(0,0,0,1) + self._background_rect = Rectangle(size=self.size) + for r in recs: + id = self.addRow(r,index=idx) + ids.append(id) + with self.canvas: + self._fbo_rect = Rectangle(size=self.size, + texture=self._fbo.texture) + self._dataloader.bufferObjects(page,ids) + x = self._dataloader.getLocater() + self.locater(x) + + def delete_page(self,o,data): + for id in data: + self.delRow(id) + + def addRow(self,data, **kw): + # print('addRow()', data) + id = getID() + f_row = None + if self.freeze_part: + self.freeze_part.body.addRow(id, data, **kw) + self.normal_part.body.addRow(id, data, **kw) + return id + + def delRow(self,id,**kw): + if self.freeze_part: + self.freeze_part.body.delRowById(id) + self.normal_part.body.delRowById(id) + + def createToolbar(self): + if self.toolbar: + self._toolbar = Toolbar(**self.toolbar) + + def on_selected(self,row): + print("DataGrid():on_selected fire") + + def loadData(self,*args, **kwargs): + kwargs['page'] = 1 + self.selected_rowid = None + self._dataloader.do_search(None,kwargs) + + def createDataGridPart(self): + self.freeze_part = None + self.normal_part = None + if self.freeze_fields: + self.freeze_part = DataGridPart(self,True, self.freeze_fields) + if self.normal_fields: + self.normal_part = DataGridPart(self, False, self.normal_fields) + + def getPartFields(self,freeze_flag:bool=False) -> list: + fs = [] + for f in self.fields: + if freeze_flag: + if f.get('freeze',False): + fs.append(f) + else: + if not f.get('freeze',False): + fs.append(f) + return fs + + def show_size(self, *args, **kw): + print(f'dg:{self.size}') + print(f'normal_part:{self.normal_part.size}') + print(f'body:{self.normal_part.body.size}') + print(f'row:{self.normal_part.body.children[0].size}') + print(f'row:{self.normal_part.body.children[0].size}') + sp = self.normal_part.body.children[0] + print(f'rows={len(sp.children) - 1}') + for i, r in enumerate(sp.children): + print(f'{i} {r.size=}') + if self.normal_part.parent.parent == self: + print('part ok') + else: + print('part parent=', self.normal_part.parent) + if self.normal_part.body.parent == self.normal_part: + print('body ok') + + def get_selected_data(self): + if not self.selected_rowid: + return {} + data = {} + row_id = self.selected_rowid + if self.freeze_part: + row = self.freeze_part.body.get_row_by_id(row_id) + data.update(row.row_data) + row = self.normal_part.body.get_row_by_id(row_id) + data.update(row.row_data) + return data diff --git a/kivyblocks/download.py b/kivyblocks/download.py old mode 100644 new mode 100755 diff --git a/kivyblocks/externalwidgetmanager.py b/kivyblocks/externalwidgetmanager.py old mode 100644 new mode 100755 diff --git a/kivyblocks/ffpyplayer_video.py b/kivyblocks/ffpyplayer_video.py old mode 100644 new mode 100755 diff --git a/kivyblocks/filebrowser.py b/kivyblocks/filebrowser.py old mode 100644 new mode 100755 diff --git a/kivyblocks/form.py b/kivyblocks/form.py old mode 100644 new mode 100755 index b8f9275..69d5948 --- a/kivyblocks/form.py +++ b/kivyblocks/form.py @@ -32,6 +32,7 @@ form options "method" } "cols":"1" + "inputwidth", "labelwidth": "textsize": "inputheight": diff --git a/kivyblocks/gps.py b/kivyblocks/gps.py old mode 100644 new mode 100755 diff --git a/kivyblocks/hack_ffpyplayer.py b/kivyblocks/hack_ffpyplayer.py old mode 100644 new mode 100755 diff --git a/kivyblocks/hierarchy.py b/kivyblocks/hierarchy.py old mode 100644 new mode 100755 diff --git a/kivyblocks/hostimage.py b/kivyblocks/hostimage.py old mode 100644 new mode 100755 diff --git a/kivyblocks/httpvplayer.py b/kivyblocks/httpvplayer.py old mode 100644 new mode 100755 diff --git a/kivyblocks/i18n.py b/kivyblocks/i18n.py old mode 100644 new mode 100755 diff --git a/kivyblocks/imgs/.DS_Store b/kivyblocks/imgs/.DS_Store old mode 100644 new mode 100755 index 797bc458a4ec8ac4af1d3b6de18ec8a98c5fa972..90b7b9386e365f534d9f17790330bb1a48637278 GIT binary patch delta 256 zcmZoEXh~3DU|?W$DortDV9)?EIe-{M3-ADmHUeKR`;3kRdx`3m9!KmYBgl@j;3tD^M>G7;pm#S7ci^UVP6ynO{ejkzul