Python Scripts

 

Python Scripts

Here are some small Python scripts I have written over time. Usually they are tested on a recent version of Ubuntu Linux

This scripts are distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. You are free to do with them what ever you want.



nautilus-print

A very simple extension for Nautilus, the standard file manager for the GNOME desktop, to print files from the context menu.

It’s not very sophisticated and doesn’t give any error messages if something goes wrong. It doesn’t do any file type conversion but relies on what your print system can do - so don’t expect too much.

Requirements

nautilus-print needs:

  • libautilus-extension Python bindings

    Tested with version 0.6.1 as distributed with Ubuntu 10.04 “Lucid Lynx”.

    For Ubuntu that’s the package python-nautilus

  • GtkLP

    Tested with version 1.2.7 as distributed with Ubuntu 10.04 “Lucid Lynx”.

    For Ubuntu that’s the package gtklp

Download

File Size Modified MD5
nautilus-print.py 1.2 KByte 2010-06-15 05:10 4c0612900d5511bc291d9175c6457e22

Installation

Save the file as $HOME/.nautilus/python-extensions/nautilus-print.py and restart Nautilus (e.g. log out and log in or run nautilus --quit from the command line).

Usage

Right click on a local file in Nautilus. You should see a menu that somewhere has a Print item. Click on that to start GtkLP with the selected file(s).

addtorecent

A simple script to put documents on GNOME’s recently used document list

Requirements

addtorecent needs:

Download

File Size Modified MD5
addtorecent 1.3 KByte 2010-07-20 19:27 5030061ee42bf4006ef0e34d829a206a

Usage

addtorecent URI [MIME-type] [app] [cmd]
  • URL is the path or URI of the document

  • MIME-type is its MIME-type and defaults to text/plain

  • app is a name of an application you want to associate with this document

    and defaults to xdg-open

  • cmd is the command line to start app

    and defaults to xdg-open %F

With Emacs

See here for how to use this with Emacs

ppa-info

Get owner, URL and description for a given PPA

Requirements

addtorecent needs:

Download

File Size Modified MD5
addtorecent 1.3 KByte 2010-07-20 19:27 5030061ee42bf4006ef0e34d829a206a

Usage

addtorecent URI [MIME-type] [app] [cmd]
  • URL is the path or URI of the document

  • MIME-type is its MIME-type and defaults to text/plain

  • app is a name of an application you want to associate with this document

    and defaults to xdg-open

  • cmd is the command line to start app

    and defaults to xdg-open %F

With Emacs

See here for how to use this with Emacs

ppa-info

Get owner, URL and description for a given PPA

Requirements

ppa-info needs:

Download

File Size Modified MD5
ppa-info.py 1.7 KByte 2015-10-02 04:58 77234f75c5e7de3b28d3f106ae844bdb

Usage

ppa-info.py PPA

  • PPA is a PPA name, like ppa:diesch/testing or just diesch/testing