log in | register | forums
Show:
Go:
Forums
Username:

Password:

User accounts
Register new account
Forgot password
Forum stats
List of members
Search the forums

Advanced search
Recent discussions
- Rougol January 2023 meeting - RISC OS Developments (News:)
- Rougol returns on Monday with RISC OS Developments (News:)
- WROCC January 2023 meeting - Andrew Rawnsley (News:)
- RISCOSbits announces the Desktop Dock for RISC OS laptops (News:)
- Updates for Amcog Games (News:)
- PinBoard 2 updated (News:)
- Iris browser - December 2022 update (News:)
- RISC OS Users Xmas screenshots 2022 - Norman Lawrence (News:3)
- December 2022 News Summary (News:1)
- RISC OS Users Xmas screenshots 2022 - Ralf Westenfelder (News:)
Related articles
- RISC OS Users Xmas screenshots 2022 - Norman Lawrence
- RISC OS Users Xmas screenshots 2022 - Ralf Westenfelder
- RISC OS Users Xmas screenshots 2022 - Raik Fischer (creative room)
- RISC OS Users Xmas screenshots 2022 - RISCOSbits
- RISC OS Users Xmas screenshots 2022 - Sprow
- RISC OS Users Xmas screenshots 2022 - Raik Fischer (PineBook Pro)
- RISC OS Users Xmas screenshots 2022 - Detlef Froehlich
- RISC OS Users Xmas screenshots 2022 - Andrew McCarthy
- RISC OS Users Xmas screenshots 2022 - Raik Fischer (Titanium)
- RISC OS Users Xmas screenshots 2022 - Michael Grunditz
Latest postings RSS Feeds
RSS 2.0 | 1.0 | 0.9
Atom 0.3
Misc RDF | CDF
Site Search
 
Article archives
The Icon Bar: News and features: RISC OS Users Xmas screenshots 2022 - Gerph
 

RISC OS Users Xmas screenshots 2022 - Gerph

Posted by Mark Stephens on 07:06, 20/12/2022 |
 
Over December, we will be sharing a view of our RISC OS screens as a sort of Advent Calendar. Next, we see what Gerph is up to....
 

 
The screenshot is from my macBook, running a few applications which are part of my working environment. There's SublimeText, the text editor I use, in the background of the image. Obscured by windows you can just about make out the top pane showing some small snippets from the notes for the 42nd release of RISC OS Pyromaniac, which I created an hour before this was taken. Below that is part of the source to the system variable handling of the PyromaniacGit module. On the left, you can see the names of some of the source files for the RISC OS modules, including the PyromaniacGit module.
 
On the right, at the top of the window stack, is the RISC OS Pyromaniac window which has just booted into the new release and has some commands shown. The system only claims 3MB of memory, but that's really pretty irrelevant as it's just a figure we can change in the configuration. The first command I've run clones a git repository (`git clone https://github.com/philpem/LineEditor`) from the Internet, then we list the files that have been checked out (`ex`), and finally show a few entries from the git history (`git log -n 3`). As you can see, the files have been checked out from the repository, and have the correct filetypes. And the git tool can list the history, together with colour.
 
On the of the screenshot, there's a file explorer window which is showing the contents of the directory that we just cloned. The file explorer is an interface provided by the UI for RISC OS Pyromaniac to examine the system. The explorer follows RISC OS style of Filer relatively closely, and has a context menu similar to that of the Filer. That menu is shown, together with some of the actions that can be performed by RISC OS Pyromaniac on the underlying OS. Viewing the files as text is simple, and just below the explorer window, we can see one of the files being viewed. Files can also be viewed as a hex dump, and from there can be disassembled if required.
 
The task bar at the bottom of the screen shows the burning cog logo for RISC OS Pyromaniac, and the top menu bar shows the various tools that you can apply to the system. Modules, Dynamic Areas and AMBs can be displayed as hex dumps or disassemblies, various live system information can be shown through the View menu, and parts of the system can have debugging enabled whilst they're running.
 
The Git repository shown is LineEditor, and you can also see that there is a `/robuild/yml` file present in the directory. That file describes how the project is built on the RISC OS Build service, which provides simple testing for the module on every commit.
 
The different dumping formats, and explorer we added in the past few months. The PyromaniacGit module was created in July 2020, but hadn't been touched since then until I dusted it off last week. It's now gained tests and is merged into the released version. RISC OS Pyromaniac 7.42 will appear on shell.riscos.online and build.riscos.online at some point in December.
 
It is not too late, if you would like to send in a picture of your RISC OS screen (maybe even with some as yet unreleased software to tease us). Full details are here
 
  RISC OS Users Xmas screenshots 2022 - Gerph
  gerph (18:22 20/12/2022)
  gerph (23:54 20/12/2022)
    nytrex (18:10 23/12/2022)
      gerph (14:07 26/12/2022)
        gerph (14:26 26/12/2022)
 
Charles Justin Ferguson Message #125376, posted by gerph at 18:22, 20/12/2022
Member
Posts: 33
Sorry for small typos in the text - 3rd paragraph should read 'On the *left* of the screenshot', and the 6th paragraph should read 'The different dumping formats, and explorer *were* added in the past few months'.

The PyromaniacGit implementation is now very functional, and I'll write more about it soon. Although it wasn't mentioned here, I use Linux on my work machine, and Pyromaniac works just as well on there as it does on macOS. So although macOS is my working environment generally, it's not that different on Linux.
  ^[ Log in to reply ]
 
Charles Justin Ferguson Message #125377, posted by gerph at 23:54, 20/12/2022, in reply to message #125376
Member
Posts: 33
The shell server at https://shell.riscos.online/ has now been updated with the latest version of RISC OS Pyromaniac which includes the functional PyromaniacGit module. This allows regular git operations to be performed, from within RISC OS. I'll write more about what you can do and how it works later, but it is there and it works.

Not all commands are supported, and within the commands, not all switches. However, most work just as you would expect.


*help git
==> Help on keyword 'Git' (PyromaniacGit)
Interface to the host 'git' command. This command must be supplied a command
which many different parameters. More information on the options can be found
through the help command:

*Git help - lists the available commands.
*Git help <command> - lists options for a command.

The operation of the git command is based on that of the host system. Whilst
the interface has many limitations, it should be able to be used in a similar
way to the standard version. Filenames should be able to be specified in RISC
OS format and will be translated to the host format.

To function, many of the environment variables from the original system have
been mapped to a form more like the manner that RISC OS functions. These
variables and their translation are described in '*Help GitVariables'.

For more information on the meaning of the options for commands, please refer
to the standard documentation (https://git-scm.com/docs).

Commands:
add Add file contents to the index
annotate Annotate file lines with commit information
blame Show what revision and author last modified each line of a file
branch List, create, or delete branches
checkout Switch branches or restore working tree files
cherry-pick Apply the changes introduced by some existing commits
clean Remove untracked files from the working tree
clone Clone a repository into a new directory
commit Record changes to the repository
describe Give an object a human readable name based on an available ref
diff Show changes between commits, commit and working tree, etc
fetch Fetch from another repository or a local branch
help Display help for a given command
init Create an empty Git repository or reinitialize an existing one
log Show commit logs
merge Join two or more development histories together
mv Move or rename a file or directory
pull Fetch from and integrate with another repository or a local branch
push Push to a remote repository
rebase Reapply commits on top of another base tip
reflog Manage reflog information
remote Manage set of tracked repositories
reset Reset current HEAD to the specified state
rev-parse Pick out and massage parameters
rm Remove files from the working tree and from the index
show Show various types of objects
stash Stash the changes in a dirty working directory away
status Show the working tree status
switch Switch branches
tag Create, list, and delete tags on objects
version Report the version of git on the host and RISC OS system

Syntax: *Git <command> [<options>]


For example, the commit command only supports some of the operations:


*git help commit
Syntax: Git commit <options>

Record changes to the repository

positional arguments:
FILES

optional arguments:
--help, -h
--all, -a
--short
--branch, -b
--long
--ahead-behind
--no-ahead-behind
--renames
--no-renames
--signoff, -s
--allow-empty
--allow-empty-message
--amend
--include, -i
--only, -o
--verbose, -v
--dry-run
--quiet, -q
--status
--no-status
--date DATE
--file FILE, -F FILE
--message MESSAGE, -m MESSAGE


Filenames should be specified in RISC OS form. Branch and tag names should be specified in the local alphabet and will be converted to UTF-8. If you want to play, create a directory on the server with your name - as it's a shared server - and work inside it, eg:


*cdir gerph
*dir gerph
*git init
Initialized empty Git repository in /home/riscos/fs/gerph/.git/
*edit MyFile
(write some text - exit with shift-ctrl-x)
*git status
On branch master

No commits yet

Untracked files:
(use "git add <file>..." to include in what will be committed)

MyFile

nothing added to commit but untracked files present (use "git add" to track)
*git add MyFile
*git commit
(write a description - exit with shift-ctrl-x)
[master (root-commit) 0c83967] My new description.
1 file changed, 2 insertions(+)
create mode 100644 MyFile
  ^[ Log in to reply ]
 
Alan Robertson Message #125379, posted by nytrex at 18:10, 23/12/2022, in reply to message #125377
Member
Posts: 75
Wow. Is this a native Git solution for RISC OS? Or does is it a wrapper of some sort that utilizes the host's Git program?

Either way, it's very clever and impressive.
  ^[ Log in to reply ]
 
Charles Justin Ferguson Message #125381, posted by gerph at 14:07, 26/12/2022, in reply to message #125379
Member
Posts: 33
Wow. Is this a native Git solution for RISC OS? Or does is it a wrapper of some sort that utilizes the host's Git program?

Either way, it's very clever and impressive.
This is a wrapper to the host git. I'm in the process of writing up some documentation and then I'll do a 'play along' description of how it works. It's largely intended for use with the shell as a demonstration and within CI to make it easy to perform operations that would otherwise need to be done on the host side. But it's also intended to make it easy for people to see how git works within a RISC OS environment.

As for how it works... yes, it calls down to the host git, processes the output and presents it to the user as RISC OS output.

I created a couple of diagrams after it was working to show how it fits together:

Sequence chart for PyromaniacGit commands

* User types commands.
* They're transformed into things that can be used by the host system's git tool.
* The git command is executed.
* Output is parsed for ANSI codes.
* ColourTrans operations are performed
* Output is transformed from UTF-8 to current alphabet.
* Output is written to VDU.

All the while checking for escape.

There's a slightly more complicated process when the user wants to provide authentication details by inputing their user name and password to the host git tool, but I suspect that most people won't care about that level of detail about how it's made to work smoothly.
  ^[ Log in to reply ]
 
Charles Justin Ferguson Message #125382, posted by gerph at 14:26, 26/12/2022, in reply to message #125381
Member
Posts: 33
I'm in the process of adding call outs to the host UI for requesting user name and password details (again, this is probably way more than anyone else would care for, but I love being able to provide an integration with the host environment).

Under RISC OS Pyromaniac, different ways of doing things are provided through 'implementations'. The default implementation usually does nothing, or does something simple, but these can then be extended by providing a new implementation which does more fancy things. In the case of the 'askpass' code I'm working on, I intend that to be a window that prompts for the details when you run in the UI.

I've just managed to get the initial 'readline' implementation working. This takes the code that was inline which called OS_ReadLine and instead moves it to be inside an implementation. And it's working!

This is how it looks when it's working - it's not that exciting, though:


charles@laputa ~/projects/RO/pyromaniac (master)> pyrodev --gos
Supervisor

*git fetch
Username for 'https://gitlab.gerph.org': gerph
Password for 'https://gerph@gitlab.gerph.org': ******
remote: HTTP Basic: Access denied
fatal: Authentication failed for 'https://gitlab.gerph.org/riscos/pyromaniac.git/'


The username and password prompts are provided by the Python implementation which calls standard RISC OS interfaces to perform the operations. The implementation of the request looks like this:


password = False
if reqtype == 'string':
password = False
elif reqtype == 'password':
password = True
else:
raise ValueError("Request type '{}' not supported".format(reqtype))

# If the prompt didn't end in a space, let's tidy it up so that it looks nicer.
if not reqprompt.endswith(' '):
reqprompt += ' '

# We've been given unicode, but actually we're just passing back to RISC OS,
# so we need to convert back.
reqprompt = self.encode(reqprompt)

self.ro.kernel.write(reqprompt)
response = self.ro.kernel.api.os_readline(None, password=password)

# The response needs to be returned as unicode, even though it'll be decoded
# immediately. But handle Escape separately.
if response is not None:
response = self.decode(response)

return response



Which probably isn't that exciting to people, but I think it's kinda cute.

Of course, after doing this I need to commit the code that changed, so I can start doing that under RISC OS as well:


*git checkout -b request-input-implementation
Switched to a new branch 'request-input-implementation'
*git add riscos.requestinput/py
*git add riscos.requestinputimp
*git status --untracked=no
On branch request-input-implementation
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
new file: riscos/requestinput.py
new file: riscos/requestinputimp/__init__.py
new file: riscos/requestinputimp/readline.py

Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: riscos/kernel.py
modified: riscos/pymods/pyromaniacgit/githelper.py
modified: riscos/texteditor.py

Untracked files not listed (use -u option to show untracked files)


What you can see here is that I created a new branch and switched to it, then added the new files that I've created. Because I'm inside RISC OS the filenames are added with git add using their RISC OS filenames. The second add is of a directory, so all the files within that directory are added.

Finally, I list the status of the repository (but ignore the untracked files - there's lots of test and experimental files in my working directory), and this shows up the limitations of this git tool. The filenames appear as host format, rather than RISC OS format. For now that's fine as this isn't meant to be perfect, but obviously any real port would be showing you filenames in RISC OS format. In the future I might add post-processing to allow that to work.

I've also made changes to the text editor because whilst I was doing this I noticed some slightly unsafe configuration.

Anyhow, that's a little of how it works, and of using it in anger.
  ^[ Log in to reply ]
 

The Icon Bar: News and features: RISC OS Users Xmas screenshots 2022 - Gerph