root/src/Tycoon/Utility.py

Revision 0:4a4bfb6ee2fc, 1.0 kB (checked in by Kevin Lai <klai@…>, 3 years ago)

tag of klai@…/tycoon--mainline--0.1--patch-78
(automatically generated log message)

  • Property exe set to *
Line 
1#!/usr/bin/python --
2#
3#
4#
5# Copyright (C) 2005 Kevin Lai
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, write to the Free Software
19# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20#
21import errno, os, os.path, re, shelve, shutil, socket, string, sys
22
23def DirCreate(prefix, name, mode):
24    if prefix != None:
25        dir = os.path.join(prefix, name)
26    else:
27        dir = name
28    if not os.path.exists(dir):
29        os.mkdir(dir, mode)
30    os.chmod(dir, mode)
31    return dir
Note: See TracBrowser for help on using the browser.