Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
The performance of button.name is kind of slow?
-
@cvp
pip install toml
I used toml module in my code. Should write a requirement file. -
@cvp one question: when you have to display a new index, do you need to get data from internet? If yes, that could explain why it is slower
-
@cvp No, I loaded all and then I display them.
-
@lpl toml loaded, crash
Traceback (most recent call last): File "/private/var/mobile/Containers/Shared/AppGroup/668A7D98-7216-47ED-917D-AA0B6173167E/Pythonista3/Documents/yj_ebook_reader-master/yj_ebook_reader-master/ebook_reader.py", line 27, in <module> controller = Controller(EBookLoader, EBookReader) File "/private/var/mobile/Containers/Shared/AppGroup/668A7D98-7216-47ED-917D-AA0B6173167E/Pythonista3/Documents/yj_ebook_reader-master/yj_ebook_reader-master/controller.py", line 17, in __init__ self.reader_viewer = ReaderViewer(self) File "/private/var/mobile/Containers/Shared/AppGroup/668A7D98-7216-47ED-917D-AA0B6173167E/Pythonista3/Documents/yj_ebook_reader-master/yj_ebook_reader-master/ereader.py", line 55, in __init__ super().__init__(EBookBodyViewer, controller) File "/private/var/mobile/Containers/Shared/AppGroup/668A7D98-7216-47ED-917D-AA0B6173167E/Pythonista3/Documents/yj_ebook_reader-master/yj_ebook_reader-master/ereader.py", line 9, in __init__ self.var_index_viewer = IndexViewer(self) File "/private/var/mobile/Containers/Shared/AppGroup/668A7D98-7216-47ED-917D-AA0B6173167E/Pythonista3/Documents/yj_ebook_reader-master/yj_ebook_reader-master/index_viewer/index_viewer.py", line 12, in __init__ reader_view = ui.load_view('index_viewer/index') File "/var/containers/Bundle/Application/E4751F4F-64A4-4BE6-AB9D-9C9564715002/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/ui.py", line 412, in load_view return load_view_str(json_str, bindings, stackframe, verbose=verbose) File "/var/containers/Bundle/Application/E4751F4F-64A4-4BE6-AB9D-9C9564715002/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/ui.py", line 398, in load_view_str return _view_from_dict(root_view_dict, g, l, verbose=verbose) File "/var/containers/Bundle/Application/E4751F4F-64A4-4BE6-AB9D-9C9564715002/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/ui.py", line 379, in _view_from_dict subview = _view_from_dict(d, f_globals, f_locals, verbose=verbose) File "/var/containers/Bundle/Application/E4751F4F-64A4-4BE6-AB9D-9C9564715002/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/ui.py", line 321, in _view_from_dict _bind_action(v, attrs.get('action'), f_globals, f_locals, verbose=verbose) TypeError: my_bind_action() got an unexpected keyword argument 'verbose'
-
@cvp Maybe you changed some parts of the code? I'm sure there is no such serious bug.
-
@lpl no change at all, but I have the new Pythonista beta...
-
@lpl could you tell me where is the code which is executed when you scroll your indexes
-
@cvp I'm using the beta too. And I shared the code to my friends. No such issues before… so strange
-
-
@lpl sure your req_data does not access internet?
Is it possible to replace your buttons by labels, title->text, only for scrolling, not for clicking, just to see if speed better?
-
@cvp Did you notice "bg"? This means backgroud, and it just send requests. And I use load_data to load the result into view.
-
@lpl ok, sorry
Do you think it is possible to replace buttons by labels if you don't tap them? -
@cvp I compared before, and no white parts with Label.
-
@lpl First, I restarted Pythonista and the error disappears, it was in module ui.py???
Could you try to comment the line where you set dynamically the action of the button
-
@lpl As I don't understand the displayed language, could you tell me what I have to do to get the indexes list?
Edit: found what I have to tap: menu top right/3rd blue line
-
@cvp Sure. https://github.com/yjqiang/yj_ebook_reader/blob/master/index_viewer/index_viewer.py#L109 I use self.cur_offset and the new offset to check whether users are scrolling down or up.
If scrolling down(the scrollbar is going down), I use https://github.com/yjqiang/yj_ebook_reader/blob/master/index_viewer/index_viewer.py#L122 to handle this. If the lastest part of the subviews is done (https://github.com/yjqiang/yj_ebook_reader/blob/master/index_viewer/index_viewer.py#L126), I will move the first part of the subviews to the end of them(https://github.com/yjqiang/yj_ebook_reader/blob/master/index_viewer/index_viewer.py#L137-L141) -
@lpl if I comment all the lines where you change .title, you are right, no blank...
-
@lpl only line 137 needs to be commented and white disappears...
-
@cvp But the function is broken… If you delete L137
-
@lpl I understand, it is only to show from which line the problem comes. It is not yet a solution...