Edgewall Software

Changeset 14614


Ignore:
Timestamp:
Mar 20, 2016, 11:36:23 PM (10 years ago)
Author:
Ryan J Ollos
Message:

1.2dev: Merge [14613] from 1.0-stable

Refs #12410.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/trac/admin/web_ui.py

    r14038 r14614  
    2525from trac.admin.api import IAdminPanelProvider
    2626from trac.core import *
    27 from trac.loader import get_plugin_info, get_plugins_dir
     27from trac.loader import get_plugin_info
    2828from trac.log import LOG_LEVELS
    2929from trac.perm import PermissionSystem, IPermissionRequestor
     
    599599        data = {
    600600            'plugins': plugins, 'show': req.args.get('show'),
    601             'readonly': not os.access(get_plugins_dir(self.env),
     601            'readonly': not os.access(self.env.get_plugins_dir(),
    602602                                      os.F_OK + os.W_OK),
    603603            'safe_wiki_to_html': safe_wiki_to_html,
  • trunk/trac/env.py

    r14448 r14614  
    643643        return os.path.join(self.path, 'conf', 'trac.ini')
    644644
     645    def _get_path_to_dir(self, dir):
     646        path = os.path.join(self.path, dir)
     647        return os.path.normcase(os.path.realpath(path))
     648
    645649    def get_templates_dir(self):
    646650        """Return absolute path to the templates directory."""
    647         return os.path.join(self.path, 'templates')
     651        return self._get_path_to_dir('templates')
    648652
    649653    def get_htdocs_dir(self):
    650654        """Return absolute path to the htdocs directory."""
    651         return os.path.join(self.path, 'htdocs')
     655        return self._get_path_to_dir('htdocs')
    652656
    653657    def get_log_dir(self):
    654658        """Return absolute path to the log directory."""
    655         return os.path.join(self.path, 'log')
     659        return self._get_path_to_dir('log')
     660
     661    def get_plugins_dir(self):
     662        """Return absolute path to the plugins directory."""
     663        return self._get_path_to_dir('plugins')
    656664
    657665    def setup_log(self):
  • trunk/trac/loader.py

    r13232 r14614  
    9898    return _load_py_files
    9999
     100
    100101def get_plugins_dir(env):
    101     """Return the path to the `plugins` directory of the environment."""
    102     plugins_dir = os.path.realpath(os.path.join(env.path, 'plugins'))
    103     return os.path.normcase(plugins_dir)
     102    """Return the path to the `plugins` directory of the environment.
     103
     104    :since 1.0.11: Deprecated and will be removed in 1.3.1. Use
     105                   Environment.get_plugins_dir() instead."""
     106    return env.get_plugins_dir()
     107
    104108
    105109def load_components(env, extra_path=None, loaders=(load_eggs('trac.plugins'),
    106110                                                   load_py_files())):
    107111    """Load all plugin components found on the given search path."""
    108     plugins_dir = get_plugins_dir(env)
     112    plugins_dir = env.get_plugins_dir()
    109113    search_path = [plugins_dir]
    110114    if extra_path:
     
    135139        return dist
    136140
    137     plugins_dir = get_plugins_dir(env)
     141    plugins_dir = env.get_plugins_dir()
    138142    plugins = {}
    139143    from trac.core import ComponentMeta
Note: See TracChangeset for help on using the changeset viewer.