source: trunk/PARPG/scripts/common/utils.py @ 196

Revision 147, 1.2 KB checked in by barra_parpg, 11 years ago (diff)
  • SVN EOL style fixes
  • Property svn:eol-style set to native
Line 
1#   This program is free software: you can redistribute it and/or modify
2#   it under the terms of the GNU General Public License as published by
3#   the Free Software Foundation, either version 3 of the License, or
4#   (at your option) any later version.
5
6#   This program is distributed in the hope that it will be useful,
7#   but WITHOUT ANY WARRANTY; without even the implied warranty of
8#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
9#   GNU General Public License for more details.
10
11#   You should have received a copy of the GNU General Public License
12#   along with this program.  If not, see <http://www.gnu.org/licenses/>.
13
14# Miscellaneous game functions
15
16import os, sys
17
18# TODO: Having a file like this just looks cheap and 'hackish'. Fix if possible
19
20def addPaths (*paths):
21    """Adds a list of paths to sys.path. Paths are expected to use forward
22       slashes, for example '../../engine/extensions'. Slashes are converted
23       to the OS-specific equivalent.
24       @type paths: ???
25       @param paths: Paths to files?
26       @return: None"""
27    for p in paths:
28        if not p in sys.path:
29            sys.path.append(os.path.sep.join(p.split('/')))
30
Note: See TracBrowser for help on using the repository browser.