Any chance on addin a theme element for the stderr console text? The dark red is hard to read with some of the dark themes.
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.
Posts made by robnee
-
RE: New Beta for Pythonista 3.3
-
Specifying stderr color in theme
Is there a way to set the stderr color used for trace backs via the theming engine? The default red color does not work well on dark backgrounds for me. Maybe it's my eyes but I can't read it. I don't see an obvious option for this though. Thanks.
-
RE: sys.argv when using the debugger
Thanks for sharing this JonB. This technique looks handy. I will give this a try.
-
RE: Breakpoints in multiple modules
Thanks. At least I'm not crazy. This really limits the usefulness of the debugger. Sometimes the call chain can be complex and stepping to get to the code I need to look at isn't feasible. I might try a few more things and report back.
-
sys.argv when using the debugger
Is it possible to debug a program that requires command line arguments via sys.argv? This behaves differently when launched via Run vs Debug (after setting a breakpoint) and the command line arguments, when specified, are lost.
Import sys Print(sys.argv)
-
RE: Breakpoints in multiple modules
Can anyone confirm whether one can set breakpoints in a project with multiple modules?
-
Breakpoints in multiple modules
Is there a trick to setting breakpoints across modules? If I have a python file, a.py that imports b.py and I set a breakpoint in b.py when I run a.py the breakpoint does not fire for me. The code in b.py runs fine. Just the breakpoint isn't firing Is there a way to use the debugger here? What am I missing?
Thanks if you can help.
-
RE: ImportError
I was able to work around a similar problem without needing to move the project from Working Copy to Pythonista using a custom import hook. It's a hack but it works for me. Each file seems to need to be opened by Pythonista in it's external location at least once before importing via the hook will work.
-
RE: ImportError
Are your modules in an external app such as Working Copyand you are trying to import them? Is that the external files you mention, an external file provider? There’s a limitation to those because even if the path is set properly iOS limits searching of a file providers files. There are some ugly workarounds for that though
-
RE: Disable stop button (X) in Scene
Hide_title_bar does not work for me. Not sure why people recommend it.
This is a solution I came up with.
class MyScene(scene.Scene): def setup(self): self.label = scene.LabelNode('Test hide title bar', position=self.size/2, parent=self) self.hide_close() def hide_close(self, state=True): from obj_util import ObjCInstance v = ObjCInstance(self.view) # Find close button. I'm sure this is the worst way to do it for x in v.subviews(): if str(x.description()).find('UIButton) >= 0: x.setHidden(state) scene.run(MyScene())
-
Abandonware?
Is Editorial still supported? It doesn't seem to be updated anymore.
-
RE: Is it possible to hide the 'Stop' cross in the upper lefthand corner?
def hide_close(self, state=True): from objc_util import ObjCInstance v = ObjCInstance(self.view) for x in v.subviews(): #if 'UIButton' in x.description(): if str(x.description()).find('UIButton') >= 0: x.setHidden(state)
This works better for me.
-
RE: Sticky exception when thrown inside Scene.controller_changed
Phuket2,
No problem! I just felt like maybe I did a bad job of explaining my question so I wanted to restate. Thanks for offering to help. It why were all here :)
-
RE: Sticky exception when thrown inside Scene.controller_changed
Yes. I know there is a bug in the program. It's specifically designed to throw uncaught exceptions. Once an exception is thrown inside the controller_changed function however, it is remembered. Even after you fix the bug, any way you like perhaps by quoting the word 'bug', the exception will still be thrown with a reference to the old argument to print. You must force-quit Pythonista in order to reset the interpreter to make the code run again. The same thing does not seem to happen with touch_began. If you run, get the exception in touch_began, fix the bug, rerun, and tap the exception will not reoccur. Of course, this is the expected and desired behavior. It's something peculiar to controller_changed that seems to be the problem. Please try and see if this same thing happens to you.
Rob
-
Sticky exception when thrown inside Scene.controller_changed
I have a problem with Pythonista where, if I have a bug in my Scene.controller_changed function even after the bug is fixed the old exception will still be thrown every time controller_changed is called. This can be reset by force-quitting Pythonista. It's annoying because it makes you think your bug fixes aren't working.
I'm happy to file an Issue for this but I thought it might be a good idea to ask if someone else can reproduce this. Notice the code below has two undefined name bugs. If you run this code you will get an exception on screen touch and pressing 'X' on a MFI controllers. Do this. Then fix both bugs by replacing bug with dog. Now when you run and tap the screen you should get a little 'woof' in the lower left-hand corner of the screen. However, when you press 'X' on a controller the old exception will still be thrown.
Can someone with a MFI controller please try this and see if you can reproduce this?
Rob
'''This is trying to demonsrate a problem in Pythonista where an exception thrown inside controller_changed becomes "sticky" and will be rethrown even after the problem code is fixed. ''' import scene dog = 'woof' class MyScene (scene.Scene): def touch_began(self, touch): print(bug) def controller_changed(self, id, key, value): if key == 'button_x' and value: print(bug) if __name__ == '__main__': scene.run(MyScene())
-
RE: Disable on screen printing in Scene/SceneView
abcabc,
Interesting. I will give this a try as well. Thanks for your help!
Being able to twiddle with the objective C under the hood in Pythonista is fascinating.
Rob
-
RE: Disable on screen printing in Scene/SceneView
abcabc, this does work although it's not exactly what I want because now the iOS titlebar is visible.
In the spirit of the answer to the original question I have managed to hack together a solution. It's ugly but I'm sure someone with more iOS and objective C experience can improve it. hide_close can both hide and show the close button. Note: once hidden the two finger swipe down does not seem to work so there is no way to close the scene.
class MyScene(scene.Scene): def setup(self): self.label = scene.LabelNode('Test hide title bar', position=self.size/2, parent=self) self.hide_close() def hide_close(self, state=True): from obj_util import ObjCInstance v = ObjCInstance(self.view) # Find close button. I'm sure this is the worst way to do it for x in v.subviews(): if str(x.description()).find('UIButton) >= 0: x.setHidden(state) scene.run(MyScene())
-
RE: Disable on screen printing in Scene/SceneView
hide_title_bar doesn't seem to work for me. I stripped it down to the example below. Am I doing something silly? I still get the close X in the upper right. I've even tried to figure this out by looking at the scene module source but no luck so I thought I'd ask here.
from scene import * def run2(scn): sv = SceneView() sv.scene = scn sv.present(hide_title_bar=True) run2(Scene())
-
RE: Disable on screen printing in Scene/SceneView
I should have mentioned that I am using Pythonista 3.0. I thought the hide_title_bar trick only worked in 2.0? I'll have to try...
-
RE: Disable on screen printing in Scene/SceneView
Can one also disable, move or alter the application close "X" in SceneView using a similar technique?