Package configure_slimpy

Generate a script SLIMpy can use to update defaults on import script must be python and contain: a dict object named 'DEFAULTS' an integer RC_VERSION. More...


Functions

def get_rc_filename
def check_exists
 checks if the rc file already exists and if so prompt the user if they truly want to over write it
def create_dict_lines
 Write the current defaults to the SLIMpy rc file with documentation.
def write_header
 Write the preamble to the rc file.

Variables

string __copyright__
string __license__
int RC_VERSION = 1
tuple pars = parse_args( )
list dest = pars['dest']
list rc_name = pars['rc_name']
tuple slim_rcfile = get_rc_filename( dest, rc_name )
tuple slimpy_rc = open( slim_rcfile, 'w' )


Detailed Description

Generate a script SLIMpy can use to update defaults on import script must be python and contain: a dict object named 'DEFAULTS' an integer RC_VERSION.

configure_slimpy takes two optional arguments dest and rc_name the values are a path and a filename respectively.

On import SLIMpy looks for an environment variable SLIMPY_RC, a file named .slimpy_rc in the current directory or a file named .slimpy_rc in the users $HOME directory in that order. The first file that it finds it will use.

An example of generating a script

 [bash]$ python configure_slimpy.py [dest=] [rc_name=] [slimpy options]
 Wrote file: '/Users/sean/.slimpy_rc'
 
 <edit your script>
 @code 
  
 @param dest destination of the .slimpy_rc file may be \a global \a local or a path name.
 @param rc_name the name of the .slimpy_rc file defaults to ".slimpy_rc"

Function Documentation

def configure_slimpy.check_exists (   slim_rcfile  ) 

checks if the rc file already exists and if so prompt the user if they truly want to over write it

Definition at line 89 of file configure_slimpy.py.

def configure_slimpy.create_dict_lines (   key,
  slimpy_rc 
)

Write the current defaults to the SLIMpy rc file with documentation.

Definition at line 106 of file configure_slimpy.py.

def configure_slimpy.get_rc_filename (   dest,
  rc_name 
)

Parameters:
dest destination of the .slimpy_rc file may be global local or a path name.
rc_name the name of the .slimpy_rc file defaults to ".slimpy_rc"
Returns:
a fully formed path name

Definition at line 69 of file configure_slimpy.py.

def configure_slimpy.write_header (   slimpy_rc  ) 

Write the preamble to the rc file.

Definition at line 136 of file configure_slimpy.py.


Variable Documentation

string __copyright__

Initial value:

"""
Copyright 2008 Sean Ross-Ross
"""

Definition at line 32 of file configure_slimpy.py.

string __license__

Initial value:

"""
This file is part of SLIMpy.

SLIMpy is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

SLIMpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with SLIMpy. If not, see <http://www.gnu.org/licenses/>.
"""

Definition at line 35 of file configure_slimpy.py.

list dest = pars['dest']

Definition at line 159 of file configure_slimpy.py.

tuple pars = parse_args( )

Definition at line 157 of file configure_slimpy.py.

list rc_name = pars['rc_name']

Definition at line 160 of file configure_slimpy.py.

int RC_VERSION = 1

Definition at line 53 of file configure_slimpy.py.

tuple slim_rcfile = get_rc_filename( dest, rc_name )

Definition at line 162 of file configure_slimpy.py.

tuple slimpy_rc = open( slim_rcfile, 'w' )

Definition at line 166 of file configure_slimpy.py.


Generated on Sun Aug 10 09:11:08 2008 for SLIMpy by  doxygen 1.5.6