-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcGitHubRepository.py
More file actions
65 lines (62 loc) · 1.93 KB
/
cGitHubRepository.py
File metadata and controls
65 lines (62 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
from .cDataStructure import cDataStructure;
from .fsbGetHTTPResponseData import fsbGetHTTPResponseData;
from .iObjectWithInheritingDataStructure import iObjectWithInheritingDataStructure;
from .iRepository import iRepository;
class cGitHubRepository(iRepository, iObjectWithInheritingDataStructure):
dxInheritingValues = {
"sStructureVersion": "2021-07-02 11:16",
};
sType = "GitHub";
def __init__(oSelf, sbUserName, sbRepositoryName, sbBranch):
oSelf.sbUserName = sbUserName;
oSelf.sbRepositoryName = sbRepositoryName;
oSelf.sbBranch = sbBranch;
oSelf.sb0RepositoryURL = b"https://github.com/%s/%s/tree/%s" % (sbUserName, sbRepositoryName, sbBranch);
oSelf.sb0ProductDetailsJSONURL = b"https://raw.githubusercontent.com/%s/%s/%s/dxProductDetails.json" % \
(sbUserName, sbRepositoryName, sbBranch);
oSelf.sb0LatestVersionZipURL = b"https://github.com/%s/%s/archive/%s.zip" % (sbUserName, sbRepositoryName, sbBranch);
cGitHubRepository.oDataStructure = cDataStructure(
{
"sStructureVersion": "string:2021-07-02 11:16",
"sType": "string:GitHub",
"sbUserName": "ascii",
"sbRepositoryName": "ascii",
"sbBranch": "ascii",
},
f0oConstructor = (
lambda
sStructureVersion, # not used
sType, # Not used
sbUserName,
sbRepositoryName,
sbBranch:
cGitHubRepository(
sbUserName,
sbRepositoryName,
sbBranch
)
),
);
cGitHubRepository.toCompatibleDataStructures = (
cDataStructure(
# Last version before "sStructureVersion" was introduced:
{
"sType": "string:GitHub",
"sUserName": "ascii",
"sRepositoryName": "ascii",
"sBranch": "ascii",
},
f0oConstructor = (
lambda
sType, # Not used
sUserName,
sRepositoryName,
sBranch:
cGitHubRepository(
sbUserName = sUserName,
sbRepositoryName = sRepositoryName,
sbBranch = sBranch,
)
),
),
);