Skip to content

Commit

Permalink
Add support for config files
Browse files Browse the repository at this point in the history
This makes it more convenient to use a non-default basedir, for
example.
  • Loading branch information
akheron committed May 15, 2011
1 parent e6ccb08 commit 1b1d623
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
19 changes: 18 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,29 @@ Show help::

$ multipy -h

Here's a list of supported command line options::

-b BASEDIR The base directory [default: ~/multipy]
-k Keep temporary files and logs after installation
-n Don't install distribute

Upon startup, multipy tries to source ``~/.multipyrc`` and
``~/.config/multipyrc``. The following variables can be assigned in
these files::

Assignment... has the same effect as:

basedir=BASEDIR -b BASEDIR
keep_tmp=1 -k
no_distribute=1 -n


Under the hood
==============

By default, the top directory of the multipy is
``basedir=$HOME/multipy``. This can be changed with the ``-b`` option.
``basedir=$HOME/multipy``. This can be changed with the ``-b`` option
or in the config files discussed in the last section.

When Python X.Y is installed, the following things happen:

Expand Down
16 changes: 15 additions & 1 deletion multipy
Original file line number Diff line number Diff line change
Expand Up @@ -355,13 +355,22 @@ Commands:
This is meant to be used to easily source the activate script
in the shell:
. $(multipy activate 2.6)
. \$(multipy activate 2.6)
Options:
-b BASEDIR The base directory [default: ~/multipy]
-k Keep temporary files and logs after installation
-n Don't install distribute
Upon startup, ~/.multipyrc and ~/.config/multipyrc are loaded. The
following variables can be assigned in these files:
Assignment... has the same effect as:
basedir=BASEDIR -b BASEDIR
keep_tmp=1 -k
no_distribute=1 -n
Copyright (C) 2011 Petri Lehtinen. Licenced under the MIT license.
EOF
Expand All @@ -372,6 +381,11 @@ basedir=$HOME/multipy
no_distribute=0
keep_tmp=0

# Load config files
: ${XDG_CONFIG_HOME:=$HOME/.config}
[ -f $HOME/.multipyrc ] && . $HOME/.multipyrc
[ -f $XDG_CONFIG_HOME/multipyrc ] && . $XDG_CONFIG_HOME/multipyrc

while getopts "b:kn" opt; do
case $opt in
b)
Expand Down

0 comments on commit 1b1d623

Please sign in to comment.