forked from AFPy/potodo
Merge branch 'master' into tox
This commit is contained in:
commit
aa81df65c6
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
__author__ = """Jules Lasne"""
|
__author__ = """Jules Lasne"""
|
||||||
__email__ = "jules.lasne@gmail.com"
|
__email__ = "jules.lasne@gmail.com"
|
||||||
__version__ = "0.2.4"
|
__version__ = "0.3.1"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import re
|
import re
|
||||||
|
import subprocess
|
||||||
from typing import Mapping
|
from typing import Mapping
|
||||||
from subprocess import check_output
|
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
|
@ -8,22 +8,19 @@ import requests
|
||||||
def get_repo_url(repo_path: str) -> str:
|
def get_repo_url(repo_path: str) -> str:
|
||||||
"""Tries to get the repository url from git commands
|
"""Tries to get the repository url from git commands
|
||||||
"""
|
"""
|
||||||
url = check_output(
|
try:
|
||||||
"git remote get-url --all upstream".split(),
|
url = subprocess.check_output("git remote get-url --all upstream".split(),
|
||||||
universal_newlines=True,
|
universal_newlines=True, cwd=repo_path,
|
||||||
cwd=repo_path,
|
stderr=subprocess.STDOUT)
|
||||||
)
|
except subprocess.CalledProcessError:
|
||||||
if "fatal" in url:
|
try:
|
||||||
url = check_output(
|
url = subprocess.check_output("git remote get-url --all origin".split(),
|
||||||
"git remote get-url --all upstream".split(),
|
universal_newlines=True, cwd=repo_path,
|
||||||
universal_newlines=True,
|
stderr=subprocess.STDOUT)
|
||||||
cwd=repo_path,
|
except subprocess.CalledProcessError as e:
|
||||||
)
|
raise RuntimeError(
|
||||||
if "fatal" in url:
|
f"Unknown error. `git get-url --all upstream|origin` returned \"{e.output.rstrip()}\"."
|
||||||
# If the commands didn't work
|
)
|
||||||
raise RuntimeError(
|
|
||||||
f"Unknown error. `git get-url --all upstream|origin` returned {url}"
|
|
||||||
)
|
|
||||||
return url
|
return url
|
||||||
|
|
||||||
|
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -7,7 +7,7 @@ with open("README.md") as readme:
|
||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name="potodo",
|
name="potodo",
|
||||||
version="0.2.4",
|
version="0.3.1",
|
||||||
description="Will list all .po files that are to be transated",
|
description="Will list all .po files that are to be transated",
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
long_description_content_type="text/markdown", # This is important!
|
long_description_content_type="text/markdown", # This is important!
|
||||||
|
|
Loading…
Reference in New Issue
Block a user