Re: system-config-dhcp
Greg Morgan <[email protected]>
| Newsgroups | gmane.linux.redhat.fedora.configuration |
|---|---|
| Message-ID | <[email protected]> |
Steven R. Baker wrote:
<snip>
> I've looked over the system-config-* programs to see if there are any
> standards to adhere to, or tools to use, and I haven't really found
> any. So, before I get too far in this, I want to find out if there are
> any pointers anyone has. My hope is for this tool is that it will come
> standard in future FC releases, and I want to make sure that it matches
> up with the other tools as closely as possible.
<snip>
I like what /usr/share/system-config-soundcard tried to do. There is a
soundcardBackend.py file that contains all the "library" code. All the
GUI code is in soundcard.py. Then system-config-soundcard.py is used to
instantiate it all. That way the soundcardBackend.py file is useful for
other Python applications. The meaty code is not all twisted up in the
GUI. Hint! Hint! That allows the "Backend" code to be scripted in say,
an Anaconda kickstart file.
I saw these other patterns:
The /usr/share/system*/pixmaps/ holds the applications graphics files.
Each directory has a shell script to set specific Python path issues
i.e. file /usr/share/system-config-users/system-config-users equals
system-config-users/system-config-users: Bourne shell script text
executable.
I think this is right. /usr/bin/system-config* is then a PAM security
file so that it prompts you for the root password. The
/usr/bin/system-config* file has a pointer to
/usr/share/system-config*/system-config*--the Bash shell script to
launch the Python code. But I can't for the life of me remember how I
figured that out. Take the PAM notion with a grain of salt.
There are a bunch of code libraries already written. You will see
imports of rhpl.* For example soundcardBackend.py uses
...
from rhpl.translate import _, N_
import rhpl.translate as translate
translate.textdomain ("system-config-soundcard")
...
There! If you use this code all your translation issues are gone. (Ok
and you have to make a translation call for each phrase that you use in
the rest of the program.) I believe you use a PO file editor to create
the translations. KBabel is found on Fedora Start>Programming>More
Programming Tools>KBabel. Stuff your files full of google translations
and you have the start of an international program. A search of the
file systems locates rhpl in /usr/share/rhpl and
/usr/lib/python2.3/site-packages/rhpl.
Finally, you might look at how the CVS repositories are laid out. Each
tool on http://fedora.redhat.com/projects/config-tools/*html has the
anonymous checkout instructions. I would guess that having your
repository setup just like Redhat's would be half the battle of getting
the finished tool into FC.
I find writing my explorations down helps me understand FC. I hope that
this helps you too.
Greg
--
Fedora-config-list mailing list
[email protected]
http://www.redhat.com/mailman/listinfo/fedora-config-list