GNOMEGNOME RSS feed
Here are a couple of scripts for use with the External Tools plugin in Gedit that allow you to validate and format your JSON files using Python's
jsonmodule. Simply copy each of these to
~/.config/gedit/tools, make sure they are executable, and then restart Gedit.
Last week I pushed some long-overdue updates to my Django Project Plugin for Gedit. I have quite a bit of work to do on 2 different Django projects over the next couple weeks which should give me the opportunity to make any final tweaks before releasing a stable version (3.2).
- Added support for the new directory structure in Django 1.4.
- Added support for custom Django settings files.
- Added support for virtualenv. The plugin will scan for a virtual environment starting at the project folder and traverse up the tree to root.
It's been a while since I've tinkered with the
GtkApplicationobject in GTK+ 3 and I was intrigued by the "appmenu" and "menubar" properties. The reference docs for GtkApplication includes a sample application called "Bloatpad" which demonstrates
Basically, the app menu is for actions that are application wide, and the menubar is for actions that are specific to each window instance. GTK+ will put the menus in the right place depending on the platform. For example, OS X puts both menus on the top of the screen, XFCE has both menus on each window, GNOME has the app menu at the top of the screen and the menubar on each window.
So, I ported Bloatpad to Python and it almost works. I put the source code for Python Bloatpad on Github.
Most people will learn how to read and write to files in Python using the built-in file objects. That works great for simple read/write operations on the local filesystem. However, if you need a more advanced I/O library, take a look at Gio.
Gio provides an abstract I/O API without having to know what the underlying filesystem is. In other words, you can read files from various sources including http, ftp, ssh, etc. The Gio library has support for asynchronous operations and access to a ton of other useful information (mime types, themed icon names, etc.).
Here is a closer look at asynchronously reading files in Python using Gio.
I often need to create custom application launchers for games, my own shell scripts, or to launch programs with specific command-line options. As such, I have written Desktop Entry Editor to make it easy to create and edit user-defined application launchers.
Application launchers are simple text files with a
.desktopextension that conform to the Desktop Entry Specification. For user-defined application launchers, the ideal location to save these desktop entries is in