the-xkcd-community/the-red-spider-project — pull request #30 by jgonggrijp (2013-04-08 20:42:10+00:00)
Title: summon: a generic file launcher, needs testing on Linux and Windows

summon.py is a very simple wrapper command that abstracts the tools available in each platform for opening files from the command line. `summon bla.xyz` will open `bla.xyz` in the default program for files of type `xyz`. If it's a html page it will open in your standard browser, if it's a directory it will open in your file browser, if it's a PDF file it will open in your pdf reader, and so on. You can pass multiple paths, separated by spaces.

Testing on Linux:
```
1. cd $RED_SPIDER_ROOT

2. # if you didn't have me yet:
git remote add julian git://github.com/the-xkcd-community/the-red-spider-project.git

3. git fetch julian
git checkout julian/summon
./setup.py
# say yes when it asks whether you want to install

4. rsshell
# log out of your computer and log back in if the command can't
# be found

5. summon ~/.profile
# see many duplicate lines of the form "export $RED_SPIDER_ROOT=..."?
# go ahead and delete the duplicates!
# (this happens if you run setup.py often and is due to its somewhat
# primitive mechanics)

6. summon . License.txt other/spider.svg
# the last one will not open if you don't have an SVG editor
# the first two should appear correctly in any case

7. exit
```

Testing on Windows:
```
1. cd %RED_SPIDER_ROOT%

2. # if you didn't have me yet:
git remote add julian git://github.com/the-xkcd-community/the-red-spider-project.git

3. git fetch julian
git checkout julian/summon
setup.py
# say yes when it asks whether you want to install

4. rsshell
# log out of your computer and log back in if the command can't
# be found

5. summon License.txt
# should open in your default text editor

6. summon . Authors.txt other\spider.svg
# the last one will not open if you don't have an SVG editor
# the first two should appear correctly in any case

7. exit
```