/[cvs]/nfo/projects/netfraggle/bin/fraggleEngine.py
ViewVC logotype

Annotation of /nfo/projects/netfraggle/bin/fraggleEngine.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations)
Wed Aug 25 18:19:31 2004 UTC (20 years, 2 months ago) by joko
Branch: MAIN
File MIME type: text/x-python
initial commit

1 joko 1.1 import os
2    
3     class FraggleEngine:
4    
5     def getDefaultDir(self):
6     """Gets location of default dir and creates it
7     if necessary. ($HOME/.pears/)"""
8     try:
9     import pearsdebug
10     savedir = pearsdebug.savedir
11     except:
12     dir = '.netfraggle'
13     savedir = os.path.expanduser(os.path.join('~', dir))
14     if len(savedir)<=len("c:\\/" + dir):
15     # problem that might occur on Win2k (no $HOME environment variable)
16     temp = os.path.join(os.path.expandvars('$USERPROFILE'), dir)
17     if temp > len("c:\\/" + dir):
18     savedir = temp
19     # create dir if it doesn't exist
20     if not os.path.exists(savedir):
21     os.makedirs(savedir)
22     return savedir

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed