From 6c4db80b6e3f25b423713931c43f06d1e18356e0 Mon Sep 17 00:00:00 2001 From: "Jules Lasne (jlasne - seluj78)" Date: Thu, 12 Dec 2019 00:22:28 +0100 Subject: [PATCH 1/3] Version bump --- potodo/__init__.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/potodo/__init__.py b/potodo/__init__.py index a1274f4..d31cf33 100644 --- a/potodo/__init__.py +++ b/potodo/__init__.py @@ -2,4 +2,4 @@ __author__ = """Jules Lasne""" __email__ = "jules.lasne@gmail.com" -__version__ = "0.2.4" +__version__ = "0.3.0" diff --git a/setup.py b/setup.py index bfd27e0..9b5a1a4 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ with open("README.md") as readme: setuptools.setup( name="potodo", - version="0.2.4", + version="0.3.0", description="Will list all .po files that are to be transated", long_description=long_description, long_description_content_type="text/markdown", # This is important! From 008489d391f53f510927b523d143b622655c1dc8 Mon Sep 17 00:00:00 2001 From: antoine Date: Thu, 12 Dec 2019 23:39:49 +0100 Subject: [PATCH 2/3] Fix #37 --- potodo/_github.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/potodo/_github.py b/potodo/_github.py index e495f61..edc7e69 100644 --- a/potodo/_github.py +++ b/potodo/_github.py @@ -1,21 +1,26 @@ import re import requests +import subprocess from typing import Mapping -from subprocess import check_output def get_repo_url(repo_path: str) -> str: """Tries to get the repository url from git commands """ - url = check_output("git remote get-url --all upstream".split(), universal_newlines=True, cwd=repo_path) - if "fatal" in url: - url = check_output("git remote get-url --all upstream".split(), universal_newlines=True, cwd=repo_path) - if "fatal" in url: - # If the commands didn't work - raise RuntimeError( - f"Unknown error. `git get-url --all upstream|origin` returned {url}" - ) + try: + url = subprocess.check_output("git remote get-url --all upstream".split(), + universal_newlines=True, cwd=repo_path, + stderr=subprocess.STDOUT) + except subprocess.CalledProcessError: + try: + url = subprocess.check_output("git remote get-url --all origin".split(), + universal_newlines=True, cwd=repo_path, + stderr=subprocess.STDOUT) + except subprocess.CalledProcessError as e: + raise RuntimeError( + f"Unknown error. `git get-url --all upstream|origin` returned \"{e.output.rstrip()}\"." + ) return url From be099768dd05742ae146e2d246f2617f1e3ba518 Mon Sep 17 00:00:00 2001 From: "Jules Lasne (jlasne - seluj78)" Date: Fri, 13 Dec 2019 12:40:36 +0100 Subject: [PATCH 3/3] Version bump --- potodo/__init__.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/potodo/__init__.py b/potodo/__init__.py index d31cf33..9fd088e 100644 --- a/potodo/__init__.py +++ b/potodo/__init__.py @@ -2,4 +2,4 @@ __author__ = """Jules Lasne""" __email__ = "jules.lasne@gmail.com" -__version__ = "0.3.0" +__version__ = "0.3.1" diff --git a/setup.py b/setup.py index 9b5a1a4..04cc3fe 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ with open("README.md") as readme: setuptools.setup( name="potodo", - version="0.3.0", + version="0.3.1", description="Will list all .po files that are to be transated", long_description=long_description, long_description_content_type="text/markdown", # This is important!