TBrowser alternative for non-X11 mode

Hi all,

OK, I’ve now have a single c++ compiled binary with a small help:

usage: rootbrowsetty [-h] ROOTFILE...

The updated tag is here:
atlas-dduschin-ROOTTermBrowser-00-01-07.r472.tar.gz (12.1 KB)

And yes, I take care of the maintenance of this code.

Cheers,
Dirk

From your “src/ROOTTermBrowser.cpp”, remove everything from “PANEL* p …” up to “delete dummy_c;” (I have no idea why you claim it is needed).
Also, try:
if ((arg == “-h”) || (arg == “-?”) || (arg == “–help”) || (arg == “–usage”))

Also may be add one description line when you use “-h”. See how it is done with rootls.

can the colors be customised ? If yes, how ?

I remember that paw had tty oriented graphics. Are you going to reimplement it in root (i.e. a new tty graphics backend)?

with the last version when you type “h” in the browser to see the internal help it shows nothing.
It worked before for me…

Hi all,

thanks for all your comments. I’ve made it possible to invoke cmt line help via -h, --help, -? or --usage. I also expanded the help to look like the help from rootls.

I also fixed the in program help, sorry for that.

Regarding the mysterious code in src/ROOTTermBrowser.cpp, I’m not sure why this was needed, actually I wrote most of the code long time ago with root 3.14 and I think there was a problem with the compilation. I removed it as it compiles fine anyways.

About customizable colors, this is not implemented so far. I’ve just made it to work in my terminal :wink: and it’s color scheme, but this definitely is something that should be implemented.

Cheers,
Dirk
atlas-dduschin-ROOTTermBrowser-00-01-08.r475.tar.gz (12 KB)

I think you need to edit a bit the copy/paste you did from rootls …
:wink:

$ rootbrowsetty -h
usage: rootbrowsetty [-h] FILE [File ...]

Display ROOT files with a tty alternative to the TBrowser

positional arguments:
  FILE               Input file

optional arguments:
  -h, --help         show this help message and exit

Examples:
- rootls example.root
  Browse contents of the ROOT file 'example.root'.

- rootls file1.root file2.root
  Browse contents of ROOT files 'file1.root' and 'file2.root'.

- rootls *.root
  Browse contents of ROOT files whose name ends with '.root'.

one can see “rootls” in many places…

Why the lines around the help box looks nicer that the lines used to plot the histos ?
(see pictures)




Hi,

yeah, apparently I was a bit sloppy :slight_smile:. fixed it.

The lines in the browser, I mean the panels and the separating line, as well as the help window are made with special characters. However, the histograms are actually produced by an eps parsing algorithm. The whole procedure is that when you klick on an entry in the panel and it’s a TCanvas/TH1/TBranch it is drawn and/or saved to an eps file, which is parsed back and searched for lines/polygons. Then the lines are drawn with an approximation of the original orientation which is necessary for rotated lines (for example for a TGraph, which reminds me, that they cannot be drawn right now, which is easy to implement though). OK, one could optimize the code for exactly horizontal/vertical lines and maybe also for corners, but then graphs might not always look consistently bad :wink:.

Cheers,
Dirk
atlas-dduschin-ROOTTermBrowser-00-01-09.r479.tar.gz (12 KB)

Thanks for the clarification :slight_smile:

Hi all,

I’ve now fixed the help output and fixed a bug for multiple file imports.

Cheers,
Dirk
atlas-dduschin-ROOTTermBrowser-00-01-10.r483.tar.gz (11.9 KB)

Thanks :slight_smile: we will decide in the next root meeting if we put it in the standard distribution.

After discussion with the ROOT team it was decided that the implication as you did it can stay as a tar file people can pick from the forum when they need it.
It was also said that the proper implementation in ROOT would be to have a special option in Dump() or Print(). Then, when done, the rootbrowsetty command could be a python script based on this.

Hi,

ok, but I’m not sure if I understood how the rootbrowsetty should be connected to Dump() or Print(). Can you please clarify that?

Thanks,
Dirk

that would mean including you code in root. For instance now Print does:

root [1] hpx->Print()
TH1.Print Name  = hpx, Entries= 25000, Total sum= 24997
root [2] 

We can imagine to have an option to Print showing the tty plot.

root.cern.ch/doc/master/classTH … 8d7a7fc40c

Hi,

ok, that should be possible, however I think the rootbrowsertty is a bit overhead for this. There is also a binary, which is compiled with the package, that directly draws eps file to the terminal window (EpsDrawToTerm). I think this would be an easier solution, to wrap that code into the Print/Dump function.

What do you think?

Cheers,
Dirk

Ok in that case we can leave it as a tar file here and people who need it can just take it from here. It is easy to install. If later on a large number of people would like to have it distributed with root we can consider including in the distribution.

Ok, will this be advertised somewhere? I mean the usual user will not go through the forum and search for new stuff just in case he might need it at some point.

Cheers,
Dirk

You out it in the part of the forum where people pout new apps… “My ROOT App”… so that’s public already