My RISC OS resources and Pyromaniac technologies
Charles Ferguson (8243) 427 posts |
A couple of people had commented in a thread that they’d missed the resources that I’d published over the last few years to help with, or as part of, RISC OS Pyromaniac. So I thought I’d point people to the technologies page – https://pyromaniac.riscos.online/technologies.html – and very quickly go through the things that have been made available on there, and referenced from other places. Plus a couple that weren’t referenced in public but have been made public on Github. Web services:
RISC OS-specific releases:
Non-RISC OS releases:
And in addition to released code and documentation, there is general information on the projects that I have worked on, or areas that I give attention to:
|
Peter Howkins (211) 236 posts |
Is there anywhere specific you would like bug reports for this? As here is a simple one *BASIC produces a python backtrace pointing to a failure to cap the colour numbers to the ones available in the current mode. In general I’m afraid I’ve not paid that much attention to Pyromaniac for a few reasons; a) It’s not open source. I have nothing really against the project and I hope it keeps you entertained. |
Charles Ferguson (8243) 427 posts |
a) it will be open once people start using it – as I have said many times before, until people actually start using it and give me confidence in it, it’ll remain as it is. ACE bug report though… I honestly don’t understand how that’s managed to get through :-) Thank you. |
Charles Ferguson (8243) 427 posts |
Feel free to raise future bugs at: https://github.com/gerph/riscos-pyromaniac-issues As for the bug you raised, that’s an issue with the ansitext implementation of the VDU system, failing to handle the colour selection in the correct order. The code is now fixed locally and will appear in the next release. The code was extracting the colour from the palette /before/ the derived class had vetted it and converted the number to the correct value for the mode and tint. |
Cameron Cawley (3514) 158 posts |
I’ve been trying this out and it seems to be working well for the most part. I do have a few observations, though:
|
David J. Ruck (33) 1636 posts |
Just had a look at the risos-filer-python as I’ve just ported something using wxPython, and I’m shocked, shocked I tell you, to find it’s Python 2 code – in this day and age! |
Charles Ferguson (8243) 427 posts |
RISC OS Pyromaniac is currently Python 2, so a lot of the components focus on working with Python 2. That said, I try whereever possible to make the code function just fine on Python 2 or 3. Your bug, https://github.com/gerph/riscos-filer-python/issues/1, has now been fixed and the change pushed. It’s likely that the other components have similar issues with Python 3, but I’ll fix them as I come to them. Thanks for raising this – despite the fact that it took a few hours to get a working wxPython + Python 3, it’s better for at least working on Python 3. Testing was against Python 3 and wxPython 4.1.1 Screenshot of it running in Python 3 attached to the issue. |
Charles Ferguson (8243) 427 posts |
The newer sprite mode words aren’t supported at present as the module was written in 2002.
It’s a renderer, so the resolution of the image isn’t actually it’s job. It’s there to render, and to tell you how much space that the rendering takes. That said, such information might be able to be made available through a developer query to the system if it was useful. I’m not sure that it is, as some image files don’t have a resolution – they might have bounding boxes, but then they also might not. The HTML renderer has this issue, as I recall.
In the documentation you’ll see reference explicitly to the DPI that’s used. I’m not convinced that this is correct or that the module is correct. Feel free to check my logic here (and what it’s reporting) – ‘a very large DPI’ doesn’t really help me understand what you’re seeing and whether it’s right, because what you think is large might not be wrong… Anyhow… from the PRM… “OS units are notionally 1/180th of an inch, and are the standard units used by the VDU drivers for specifying output to the screen.” “Internally, Draw uses a coordinate system the units of which are 1/256th of an OS unit. We shall call these internal Draw units.” Thus it follows the the minimum size of a unit in a DrawFile is 256 * 180 DPI, which is 46080. I believe certain versions of the text had this value at 2048, but from the above, I believe 46080 is the correct DPI for a DrawFile. Is that the value that you’re seeing? And does my reasoning for that value make sense, or is there something else that I’ve missed?
RISC OS 3.1 isn’t something I care about. If it works on there, great, but I don’t have any system for testing it or any interest in doing so. Obviously applications should load the resources they will need – they would also need to load the AWRender module to use the artworks renderer, the relevant ImageFileConvert modules if they want to use those resources, and Euclid if it wanted to draw the Euclid files (with the appropriate renderer files). It’s arguable that we could disable the registration if DrawFile wasn’t there, but DrawFile doesn’t have an announcement that it has arrived or left, so this could not be done reliably.
Maybe, if there was any interest. The only reason for releasing IFR was because I wanted to make the presentation tool useful to people. That was 2 1/2 years ago and nobody has shown any interest in either the presentation tool or IFR until now… |
David J. Ruck (33) 1636 posts |
Gerph wrote:
There’s always a few gotchas with code which is supposed to work on both, when you actually try to use it on both.
Great, that’s working well under Python 3 now. Could do with an option to hide hidden files on Linux though, have to skip past lots of dot something at the top of every directory.
I’ve just spent the last 2 months porting and pylinting 54,000 lines of Python 2, which contained about a dozen wxPython 2.8 apps which I’ve made work with 4.1.1 – it didn’t involve quite as many changes as I first thought. Only 29,000 lines to go, but no more wxPython. By the way the pylinting is far more work than the porting (even skipping most naming niggles and loosening the design limits considerably), and I suspect that would be the case for Pyromaniac too. |
Charles Ferguson (8243) 427 posts |
Yeah; it’s not great when you’ve assumed things’ll be fine and didn’t even bother testing, as was the case with the filer code there. I guess the dump code will have similar issues. With things like the longtraceback (https://gitlab.gerph.org/gerph/longtraceback) I’ve at least got dedicated tests to exercise both Python 2 and Python 3, but haven’t done so for The Filer… it’s actually probably quite amenable to testing at least the virtual VS code so I should probably do that.
I’m thinking the best way to do that would be for the FS enumeration to allow a filter to select what’s displayable, and either having a callback function to perform the filtering, which you can register, or making it a class member that you override. That way you can then provide a nice menu option to filter out classes of files (eg dot files, but also by filetype, size or whatever you wanted). It hadn’t been a consideration as Pyromaniac doesn’t generally need that kind of thing for its Filer display of the RO content.
That’s pretty fun (!). The wxPython side doesn’t seem too bad, but there’s always that transition from strings to unicodes that is the hardest part, IME. And for Pyromaniac the vast bulk of the code is Python 2 str-used-as-bytes, so it’s not a simple thing. Plus there’s some metaclass stuff that’s a bit tedious. |
David J. Ruck (33) 1636 posts |
That is the main issue for this API stuff too. I’ve gone with treating all the things which were strings under Python2 as bytes to maintain binary compatibility, and only converting them to/from UTF-8 strings when they interact with the console, logs or user interfaces. The key thing to watch out for is when you now don’t need to use |
Charles Ferguson (8243) 427 posts |
Yup, I’ve just fixed the |