[Buildbot-devel] upcoming release

Mike Taylor bear at code-bear.com
Tue Apr 26 20:24:38 UTC 2005


at OSAF we store all app specific data on windows in a directory that 
is based on the following algorithm - we use this method because we are 
trying to run on as many win32 platforms as possible.   Only at the end 
do we use the python routine os.path.expanduser('~') as a fall-back.

         if os.name == 'nt':
             dataDir = None

             if os.environ.has_key('APPDATA'):
                 dataDir = os.environ['APPDATA']
             elif os.environ.has_key('USERPROFILE'):
                 dataDir = os.environ['USERPROFILE']
                 if os.path.isdir(os.path.join(dataDir, 'Application 
Data')):
                     dataDir = os.path.join(dataDir, 'Application Data')

             if dataDir is None or not os.path.isdir(dataDir):
                 if os.environ.has_key('HOMEDRIVE') and 
os.environ.has_key('HOMEPATH'):
                     dataDir = '%s%s' % (os.environ['HOMEDRIVE'], 
os.environ['HOMEPATH'])

             if dataDir is None or not os.path.isdir(dataDir):
                 dataDir = os.path.expanduser('~')

             profileDir = os.path.join(dataDir, 'Open Source 
Applications Foundation', 'Chandler')

---
Bear
http://code-bear.com

Open Source Applications Foundation (OSAF)
http://www.osafoundation.org

PGP Fingerprint = 9996 719F 973D B11B E111  D770 9331 E822 40B3 CD29


On Apr 26, 2005, at 3:18 PM, Elliot Murphy wrote:

> Hi Brian,
>
>> If there is a reasonable windows-way to do this project-specific 
>> thing, let
>> me know. Otherwise I'll set it up so that, under windows, we only 
>> look in the
>> ~/.buildbot -equivalent. I can imagine that dot-directories aren't 
>> that
>> common in that world.
> Not super common, but not frowned on either. Subversion creates .svn
> directories throughout the source tree, and also sets the "hidden"
> attribute (since windows doesn't hide dot directories from you). The
> appdata thing should work great for the account-wide default, but
> there is no reason to avoid looking for the .buildbot directory in a
> project specific directory even on windows.
>
>
>> And, is that APPDATA snippet above correct? Are the environment keys 
>> actually
>> named with %-% surrounding them?
> Nope, the %-% should be dropped. Percent signs what the windows shell
> uses instead of $ to refer to environment variables - you don't need
> 'em when working with os.environ.
>
> Cheers,
> -elliot
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by: Tell us your software development plans!
> Take this survey and enter to win a one-year sub to SourceForge.net
> Plus IDC's 2005 look-ahead and a copy of this survey
> Click here to start!  http://www.idcswdc.com/cgi-bin/survey?id5hix
> _______________________________________________
> Buildbot-devel mailing list
> Buildbot-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/buildbot-devel
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
URL: <http://buildbot.net/pipermail/devel/attachments/20050426/d33363dc/attachment.bin>


More information about the devel mailing list