summaryrefslogtreecommitdiff
path: root/click
diff options
context:
space:
mode:
authorDavid Lord <davidism@gmail.com>2018-09-24 08:21:11 -0700
committerDavid Lord <davidism@gmail.com>2018-09-24 08:21:11 -0700
commit5585856f5a7075656f94ffa2af8757cbd1b4fcca (patch)
treed4e393b3263de84a7ce5cce81913d7993aeee862 /click
parenta589835a5b656eec4bace076ac7e947662c1cc68 (diff)
downloadclick-meta.tar.gz
update metadatameta
test on 3.7 fix collections deprecation warning
Diffstat (limited to 'click')
-rw-r--r--click/__init__.py20
-rw-r--r--click/_bashcomplete.py8
-rw-r--r--click/_termui_impl.py16
-rw-r--r--click/parser.py23
4 files changed, 36 insertions, 31 deletions
diff --git a/click/__init__.py b/click/__init__.py
index fc40c7e..3b602cc 100644
--- a/click/__init__.py
+++ b/click/__init__.py
@@ -1,17 +1,15 @@
# -*- coding: utf-8 -*-
"""
- click
- ~~~~~
+click
+~~~~~
- Click is a simple Python module that wraps the stdlib's optparse to make
- writing command line scripts fun. Unlike other modules, it's based around
- a simple API that does not come with too much magic and is composable.
+Click is a simple Python module inspired by the stdlib optparse to make
+writing command line scripts fun. Unlike other modules, it's based
+around a simple API that does not come with too much magic and is
+composable.
- In case optparse ever gets removed from the stdlib, it will be shipped by
- this module.
-
- :copyright: (c) 2014 by Armin Ronacher.
- :license: BSD, see LICENSE for more details.
+:copyright: © 2014 by the Pallets team.
+:license: BSD, see LICENSE.rst for more details.
"""
# Core classes
@@ -96,4 +94,4 @@ __all__ = [
disable_unicode_literals_warning = False
-__version__ = '7.0-dev'
+__version__ = '7.0.dev'
diff --git a/click/_bashcomplete.py b/click/_bashcomplete.py
index fba6e99..a5f1084 100644
--- a/click/_bashcomplete.py
+++ b/click/_bashcomplete.py
@@ -1,4 +1,3 @@
-import collections
import copy
import os
import re
@@ -8,6 +7,11 @@ from .parser import split_arg_string
from .core import MultiCommand, Option, Argument
from .types import Choice
+try:
+ from collections import abc
+except ImportError:
+ import collections as abc
+
WORDBREAK = '='
# Note, only BASH version 4.4 and later have the nosort option.
@@ -159,7 +163,7 @@ def is_incomplete_argument(current_params, cmd_param):
return True
if cmd_param.nargs == -1:
return True
- if isinstance(current_param_values, collections.Iterable) \
+ if isinstance(current_param_values, abc.Iterable) \
and cmd_param.nargs > 1 and len(current_param_values) < cmd_param.nargs:
return True
return False
diff --git a/click/_termui_impl.py b/click/_termui_impl.py
index b7fcbb5..00a8e5e 100644
--- a/click/_termui_impl.py
+++ b/click/_termui_impl.py
@@ -1,14 +1,16 @@
+# -*- coding: utf-8 -*-
"""
- click._termui_impl
- ~~~~~~~~~~~~~~~~~~
+click._termui_impl
+~~~~~~~~~~~~~~~~~~
- This module contains implementations for the termui module. To keep the
- import time of Click down, some infrequently used functionality is placed
- in this module and only imported as needed.
+This module contains implementations for the termui module. To keep the
+import time of Click down, some infrequently used functionality is
+placed in this module and only imported as needed.
- :copyright: (c) 2014 by Armin Ronacher.
- :license: BSD, see LICENSE for more details.
+:copyright: © 2014 by the Pallets team.
+:license: BSD, see LICENSE.rst for more details.
"""
+
import os
import sys
import time
diff --git a/click/parser.py b/click/parser.py
index 5e8c213..1c3ae9c 100644
--- a/click/parser.py
+++ b/click/parser.py
@@ -1,20 +1,21 @@
# -*- coding: utf-8 -*-
"""
- click.parser
- ~~~~~~~~~~~~
+click.parser
+~~~~~~~~~~~~
- This module started out as largely a copy paste from the stdlib's
- optparse module with the features removed that we do not need from
- optparse because we implement them in Click on a higher level (for
- instance type handling, help formatting and a lot more).
+This module started out as largely a copy paste from the stdlib's
+optparse module with the features removed that we do not need from
+optparse because we implement them in Click on a higher level (for
+instance type handling, help formatting and a lot more).
- The plan is to remove more and more from here over time.
+The plan is to remove more and more from here over time.
- The reason this is a different module and not optparse from the stdlib
- is that there are differences in 2.x and 3.x about the error messages
- generated and optparse in the stdlib uses gettext for no good reason
- and might cause us issues.
+The reason this is a different module and not optparse from the stdlib
+is that there are differences in 2.x and 3.x about the error messages
+generated and optparse in the stdlib uses gettext for no good reason
+and might cause us issues.
"""
+
import re
from collections import deque
from .exceptions import UsageError, NoSuchOption, BadOptionUsage, \