Skip to content

Commit

Permalink
REVIEW: final modifications integrated
Browse files Browse the repository at this point in the history
  • Loading branch information
9and3 committed Feb 6, 2024
1 parent 27b3bf2 commit ac07855
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,18 @@ Alternatively, you can also use this tool directly from the command line.
Make sure to have IronPython or Python3/pythonnet installed and the `GH_IO.dll` assembly available.
Then start the script pointing it to a source and target folder, e.g.:

ipy componentize_ipy.py examples build
python componentize_cpy.py examples build
ipy componentize_ipy.py examples/ipy build
python componentize_cpy.py examples/cpy build

Optionally, tag it with a version:

ipy componentize_ipy.py examples build --version 0.1.2
python componentize_cpy.py examples build --version 0.1.2
ipy componentize_ipy.py examples/ipy build --version 0.1.2
python componentize_cpy.py examples/cpy build --version 0.1.2

An optional name prefix can help tell components apart from other similarly named ones:

ipy componentize_ipy.py examples build --prefix "(PACKAGE-NAME)"
python componentize_cpy.py examples build --prefix "(PACKAGE-NAME)"
ipy componentize_ipy.py examples/ipy build --prefix "(PACKAGE-NAME)"
python componentize_cpy.py examples/cpy build --prefix "(PACKAGE-NAME)"

## How to create components

Expand Down
6 changes: 3 additions & 3 deletions componentize_cpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import tempfile
import urllib.request, urllib.parse, urllib.error
import zipfile
from io import StringIO
from io import BytesIO

import clr
import System
Expand Down Expand Up @@ -66,9 +66,9 @@ def fetch_ghio_lib(target_folder="temp"):
ghio_dll = "GH_IO.dll"
filename = "lib/net48/" + ghio_dll

response = urllib.urlopen("https://www.nuget.org/api/v2/package/Grasshopper/")
response = urllib.request.urlopen("https://www.nuget.org/api/v2/package/Grasshopper/")
dst_file = os.path.join(target_folder, ghio_dll)
zip_file = zipfile.ZipFile(StringIO.StringIO(response.read()))
zip_file = zipfile.ZipFile(BytesIO(response.read()))

with zip_file.open(filename, "r") as zipped_dll:
with open(dst_file, "wb") as fp:
Expand Down
6 changes: 3 additions & 3 deletions examples/cpy/Test_KitchenSink/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"iconDisplay": 2,
"inputParameters": [
{
"name": "X",
"name": "x",
"nickname": "x",
"description": "The X value of the component.",
"optional": true,
Expand All @@ -25,7 +25,7 @@
"simplify": false
},
{
"name": "Y",
"name": "x",
"nickname": "y",
"description": "The Y value of the component.",
"optional": true,
Expand All @@ -38,7 +38,7 @@
"simplify": true
},
{
"name": "Z",
"name": "z",
"nickname": "z",
"description": "The Z value of the component.",
"optional": true,
Expand Down

0 comments on commit ac07855

Please sign in to comment.