[gDesklets] Showing advance



Hello:

 I'm working in the "Close a running desklet" idea and I'd like to show
an
advance and show the way I'm going so far:
http://media.mgonzalez.cl/gdesklets/check_first.patch

In the middle of my job, I saw something we can improve and I wanted to
do
it right now: we are validating the arguments but not the options. So, I
used the optparse module[1] to help me in that purpose (we're not
including a new dependence, it's included in the python core); that help
us to make gdesklets more "traditional":

$ ./gdesklets --help
Usage: gdesklets [options] order

Options:
  -h, --help            show this help message and exit
  -n, --no-tray-icon    Avoid to show the icon on the tray
  -d, --debug           Avoid show the icon on the tray
  -c, --check-first     Launch pre-existing display
  -p SM_CONFIG_PREFIX, --sm-config-prefix=SM_CONFIG_PREFIX
                        I have no idea!
  -i SM_CLIENT_ID, --sm-client-id=SM_CLIENT_ID
                        I have no idea!

What this patch does:

 1) check if there already is a desklet instance of the display I want
to
open (for this I've added a new option used by the "open" order):
--check-first or -c

    if so,  open the old one
    if NOT, open a new instance

 2) avoid "double imports in python" in gdesklets file.

Comments?

[1]http://docs.python.org/lib/module-optparse.html



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]