Skip to content

Commit 14a4ec0

Browse files
committed
fix typos
1 parent 4ddd3f8 commit 14a4ec0

4 files changed

Lines changed: 12 additions & 14 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Currently supports:
1111
* GitLab
1212
* Bitbucket
1313

14+
To add your own URL translator, see this example project: https://github.com/amykyta3/gmtu-plugin-example
15+
1416
## Installing
1517
Install from [PyPi](https://pypi.org/project/git-me-the-url) using pip:
1618

@@ -22,8 +24,6 @@ Use it for everyday link sharing with friends:
2224

2325
![cmd-example](docs/cmd-example.gif)
2426

25-
To add your own URL translator, see this example project: https://github.com/amykyta3/gmtu-plugin-example
26-
2727
## Python API
2828

2929
Embed in your Python application:

gitmetheurl/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.0.0"
1+
__version__ = "2.0.1"

gitmetheurl/base.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,13 @@ def __init__(self, translators: "Optional[List[Type[TranslatorSpec]]]"=None):
2222
# Use user-specified translators
2323
self.translators = translators
2424
else:
25-
# Use built-in translators
26-
self.translators = [
25+
# Use plugin translators & built-in
26+
self.translators = get_translator_plugins()
27+
self.translators.extend([
2728
GitHub,
2829
GitLab,
29-
Bitbucket
30-
]
31-
32-
# .. and discover any plugins
33-
self.translators.extend(get_translator_plugins())
30+
Bitbucket,
31+
])
3432

3533
def get_source_url(self, path: str, line: "Optional[Union[int, Tuple[int, int]]]" = None, exact_commit: bool = False) -> str:
3634
"""
@@ -66,7 +64,7 @@ def get_source_url(self, path: str, line: "Optional[Union[int, Tuple[int, int]]]
6664
return translator.get_source_url(remote, info)
6765

6866

69-
@functools.lru_cache
67+
@functools.lru_cache(maxsize=None)
7068
def _get_target_info(self, path:str, exact_commit: bool = False) -> 'Tuple[str, dict]':
7169
"""
7270
Collects relevant Git information about the target path.
@@ -113,7 +111,7 @@ def _get_target_info(self, path:str, exact_commit: bool = False) -> 'Tuple[str,
113111

114112
return remote, info
115113

116-
@functools.lru_cache
114+
@functools.lru_cache(maxsize=None)
117115
def _lookup_translator(self, remote:str) -> 'Optional[Type[TranslatorSpec]]':
118116
for t in self.translators:
119117
if t.is_match(remote):

gitmetheurl/translators/bitbucket.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
class Bitbucket(TranslatorSpec):
44
remote_regexes = [
5-
r'git@bitbucket\.org:(?P<project>[\w\-]+)/(?P<repo>[\w\-]+)\.git'
6-
r'https://[\w\-]+@bitbucket\.org/(?P<project>[\w\-]+)/(?P<repo>[\w\-]+)\.git'
5+
r'git@bitbucket\.org:(?P<project_name>[\w\-]+)/(?P<repo>[\w\-]+)\.git',
6+
r'https://[\w\-]+@bitbucket\.org/(?P<project_name>[\w\-]+)/(?P<repo>[\w\-]+)\.git',
77
]
88

99
url_root_recipes = [

0 commit comments

Comments
 (0)