[mod] import at the debigging of the file, it's not yunohost codebase
This commit is contained in:
@ -5,6 +5,7 @@ import sys
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
from urllib2 import urlopen
|
from urllib2 import urlopen
|
||||||
|
from urlparse import urlparse
|
||||||
|
|
||||||
states = {
|
states = {
|
||||||
1: "notworking",
|
1: "notworking",
|
||||||
@ -50,7 +51,6 @@ if __name__ == '__main__':
|
|||||||
git_data = json.load(urlopen("https://api.github.com/repos/%(owner)s/%(repo)s/commits" % {"owner": owner, "repo": repo}))
|
git_data = json.load(urlopen("https://api.github.com/repos/%(owner)s/%(repo)s/commits" % {"owner": owner, "repo": repo}))
|
||||||
revision = git_data[0]["sha"]
|
revision = git_data[0]["sha"]
|
||||||
else:
|
else:
|
||||||
from urlparse import urlparse
|
|
||||||
parsed_uri = urlparse( url )
|
parsed_uri = urlparse( url )
|
||||||
base_url = '{uri.scheme}://{uri.netloc}/'.format(uri=parsed_uri)
|
base_url = '{uri.scheme}://{uri.netloc}/'.format(uri=parsed_uri)
|
||||||
# Try with gitlab api
|
# Try with gitlab api
|
||||||
|
Reference in New Issue
Block a user