SkillLink 0.1.2__py3-none-any.whl → 0.1.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- SkillLink/SkillLink.py +9 -4
- {skilllink-0.1.2.dist-info → skilllink-0.1.3.dist-info}/METADATA +1 -1
- skilllink-0.1.3.dist-info/RECORD +6 -0
- skilllink-0.1.2.dist-info/RECORD +0 -6
- {skilllink-0.1.2.dist-info → skilllink-0.1.3.dist-info}/WHEEL +0 -0
- {skilllink-0.1.2.dist-info → skilllink-0.1.3.dist-info}/top_level.txt +0 -0
SkillLink/SkillLink.py
CHANGED
@@ -8,10 +8,10 @@ from io import BytesIO
|
|
8
8
|
logger = logging.getLogger(__name__)
|
9
9
|
|
10
10
|
class SkillLink:
|
11
|
-
def __init__(self, githubRepo: str = None, repoFolder: str = None, localDir: str = None):
|
11
|
+
def __init__(self, githubRepo: str = None, repoFolder: str = None, localDir: str = None, forgedDir: str = None):
|
12
12
|
self.githubRepo = githubRepo
|
13
13
|
self.repoFolder = repoFolder
|
14
|
-
self.localDir = localDir
|
14
|
+
self.localDir = localDir or forgedDir
|
15
15
|
if not self.githubRepo:
|
16
16
|
raise ValueError("GitHub repo must be specified e.g., 'TristanMcBrideSr/SkillForge'")
|
17
17
|
if not self.repoFolder:
|
@@ -54,11 +54,15 @@ class SkillLink:
|
|
54
54
|
Syncs skills from a GitHub repo zip to local directory.
|
55
55
|
|
56
56
|
Kwargs:
|
57
|
+
localDir: str, local directory to sync to (overrides class default)
|
58
|
+
forgedDir: alias for localDir (optional)
|
57
59
|
skillList: list of skills to sync (default: all)
|
58
60
|
override: bool, if True always overwrite local (default: False)
|
59
61
|
githubToken: str, GitHub token for private repos (default: None)
|
60
62
|
branch: str, Git branch (default: 'master')
|
61
63
|
"""
|
64
|
+
# Prefer localDir or forgedDir from kwargs, else fall back to self.localDir
|
65
|
+
dstDir = kwargs.get('localDir') or kwargs.get('forgedDir') or self.localDir
|
62
66
|
skillList = kwargs.get('skillList')
|
63
67
|
override = kwargs.get('override', False)
|
64
68
|
githubToken = kwargs.get('githubToken')
|
@@ -87,9 +91,9 @@ class SkillLink:
|
|
87
91
|
shutil.rmtree(tempDir)
|
88
92
|
raise FileNotFoundError(f"Can't find {self.repoFolder} in the repo!")
|
89
93
|
|
90
|
-
os.makedirs(
|
94
|
+
os.makedirs(dstDir, exist_ok=True)
|
91
95
|
|
92
|
-
self.syncNewFiles(skillsSrc,
|
96
|
+
self.syncNewFiles(skillsSrc, dstDir, skillList, override)
|
93
97
|
|
94
98
|
shutil.rmtree(tempDir)
|
95
99
|
logger.info("Sync complete.")
|
@@ -98,3 +102,4 @@ class SkillLink:
|
|
98
102
|
except Exception as e:
|
99
103
|
logger.error(f"Sync failed: {e}", exc_info=True)
|
100
104
|
return False
|
105
|
+
|
@@ -0,0 +1,6 @@
|
|
1
|
+
SkillLink/SkillLink.py,sha256=6RYgAnl2f8P1vxWwGtTBhlV6syvhJG3hkeoAPkfVWck,4439
|
2
|
+
SkillLink/__init__.py,sha256=b6TVK2Ve_Cct2wu3FLn_2X7cXzCqhI6kTIM81OorPMM,32
|
3
|
+
skilllink-0.1.3.dist-info/METADATA,sha256=jao0ztINx37KZmvwe_57iHkA9B2hEWVIjC3rTKmdIxI,4710
|
4
|
+
skilllink-0.1.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
5
|
+
skilllink-0.1.3.dist-info/top_level.txt,sha256=8Nq2y-9CjjC46x0nlmsBxabHDFhJcw5FnprPDQz3RKY,10
|
6
|
+
skilllink-0.1.3.dist-info/RECORD,,
|
skilllink-0.1.2.dist-info/RECORD
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
SkillLink/SkillLink.py,sha256=oVu89Xey_7QUW0wvWvdERkMrNRXz0QwRh016scgSdk0,4110
|
2
|
-
SkillLink/__init__.py,sha256=b6TVK2Ve_Cct2wu3FLn_2X7cXzCqhI6kTIM81OorPMM,32
|
3
|
-
skilllink-0.1.2.dist-info/METADATA,sha256=vCXzBPkzP_6sxyjG5glnyOseBC8f02H5wKOkv0cH62M,4710
|
4
|
-
skilllink-0.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
5
|
-
skilllink-0.1.2.dist-info/top_level.txt,sha256=8Nq2y-9CjjC46x0nlmsBxabHDFhJcw5FnprPDQz3RKY,10
|
6
|
-
skilllink-0.1.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|