Skip to content

Commit b7ef3c5

Browse files
authored
Merge branch 'main' into glft_fix
2 parents ebd6b00 + 21c8e8b commit b7ef3c5

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3838
* Changed `RobotModelArtists.atteched_tool_models` to dictionary to support multiple tools.
3939
* Locked `sphinx` to 4.5.
4040
* Changed `GLTFExporter` such that generated gltfs can be viewed with webxr
41+
* Fixed source directory path in `compas_ghpython.uninstall` plugin.
42+
* Fixed bug in`compas_ghpython.components`that ignored input list of `.ghuser` objects to uninstall.
4143

4244
### Removed
4345

src/compas_ghpython/components/__init__.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,16 @@ def install_userobjects(source):
7676
return list(zip(symlinks_to_add, created))
7777

7878

79-
def uninstall_userobjects(userobjects):
79+
def uninstall_userobjects(userobjects=None):
8080
"""
8181
Uninstalls Grasshopper user objects.
8282
8383
Parameters
8484
----------
85-
userobjects : list of str
85+
userobjects : list of str, optional
8686
List of user object names to uninstall, eg. ``['Compas_Info.ghuser']``
87+
Defaults to ``None``, in which case the uninstaller will search for user objects
88+
whose name starts with the string 'compas'.
8789
8890
Returns
8991
-------
@@ -93,10 +95,11 @@ def uninstall_userobjects(userobjects):
9395
version = get_version_from_args()
9496
dstdir = get_grasshopper_userobjects_path(version)
9597

96-
userobjects = []
97-
for name in os.listdir(dstdir):
98-
if name.lower().startswith('compas'):
99-
userobjects.append(name)
98+
if not userobjects:
99+
userobjects = []
100+
for name in os.listdir(dstdir):
101+
if name.lower().startswith('compas'):
102+
userobjects.append(name)
100103

101104
symlinks = []
102105
for obj in userobjects:
@@ -108,7 +111,4 @@ def uninstall_userobjects(userobjects):
108111
return list(zip(symlinks, removed))
109112

110113

111-
__all__ = [
112-
'install_userobjects',
113-
'uninstall_userobjects'
114-
]
114+
__all__ = ['install_userobjects', 'uninstall_userobjects']

src/compas_ghpython/uninstall.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def after_rhino_uninstall(uninstalled_packages):
1414
if 'compas_ghpython' not in uninstalled_packages:
1515
return []
1616

17-
srcdir = os.path.join(os.path.dirname(__file__), 'components')
17+
srcdir = os.path.join(os.path.dirname(__file__), 'components', 'ghuser')
1818
userobjects = [os.path.basename(ghuser) for ghuser in glob.glob(os.path.join(srcdir, '*.ghuser'))]
1919
uninstalled_objects = uninstall_userobjects(userobjects)
2020

0 commit comments

Comments
 (0)