MCPcopy Create free account
hub / github.com/abbeycode/UnrarKit / upload_carthage_archive

Function upload_carthage_archive

Scripts/add-github-release.py:80–98  ·  view source on GitHub ↗

Uploads the archive at the given path to GitHub for the release specified

(token, upload_url, archive_path)

Source from the content-addressed store, hash-verified

78 return 'beta' in tag or 'RC' in tag or 'prerelease' in tag or 'alpha' in tag
79
80def upload_carthage_archive(token, upload_url, archive_path):
81 '''
82 Uploads the archive at the given path to GitHub for the release specified
83 '''
84
85 upload_url = upload_url.split('{')[0]
86 url = '{}?name={}'.format(upload_url, archive_path)
87 header = {
88 'Authorization': 'token {}'.format(token),
89 'Content-Type': 'application/zip'
90 }
91
92 with FileWithLen(archive_path, 'r') as f:
93 request = urllib2.Request(url, f, header)
94 response = urllib2.urlopen(request)
95
96 page = response.read()
97 response_dict = json.loads(page)
98 return True
99
100class FileWithLen(file):
101 def __init__(self, *args, **keyws):

Callers 1

add_releaseFunction · 0.85

Calls 1

FileWithLenClass · 0.85

Tested by

no test coverage detected