You've already forked PythonLib
mirror of
https://github.com/lifebottle/PythonLib.git
synced 2026-02-13 15:25:50 -08:00
Merge pull request #11 from lifebottle/add-releases-function
Add releases function
This commit is contained in:
@@ -5,9 +5,27 @@ import textwrap
|
||||
import os
|
||||
import io
|
||||
import re
|
||||
import requests
|
||||
|
||||
SCRIPT_VERSION = "0.3"
|
||||
|
||||
def get_Releases(org, repo_name, latest=False):
|
||||
|
||||
#git_url = "https://api.github.com/repos/SymphoniaLauren/Tales-of-Rebirth/releases"
|
||||
git_url = "https://api.github.com/repos/{}/{}/releases".format(org, repo_name)
|
||||
|
||||
if latest:
|
||||
git_url = git_url+"/latest"
|
||||
|
||||
header = {
|
||||
"Accept":"application/vnd.github.v3+json"
|
||||
}
|
||||
|
||||
res = requests.get(git_url)
|
||||
json_res = json.loads(res.text)
|
||||
|
||||
return json_res
|
||||
|
||||
def get_directory_path(path):
|
||||
return os.path.dirname(os.path.abspath(path))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user