[59195] trunk/dports/python
jochen at macports.org
jochen at macports.org
Sun Oct 11 05:25:09 PDT 2009
Revision: 59195
http://trac.macports.org/changeset/59195
Author: jochen at macports.org
Date: 2009-10-11 05:25:06 -0700 (Sun, 11 Oct 2009)
Log Message:
-----------
New port (on the way to py26-mayavi)
Added Paths:
-----------
trunk/dports/python/py26-enthoughtbase/
trunk/dports/python/py26-enthoughtbase/Portfile
trunk/dports/python/py26-enthoughtbase/files/
trunk/dports/python/py26-enthoughtbase/files/changeset_r24034.diff
Added: trunk/dports/python/py26-enthoughtbase/Portfile
===================================================================
--- trunk/dports/python/py26-enthoughtbase/Portfile (rev 0)
+++ trunk/dports/python/py26-enthoughtbase/Portfile 2009-10-11 12:25:06 UTC (rev 59195)
@@ -0,0 +1,23 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+# $Id: Portfile 55252 2009-08-07 22:34:20Z macsforever2000 at macports.org $
+
+PortSystem 1.0
+PortGroup python26 1.0
+
+name py26-enthoughtbase
+version 3.0.2
+categories-append devel
+maintainers nomaintainer
+description The Enthought base package
+long_description The EnthoughtBase project includes a few core packages\
+ that are used by many other projects in the Enthought Tool Suite
+platforms darwin
+homepage http://code.enthought.com/projects/enthought_base.php
+master_sites http://www.enthought.com/repo/ETS/
+distname EnthoughtBase-${version}
+checksums md5 e4463c165534f1d31ad1ab5c2eced1b6
+
+depends_build-append port:py26-setuptools
+
+patchfiles changeset_r24034.diff
+patch.pre_args -p3
Added: trunk/dports/python/py26-enthoughtbase/files/changeset_r24034.diff
===================================================================
--- trunk/dports/python/py26-enthoughtbase/files/changeset_r24034.diff (rev 0)
+++ trunk/dports/python/py26-enthoughtbase/files/changeset_r24034.diff 2009-10-11 12:25:06 UTC (rev 59195)
@@ -0,0 +1,176 @@
+Index: /EnthoughtBase/trunk/enthought/etsconfig/etsconfig.py
+===================================================================
+--- /EnthoughtBase/trunk/enthought/etsconfig/etsconfig.py (revision 22408)
++++ /EnthoughtBase/trunk/enthought/etsconfig/etsconfig.py (revision 24034)
+@@ -49,23 +49,33 @@
+ #### properties ###########################################################
+
++ def get_application_data(self, create=False):
++ """ Return the application data directory path.
++
++ **Parameters**
++
++ create: create the corresponding directory or not
++
++ **Notes**
++
++ This is a directory that applications and packages can safely
++ write non-user accessible data to i.e. configuration
++ information, preferences etc.
++
++ Do not put anything in here that the user might want to navigate to
++ e.g. projects, user data files etc.
++
++ The actual location differs between operating systems.
++ """
++ if self._application_data is None:
++ self._application_data = \
++ self._initialize_application_data(create=create)
++
++ return self._application_data
++
++
+ def _get_application_data(self):
+- """
+- Property getter.
+-
+- This is a directory that applications and packages can safely write
+- non-user accessible data to i.e. configuration information, preferences
+- etc.
+-
+- Do not put anything in here that the user might want to navigate to
+- e.g. projects, user data files etc.
+-
+- The actual location differs between operating systems.
+-
+- """
+-
+- if self._application_data is None:
+- self._application_data = self._initialize_application_data()
+-
+- return self._application_data
++ """ Property getter, see get_application_data's docstring.
++ """
++ return self.get_application_data(create=True)
+
+
+@@ -80,41 +90,54 @@
+ return
+
+-
++ def get_application_home(self, create=False):
++ """ Return the application home directory path.
++
++ **Parameters**
++
++ create: create the corresponding directory or not
++
++ **Notes**
++
++ This is a directory named after the current, running
++ application that imported this module that applications and
++ packages can safely write non-user accessible data to i.e.
++ configuration information, preferences etc. It is a
++ sub-directory of self.application_data, named after the
++ directory that contains the "main" python script that started
++ the process. For example, if application foo is started with
++ a script named "run.py" in a directory named "foo", then the
++ application home would be: <ETSConfig.application_data>/foo,
++ regardless of if it was launched with "python
++ <path_to_foo>/run.py" or "cd <path_to_foo>; python run.py"
++
++ This is useful for library modules used in apps that need to
++ store state, preferences, etc. for the specific app only, and
++ not for all apps which use that library module. If the
++ library module uses ETSConfig.application_home, they can
++ store prefs for the app all in one place and do not need to
++ know the details of where each app might reside.
++
++ Do not put anything in here that the user might want to
++ navigate to e.g. projects, user home files etc.
++
++ The actual location differs between operating systems.
++
++ """
++ if self._application_home is None:
++ self._application_home = path.join(
++ self.get_application_data(create=create),
++ self._get_application_dirname())
++
++ return self._application_home
++
++
++
+ application_data = property(_get_application_data, _set_application_data)
+
+
+ def _get_application_home(self):
+- """
+- Property getter.
+-
+- This is a directory named after the current, running application that
+- imported this module that applications and packages can safely write
+- non-user accessible data to i.e. configuration information, preferences
+- etc. It is a sub-directory of self.application_data, named after the
+- directory that contains the "main" python script that started the
+- process. For example, if application foo is started with a script named
+- "run.py" in a directory named "foo", then the application home would be:
+- <ETSConfig.application_data>/foo, regardless of if it was launched
+- with "python <path_to_foo>/run.py" or "cd <path_to_foo>; python run.py"
+-
+- This is useful for library modules used in apps that need to store
+- state, preferences, etc. for the specific app only, and not for all apps
+- which use that library module. If the library module uses
+- ETSConfig.application_home, they can store prefs for the app all in
+- one place and do not need to know the details of where each app might
+- reside.
+-
+- Do not put anything in here that the user might want to navigate to
+- e.g. projects, user home files etc.
+-
+- The actual location differs between operating systems.
+-
+- """
+-
+- if self._application_home is None:
+- self._application_home = path.join(self.application_data,
+- self._get_application_dirname())
+-
+- return self._application_home
++ """ Property getter, see get_application_home's docstring.
++ """
++ return self.get_application_home(create=True)
+
+
+@@ -294,5 +317,5 @@
+
+
+- def _initialize_application_data(self):
++ def _initialize_application_data(self, create=True):
+ """
+ Initializes the (default) application data directory.
+@@ -322,13 +345,15 @@
+ application_data = os.path.join(parent_directory, directory_name)
+
+- # If a file already exists with this name then make sure that it is
+- # a directory!
+- if os.path.exists(application_data):
+- if not os.path.isdir(application_data):
+- raise ValueError('File "%s" already exists' % application_data)
+-
+- # Otherwise, create the directory.
+- else:
+- os.makedirs(application_data)
++ if create:
++ # If a file already exists with this name then make sure that it is
++ # a directory!
++ if os.path.exists(application_data):
++ if not os.path.isdir(application_data):
++ raise ValueError('File "%s" already exists'
++ % application_data)
++
++ # Otherwise, create the directory.
++ else:
++ os.makedirs(application_data)
+
+ return application_data
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20091011/b9503b48/attachment.html>
More information about the macports-changes
mailing list