diff options
author | Andrej Shadura <andrewsh@debian.org> | 2018-10-04 20:57:53 +0200 |
---|---|---|
committer | Andrej Shadura <andrewsh@debian.org> | 2018-10-04 20:57:53 +0200 |
commit | 77e4922e731003f2b96cb520b746cdbbe7251353 (patch) | |
tree | 3fd5d2cb708ef788c4cb6283fa1fee4a2cd9855b | |
parent | e34c4d4c02bad53d78b7c548065ad82ee28c9d1a (diff) |
Import Upstream version 1.3.1
-rw-r--r-- | PKG-INFO | 2 | ||||
-rw-r--r-- | mercurial_extension_utils.egg-info/PKG-INFO | 2 | ||||
-rw-r--r-- | mercurial_extension_utils.py | 29 | ||||
-rw-r--r-- | setup.py | 2 |
4 files changed, 23 insertions, 12 deletions
@@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: mercurial_extension_utils -Version: 1.3.0 +Version: 1.3.1 Summary: Mercurial Extension Utils Home-page: http://bitbucket.org/Mekk/mercurial-extension_utils Author: Marcin Kasperski diff --git a/mercurial_extension_utils.egg-info/PKG-INFO b/mercurial_extension_utils.egg-info/PKG-INFO index 5e0ad34..f6c8d67 100644 --- a/mercurial_extension_utils.egg-info/PKG-INFO +++ b/mercurial_extension_utils.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: mercurial-extension-utils -Version: 1.3.0 +Version: 1.3.1 Summary: Mercurial Extension Utils Home-page: http://bitbucket.org/Mekk/mercurial-extension_utils Author: Marcin Kasperski diff --git a/mercurial_extension_utils.py b/mercurial_extension_utils.py index d24267c..df08b7a 100644 --- a/mercurial_extension_utils.py +++ b/mercurial_extension_utils.py @@ -894,9 +894,17 @@ def command(cmdtable): ['othercmd', 'somecmd'] >>> cmdtable['othercmd'] # doctest: +ELLIPSIS (<function othercmd at ...>, [('l', 'list', None, 'List widgets'), ('p', 'pagesize', 10, 'Page size')], 'othercmd [-l] [-p 20]') + + Below is uninteresting test that it really works in various mecurials: + >>> from mercurial import commands - >>> commands.norepo # doctest: +ELLIPSIS + >>> # Syntax changed in hg3.8, trying to accomodate + >>> commands.norepo if hasattr(commands, 'norepo') else ' othercmd' # doctest: +ELLIPSIS '... othercmd' + >>> othercmd.__dict__['norepo'] if othercmd.__dict__ else True + True + >>> mycmd.__dict__['norepo'] if mycmd.__dict__ else False + False """ from mercurial import cmdutil, commands @@ -949,14 +957,16 @@ def direct_import(module_name, blocked_modules=None): >>> re.search("^(.)", "Ala").group(1) 'A' - Allows to block some modules: + Allows to block some modules from demandimport machinery, + so they are not accidentally misloaded: >>> k = direct_import("anydbm", ["dbhash", "gdbm", "dbm", "bsddb.db"]) >>> k.__name__ 'anydbm' :param module_name: name of imported module - :param blocked_modules: names of modules to be blocked (list) + :param blocked_modules: names of modules to be blocked from demandimport + (list) :return: imported module """ return direct_import_ext(module_name, blocked_modules)[0] @@ -965,21 +975,22 @@ def direct_import(module_name, blocked_modules=None): def direct_import_ext(module_name, blocked_modules=None): """ Like direct_import, but returns info whether module was just - imported, or already loaded + imported, or already loaded. - >>> m1, loaded = direct_import_ext("email.message") + >>> m1, loaded = direct_import_ext("xml.sax.handler") >>> m1.__name__, loaded - ('email.message', True) + ('xml.sax.handler', True) - >>> m2, loaded = direct_import_ext("email.message") + >>> m2, loaded = direct_import_ext("xml.sax.handler") >>> m2.__name__, loaded - ('email.message', False) + ('xml.sax.handler', False) >>> m1 == m2 True :param module_name: name of imported module - :param blocked_modules: names of modules to be blocked (list) + :param blocked_modules: names of modules to be blocked from + demandimport (list) :return: (imported module, was-it-imported-now?) """ @@ -2,7 +2,7 @@ from setuptools import setup, find_packages -VERSION = '1.3.0' +VERSION = '1.3.1' LONG_DESCRIPTION = open("README.txt").read() INSTALL_REQUIRES = [] |