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.
Segmentation fault using dialogs
-
@bosco issue #2 is fixed.
-
Just wanted to say we're encountering issues with the built-in
dialogs
module here too.My iPad is still on ipadOS 15, but one of my co-developers is using ipadOS 16 and he sees freezes followed by segmentation faults when the UI tries to show a dialog box using that module.
This is during testing of the "big move" of our codebase from pythonista3.3 to pythonista3.4 and python2 to python3, so we thought at first it was something we were doing, but based on this thread, I think it may definitely be a bug in the dialogs module.
-
@omz @LankyDonkey @shinyformica
I have created a new issue here: Pythonista-Issues #707. -
@LankyDonkey Hello!
You may want to try with a @ui.in_background decorator.@ui.in_background def search_button_tapped(self,sender): form_list_of_sections = [] search_dicts = []
Also, I have created a more complete dialogs replacement that might work for you here:
https://gist.github.com/sbbosco/cb44f88960c16a33704cc9f92980a113You can test the replacement module with this script:
import sys, os, time from datetime import datetime import ui import dialogs # from uidialogs import dialogs """ test for modified dialog module: https://gist.github.com/sbbosco/cb44f88960c16a33704cc9f92980a113 """ today = datetime.now() sections = [('Special Filters', [{'key': 'limit', 'title': 'Artist Limit (0 for None):', 'type': 'number', 'value': '30'}, {'key': 'switch', 'title': 'Switch: ', 'type': 'switch', 'value': True }, {'key': 'date', 'title': 'Date: ', 'type': 'datetime', 'format': '%m-%d-%Y %H:%m', 'style': 'inline', 'value': today }, {'key': 'country_count', 'title': 'Country Count: ', 'type': 'check'}, {'key': 'best_artists', 'title': 'Best Artists: ', 'type': 'check'}, {'key': 'best_albums', 'title': 'Best Albums: ', 'type': 'check'}, {'key': 'best_genres', 'title': 'Best Genres: ', 'type': 'check'}, {'key': 'best_years', 'title': 'Best Years: ', 'type': 'check'}, {'key': 'best_decades', 'title': 'Best Decades: ', 'type': 'check'}, {'key': 'one_hit_wonders', 'title': 'One Hit Wonders: ', 'type': 'check'} ]), ('Year Range', [{'key': 'year_from', 'title': 'Year From:', 'type': 'number', 'value': '1990'}, {'key': 'year_to', 'title': 'Year To: ', 'type': 'number', 'value': '2022'}, {'key': 'one_song', 'title': 'One Song: ', 'type': 'check', 'value': False}, {'key': 'missing_song_info', 'title': 'Missing Song Info:', 'type': 'check', 'value': False}, {'key': 'song_info', 'title': 'Song Info:', 'type': 'check', 'value': False}, {'key': 'sub_and', 'title': 'Subgenre AND:', 'type': 'check', 'value': False}, {'key': 'xmas', 'title': 'Include Xmas Songs?', 'type': 'check', 'value': False}, {'key': 'pos_from', 'title': 'Pos From: ', 'type': 'number', 'value': ''}, {'key': 'pos_to', 'title': 'Pos To:', 'type': 'number', 'value': ''}, {'key': 'missing_pos', 'title': 'Missing Pos:', 'type': 'check', 'value': False}, {'key': 'us_pos_from', 'title': 'US Pos From: ', 'type': 'number', 'value': ''}, {'key': 'us_pos_to', 'title': 'US Pos To:', 'type': 'number', 'value': ''}]), ('Rating', [{'title': '3', 'type': 'check', 'value': True}, {'title': '4', 'type': 'check'}, {'title': '5', 'type': 'check'}]), ('Speed', [{'title': 'S5', 'type': 'check'}, {'title': 'S4', 'type': 'check'}, {'title': 'S3', 'type': 'check'}, {'title': 'S2', 'type': 'check'}, {'title': 'S1', 'type': 'check'}, {'title': 'Missing', 'type': 'check'}]), ('Popularity', [{'title': '[10]', 'type': 'check'}, {'title': '[9]', 'type': 'check'}, {'title': '[8]', 'type': 'check'}, {'title': '[7]', 'type': 'check'}, {'title': '[6]', 'type': 'check'}, {'title': '[5]', 'type': 'check'}, {'title': '[4]', 'type': 'check'}, {'title': '[3]', 'type': 'check'}, {'title': '[2]', 'type': 'check'}, {'title': '[1]', 'type': 'check'}, {'title': '[0]', 'type': 'check'}]), ('Charts', [{'title': '50s', 'type': 'check'}, {'title': '60s', 'type': 'check'}, {'title': '70s', 'type': 'check'}, {'title': '80s', 'type': 'check'}, {'title': '90s', 'type': 'check'}, {'title': '2000s', 'type': 'check'}, {'title': '2010s', 'type': 'check'}, {'title': '2020s', 'type': 'check'}]), ('Genres', [{'title': 'Rock', 'type': 'check'}, {'title': 'Pop', 'type': 'check'}, {'title': 'Indie', 'type': 'check'}, {'title': 'Rap', 'type': 'check'}, {'title': 'Thrash', 'type': 'check'}, {'title': 'Country', 'type': 'check'}, {'title': 'Dance', 'type': 'check'}, {'title': 'Disco', 'type': 'check'}, {'title': 'Soul', 'type': 'check'}, {'title': 'Post-punk', 'type': 'check'}, {'title': 'Punk', 'type': 'check'}]), ('Sub Genres', [{'title': 'Aor', 'type': 'check'}, {'title': 'Modernindie', 'type': 'check'}, {'title': 'Modernrock', 'type': 'check'}, {'title': 'Summer', 'type': 'check'}, {'title': 'Classicrock', 'type': 'check'}, {'title': 'Northernsoul', 'type': 'check'}, {'title': 'Indierock', 'type': 'check'}, {'title': 'Drumnbass', 'type': 'check'}, {'title': 'Funk', 'type': 'check'}, {'title': 'Hairmetal', 'type': 'check'}, {'title': 'Blues', 'type': 'check'}, {'title': 'Reggae', 'type': 'check'}, {'title': 'Breakdance', 'type': 'check'}, {'title': 'Garage', 'type': 'check'}, {'title': 'Heavymetal', 'type': 'check'}, {'title': 'House', 'type': 'check'}, {'title': 'Cheese', 'type': 'check'}, {'title': 'Billy', 'type': 'check'}, {'title': 'Grime', 'type': 'check'}, {'title': 'Rare', 'type': 'check'}, {'title': 'Yachtrock', 'type': 'check'}, {'title': 'Synthpop', 'type': 'check'}]), ('Occasions', [{'title': 'Christmas', 'type': 'check'}, {'title': 'Bonfire', 'type': 'check'}, {'title': 'Halloween', 'type': 'check'}, {'title': 'Birthday', 'type': 'check'}]), ('Tempo', [{'title': 'Slow', 'type': 'check'}, {'title': 'Normal', 'type': 'check'}, {'title': 'Fast', 'type': 'check'}, {'title': 'Not slow', 'type': 'check'}])] def display(playlist_filter): result = dialogs.datetime_dialog(title='Date', done_button_title='Done', style='inline') print('result', result) print('form dialog standard') diag = dialogs.form_dialog(title = 'Song Filter', sections=sections) print('done') return diag @ui.in_background def button_tapped(sender): #result = display(None) result = dialogs.form_dialog(title = 'Song Filter', sections=sections) if result: print(result['year_to']) print(result['switch']) print(result['date']) print(result['3']) dialogs.alert('Result', 'Success') else: dialogs.alert('Result', 'Failed') if __name__ == '__main__': view = ui.View() view.name = 'Dialog Test' button = ui.Button(title='Tap me!') button.background_color = 'gray' button.tint_color = 'white' button.frame = (10, 10, 200, 100) button.action = button_tapped view.add_subview(button) view.present('fullscreen')
-
@LankyDonkey
You may be able to run your dialogs in a new thread and save the @ui.in_background for the playback.from threading import Thread, current_thread def _in_background(fn, *args, **kwargs): d1 = Thread(target=fn, args=args) d1.start() def in_background(fn): def run(*args, **kwargs): def _run(): return fn(*args, **kwargs) if current_thread().name.startswith('Dummy'): return _in_background(_run) else: return(fn(*args, **kwargs)) return run @in_background def search_button_tapped(self,sender):
-
@LankyDonkey Glad to hear it was helpful.
-
@LankyDonkey @bosco glad to see a real post, drowned in an ocean of spams
-
@cvp I agree!!! I almost give up on this forum. I hope your continued presence here indicates that your health is headed in the right direction.
-
@bosco said
I hope your continued presence here indicates that your health is headed in the right direction.
Thanks, and it is true and false at the same time. After weeks of antibiotics due to lung infections, things seem to be getting better but every six months, a petscan is necessary to check for the absence of metastases from my original cancer. So, permanent stress which implies a lack of motivation and courage to concentrate on the two important programs that I developed in Pythonista at the request of @ihf (outline) and @shinya.ta (flick button keyboard).
-
@LankyDonkey said
Do we know if Ole is still actively involved in the product?
normally I would say no but the latest update 3.4 arrived so long after the previous one that it is difficult to deduce anything from this delay
As for my health, I have nothing to complain about. Thanks for asking.