[Pipet Devel] Attempt at Constructing the Command Line

Brad Chapman chapmanb at arches.uga.edu
Sun Jan 16 14:41:59 EST 2000


Hello, wild and wonderful Locians;
	I have just uploaded to the ever-expanding loci-file my first
attempt at "constructing the command line." (To use Jeff's words)
Basically, this is just an attempt to make UNIX style command lines within
the Loci workspace. I have managed to get my idea of Jeff's vision of this
working for everyone's favorite UNIX command, ls. Here is how to take a
look at it:

1. Check out the just uploaded loci-file from cvs. There are some new
directories added
2. Change into the top level directory and type "./testgui.py" to fire up
the Loci workspace. You probably want to resize the workspace to be larger
for everything that follows.
3. Right click and add a "composite" widget to the workspace
4. Double click with the left mouse button on the composite locus to open
up the workspace belonging to this composite locus (the beautiful workspace
within a workspace is courtesy of Jeff).
5. Right click within this new "inner" workspace and add a processor loci
to it. This is kind of tricky--you have to look at the composite locus and
be sure it is currently selected (has a blue box around it). Otherwise you
can accidentally add the processor to the main workspace. If this happens,
no big deal, just keep trying until you add a processor to the "inner"
workspace.
6. Double click on the processor locus. This will open up a chooser type
widget allowing you to pick a program. The programs are grouped within a
tree, with the programs inside "modules" that describe the program. In this
case you will see a "unixutils" folder. Click on the plus to open it up and
you'll see the programs.
7. Clicking on the programs shows a little description at the bottom of the
window. So far, only ls really works, so select it and press choose.
8. A new locus will pop up somewhere random within the "inner" workspace.
This loci is a chooser for selecting flags to go along with ls. To check it
out, double click on the "processor" locus to close its window, and center
the "converter"/flag selector locus.
9. The flag selector locus has a pull down box with the flags available for
the ls program. In this case, I only have a few flags set up, although it
would be really easy to add more. As you scroll through the list of
options, you will just barely be able to see, at the bottom of the "inner"
window, a label which gives you information about each flag. Hopefully this
will be more visible when I resize the windows some (I forgot to do this
before I uploaded, but you can do this yourself by changing workspace_width
and workspace_height in the loci-file/coregui/const.py file). Anyways, you
can select through the flags and click on Add to add them. If you
accidentally add one you don't want, click on it in the list below and
press the remove button.
10. Once you have selected the flags, now comes the time to make things
work. Close the flag selector window by double clicking on the "converter"
locus.
11. Add a viewer locus by right clicking on the "inner" workspace, as you
did before for the "processor" locus.
12. Connect everything up: Arrow/out from processor to input of converter,
arrow/out of converter to input of viewer. Now you have your workpath:
processor -> converter -> viewer
13. Right click on the composite locus holding this whole mess to pull up a
little menu. Select "Construct Command Line." Yay! You just ran the ls
program!
14. The viewer will pop up a text box displaying the results your list
command. Very beautiful.
15. That's it!

Well, if you managed to get through all of that, I hope that it managed to
work out! I would really like to hear everyone's thoughts on it! I will
work to add some more programs and make it possible to generate more
complex command lines (with pipes and everything!), and also to make things
a little prettier (ie. not so many random windows popping up all over the
place!). As I said, suggestions are very welcome!
	I have a couple of questions about things before I go any further
however:

1. What loci does everyone think should go with different widgets? Right
now I have:

processor = default program selector widget
converter = default flag selection widget
viewer = default viewer widget (okay, this one makes sense)

Any ideas on whether these should be changed? Should we add differnt loci
so it would make more sense?

2. (This is probably mostly to Jeff) I would like to make some changes to
the Locus class and the workspace (the main WidgetMain class) to make them
more object oriented so that I can make changes to them easier.
	Right now to manipulate things within a locus, you directly access
the locus and change them (ie. locus.gui = "text_box" widget). This works
okay for simple things like manipulating a locus.gui widget, but I can't
use it to remove an old widget and replace it with a new one (for instance,
I would like to get rid of the "program chooser" widget once a program is
selected and replace it with a description of the program, but I can't do
this with the current set up.) So I would like to set up the Locus class
like the following

class Locus:

	def __init__(self, etc):
	 	define all of the setup variables etc
	def setLocusGUI(self, widget):
		set the widget as GUI
	def getLocusGUI(self):
		return CurrentWidget

etc....

This will make the classes fall more in lines with the OO nature of python,
and will help me out with manipulating the workspace and loci. This
shouldn't change the overall structure of anything, but will just change
how you access stuff.
	How does this sound? Jeff, I don't know if this jives with your
vision of where the Locus and workspace classes were going, so I wanted to
get your opinion on this.

I think that's it. I really look forward to hearing people's
comments/suggestions.

Brad










More information about the Pipet-Devel mailing list