forked from AFPy/potodo
Merge branch 'master' into tox
This commit is contained in:
commit
aa81df65c6
|
@ -2,4 +2,4 @@
|
|||
|
||||
__author__ = """Jules Lasne"""
|
||||
__email__ = "jules.lasne@gmail.com"
|
||||
__version__ = "0.2.4"
|
||||
__version__ = "0.3.1"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import re
|
||||
import subprocess
|
||||
from typing import Mapping
|
||||
from subprocess import check_output
|
||||
|
||||
import requests
|
||||
|
||||
|
@ -8,22 +8,19 @@ import requests
|
|||
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
|
||||
|
||||
|
||||
|
|
2
setup.py
2
setup.py
|
@ -7,7 +7,7 @@ with open("README.md") as readme:
|
|||
|
||||
setuptools.setup(
|
||||
name="potodo",
|
||||
version="0.2.4",
|
||||
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!
|
||||
|
|
Loading…
Reference in New Issue
Block a user