bugfix
This commit is contained in:
parent
35c5cd3452
commit
dad54583e7
@ -26,12 +26,14 @@ from .register import *
|
|||||||
from .threadcall import HttpClient,Workers
|
from .threadcall import HttpClient,Workers
|
||||||
from .utils import *
|
from .utils import *
|
||||||
from .widget_css import register_css
|
from .widget_css import register_css
|
||||||
|
from .version import __version__
|
||||||
|
|
||||||
if platform == 'android':
|
if platform == 'android':
|
||||||
from jnius import autoclass
|
from jnius import autoclass
|
||||||
|
|
||||||
from .android_rotation import get_rotation
|
from .android_rotation import get_rotation
|
||||||
|
|
||||||
|
Logger.info(f'KivyBlocks:version={__version__}')
|
||||||
def signal_handler(signal, frame):
|
def signal_handler(signal, frame):
|
||||||
app = App.get_running_app()
|
app = App.get_running_app()
|
||||||
if app is None:
|
if app is None:
|
||||||
@ -42,6 +44,7 @@ def signal_handler(signal, frame):
|
|||||||
|
|
||||||
signal.signal(signal.SIGINT, signal_handler)
|
signal.signal(signal.SIGINT, signal_handler)
|
||||||
|
|
||||||
|
|
||||||
class BlocksApp(App):
|
class BlocksApp(App):
|
||||||
def get_rotation(self):
|
def get_rotation(self):
|
||||||
return get_rotation()
|
return get_rotation()
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import os
|
||||||
import traceback
|
import traceback
|
||||||
try:
|
try:
|
||||||
import ujson as json
|
import ujson as json
|
||||||
@ -10,6 +11,9 @@ from appPublic.myTE import MyTemplateEngine
|
|||||||
from appPublic.Singleton import SingletonDecorator
|
from appPublic.Singleton import SingletonDecorator
|
||||||
from appPublic.dictObject import DictObject
|
from appPublic.dictObject import DictObject
|
||||||
|
|
||||||
|
from kivy.logger import Logger
|
||||||
|
from kivy.utils import platform
|
||||||
|
|
||||||
@SingletonDecorator
|
@SingletonDecorator
|
||||||
class ScriptEnv(DictObject):
|
class ScriptEnv(DictObject):
|
||||||
pass
|
pass
|
||||||
@ -32,6 +36,20 @@ class Script:
|
|||||||
url = url[7:]
|
url = url[7:]
|
||||||
return join(self.root, *url.split('/'))
|
return join(self.root, *url.split('/'))
|
||||||
|
|
||||||
|
def show_info(self, env):
|
||||||
|
workdir = env['workdir']
|
||||||
|
sfile = env['filepath']
|
||||||
|
url = env['url']
|
||||||
|
Logger.info(f'script:workdir={workdir}')
|
||||||
|
Logger.info(f'script:script_file={sfile}')
|
||||||
|
Logger.info(f'script:url={url}')
|
||||||
|
sdir = os.path.join(workdir, 'scripts')
|
||||||
|
sf_exists = os.path.isdir(sdir)
|
||||||
|
conf_f = os.path.join(workdir, 'conf', 'config.json')
|
||||||
|
conf_exists = os.path.isfile(conf_f)
|
||||||
|
Logger.info(f'script:script exists {sf_exists}')
|
||||||
|
Logger.info(f'script:config.json exists {conf_exists}')
|
||||||
|
|
||||||
def dispatch(self, url, **kw):
|
def dispatch(self, url, **kw):
|
||||||
filepath = self.url2filepath(url)
|
filepath = self.url2filepath(url)
|
||||||
for suffix, handler in self.handlers.items():
|
for suffix, handler in self.handlers.items():
|
||||||
@ -42,6 +60,9 @@ class Script:
|
|||||||
env['root_path'] = self.root
|
env['root_path'] = self.root
|
||||||
env['url'] = url
|
env['url'] = url
|
||||||
env['filepath'] = filepath
|
env['filepath'] = filepath
|
||||||
|
# if platform == 'android':
|
||||||
|
self.show_info(env)
|
||||||
|
|
||||||
h = handler(env)
|
h = handler(env)
|
||||||
d = h.render()
|
d = h.render()
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user