~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/rules.py

  • Committer: Vincent Ladeuil
  • Date: 2016-02-07 18:23:13 UTC
  • mto: (6615.3.1 2.7)
  • mto: This revision was merged to the branch mainline in revision 6620.
  • Revision ID: v.ladeuil+lp@free.fr-20160207182313-jwz7z3vj4mpyjn7y
Ensure http://pad.lv/1323805 won't come back.

Since the 2.6.0 release pypi policy changed and release tarballs can't be
hosted on launchpad anymore, they have to be uploaded to
http://pypi.python.org/pypi


This fixes setup.py sdist to generate the right tarball with nearly the same
content as the one produced for 2.7.0.

Such a tarball have been uploaded to pypi properly signed and tested for
installation in venv.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008 Canonical Ltd
 
1
# Copyright (C) 2008, 2009, 2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
19
19
See ``bzr help rules`` for details.
20
20
"""
21
21
 
 
22
from __future__ import absolute_import
 
23
 
22
24
from bzrlib import (
23
25
    config,
24
26
    cmdline,
64
66
        """
65
67
        raise NotImplementedError(self.get_selected_items)
66
68
 
 
69
    def get_single_value(self, path, preference_name):
 
70
        """Get a single preference for a single file.
 
71
        
 
72
        :returns: The string preference value, or None.
 
73
        """
 
74
        for key, value in self.get_selected_items(path, [preference_name]):
 
75
            return value
 
76
        return None
 
77
 
67
78
 
68
79
class _IniBasedRulesSearcher(_RulesSearcher):
69
80
 
74
85
 
75
86
        :param inifile: the name of the file or a sequence of lines.
76
87
        """
77
 
        options = {'encoding': 'utf-8'}
78
 
        self._cfg = configobj.ConfigObj(inifile, options=options)
 
88
        self._cfg = configobj.ConfigObj(inifile, encoding='utf-8')
79
89
        sections = self._cfg.keys()
80
90
        patterns = []
81
91
        self.pattern_to_section = {}