• Home
  • About
  • Blog Archives
  • Contact Me
  • FAQ
  • The Big 101
Subscribe: Posts | Comments | E-mail

jonobacon@home

Posted on February 27, 2010 - by jono

Fun Little Acire Story

Acire Community Desktop Opportunistic Developers Ubuntu

With the new release of Acire just out I wanted to tell you folks a fun little story of an added benefit to Acire that I never envisaged when I came up with the idea for the app.

Yesterday I got an email from someone (I will keep the identify private) saying:

I’m trying to create an application but I can’t seem to find any way to embed a gnome-terminal into my app. I know you’re not offering support :) but if you have some spare time is there any chance you can point me to the documentation for that?

This happens a lot: someone wants to do something, so they ask for help over email or on another medium such as IRC. Unfortunately, I am usually pretty busy and typically don’t have the time to answer support questions. Before Acire existed I would have at most hunted out some links or possibly just the person to to go and ask on a particular forum or mailing list.

Now Acire exists, I just fired it up, selected Python VTE from the cateogries combo box, clicked on the snippet, and then cut and pasted the code into the email:

#!/usr/bin/env python

# [SNIPPET_NAME: Embed a VTE terminal]
# [SNIPPET_CATEGORIES: Python VTE]
# [SNIPPET_DESCRIPTION: Embed a VTE terminal in your application]

try:
    import gtk
except:
    print >> sys.stderr, "You need to install the python gtk bindings"
    sys.exit(1)

# import vte
try:
    import vte
except:
    error = gtk.MessageDialog (None, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK,
        'You need to install python bindings for libvte')
    error.run()
    sys.exit (1)

if __name__ == '__main__':
    # create the terminal
    v = vte.Terminal()
    v.connect ("child-exited", lambda term: gtk.main_quit())

    # fork_command() will run a command, in this case it shows a prompt
    v.fork_command()

    # create a window and add the VTE
    window = gtk.Window()
    window.add(v)
    window.connect('delete-event', lambda window, event: gtk.main_quit())

    # you need to show the VTE
    window.show_all()

    # Finally, run the application
    gtk.main()

Job done. What made me smile about this was that Acire not only helps me, but it helped me help someone else too. Rocking. :-)



This entry was posted on Saturday, February 27th, 2010 at 12:10 am and is filed under Acire, Community, Desktop, Opportunistic Developers, Ubuntu. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

7 Comments

We'd love to hear yours!



  1. Visit My Website

    February 27, 2010

    Permalink

    ethana2 said:

    Is there any way to submit snippet requests through acire?

    Like, how do I request administrative authentication in a Java app?

    Reply


    • Visit My Website

      February 27, 2010

      Permalink

      Ed S said:

      Acire is targeted at the Python+GTK+GNOME stack that is popular for Ubuntu development – see Jono’s post, http://www.jonobacon.org/2010/01/30/connecting-the-opportunistic-dots/ It has features (including ongoing work) that work for Python, and will not work for Java (at least, not without major modifications to the code – though who knows what people might add in the future). Second, there isn’t currently any way to request snippets through Acire. That would need a communication mechanism like a mailing list/forum/etc – a link to which could be put on Acire’s Help menu, once the forum is set up :-) In fact, Jono wants more programmers to join in and submit Python snippets to the python-snippets project on Launchpad.net… if you write Python, consider contributing! :-)

      Reply


  2. Visit My Website

    February 27, 2010

    Permalink

    CoolGoose said:

    Thanks again Jono for the tips ;)

    Reply


  3. Visit My Website

    February 27, 2010

    Permalink

    Rich said:

    Brilliant idea, I plan on using this myself – but I must say, the logo is crap! How about something a bit more scalable and colorful, eh Jono?

    Reply


  4. Visit My Website

    February 28, 2010

    Permalink

    uninja said:

    Don’t forget to import sys before the attempt to import vte.

    Reply


  5. Visit My Website

    March 12, 2010

    Permalink

    Jon said:

    I’ve install acire and python-snippets, is it right that the only categories I see are pygtksourceview, cairo, apport and pygtk?

    Reply


Leave a Reply


Here's your chance to speak.

Click here to cancel reply.

  1. Name (required)

    Mail (required)

    Website

    Message

  • Ad Ad Ad Ad
  • Prepare For Awesome

  • Recent Articles

    • Fixing Ubuntu Software Center Descriptions
    • Red Hat, Canonical and GNOME Contributions
    • Ubuntu Global Jam: Start Your Engines!
    • Awesome GUADEC Espresso and Coffee Bar
    • Team Reporting
    • The Five Horsemen
    • Community Leadership Summit 2010 This Weekend!
    • Ahmed Kamal Joins The Horsemen
    • Severed Fifth Update
    • Rocking The LoCo Council
  • Recent Comments

    • Inge Wallin on Red Hat, Canonical and GNOME Contributions
    • Anon on Red Hat, Canonical and GNOME Contributions
    • Greg on Red Hat, Canonical and GNOME Contributions
    • Jim on Red Hat, Canonical and GNOME Contributions
    • Adam Williamson on Red Hat, Canonical and GNOME Contributions
    • Eddward on Red Hat, Canonical and GNOME Contributions
    • HunterA3 on Red Hat, Canonical and GNOME Contributions
    • ScottK on Fixing Ubuntu Software Center Descriptions
    • Contribuciones a GNOME – Red Hat 16%, Canonical 1% | Ubunlog on Red Hat, Canonical and GNOME Contributions
    • ah on Red Hat, Canonical and GNOME Contributions
  • Flickr Photos

  •  

    February 2010
    M T W T F S S
    « Jan   Mar »
    1234567
    891011121314
    15161718192021
    22232425262728
  • jb@h Rockstars This Year

    • ethana2 (30)
    • Zac (17)
    • nixternal (16)
    • Tom (12)
    • Bruno Girin (11)
    • James Duncan (11)
    • Adam Williamson (10)
    • Anon (10)
    • Brandon Tomlinson (10)
    • Jef Spaleta (10)
© 2008 jonobacon@home - At home with Jono Bacon, Community Manager and Author