Skip to content

Commit

Permalink
Merge branch 'release/v0.5.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Zepmanbc committed Jul 9, 2020
2 parents 4fce4ce + d503852 commit 38fac67
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 106 deletions.
19 changes: 19 additions & 0 deletions HISTORY.rst
Expand Up @@ -2,6 +2,25 @@
History
=======

0.5.2 (2020-07-09)
------------------

Documentation update

* usage: path slashes correction

Docstring correction

* drawing_list_models : correction (`issue#18`_)

Bugfix

* file_get_transform : Does not return *transform* key (`issue#17`_)

.. _`issue#18`: https://github.com/Zepmanbc/creopyson/issues/18
.. _`issue#17`: https://github.com/Zepmanbc/creopyson/issues/17


0.5.1 (2020-05-19)
------------------

Expand Down
2 changes: 1 addition & 1 deletion creopyson/__init__.py
Expand Up @@ -4,7 +4,7 @@

__author__ = """Benjamin C."""
__email__ = 'zepman@gmail.com'
__version__ = '0.5.1'
__version__ = '0.5.2'

from creopyson.connection import Client
from creopyson.objects import jlpoint
Expand Down
78 changes: 17 additions & 61 deletions creopyson/drawing.py
Expand Up @@ -54,7 +54,7 @@ def create(
scale=None,
display=None,
activate=None,
new_window=None
new_window=None,
):
"""Create a new drawing from a template.
Expand Down Expand Up @@ -107,7 +107,7 @@ def create_gen_view(
model=None,
scale=None,
display_data=None,
exploded=None
exploded=None,
):
"""Create general view on a drawing.
Expand Down Expand Up @@ -138,10 +138,7 @@ def create_gen_view(
None
"""
data = {
"model_view": model_view,
"point": point
}
data = {"model_view": model_view, "point": point}
if drawing:
data["drawing"] = drawing
if view:
Expand Down Expand Up @@ -169,7 +166,7 @@ def create_proj_view(
view=None,
sheet=None,
display_data=None,
exploded=None
exploded=None,
):
"""Create projection view on a drawing.
Expand Down Expand Up @@ -201,10 +198,7 @@ def create_proj_view(
None
"""
data = {
"parent_view": parent_view,
"point": point
}
data = {"parent_view": parent_view, "point": point}
if drawing:
data["drawing"] = drawing
if view:
Expand All @@ -219,12 +213,7 @@ def create_proj_view(


def create_symbol(
client,
symbol_file,
point,
drawing=None,
replace_values=None,
sheet=None
client, symbol_file, point, drawing=None, replace_values=None, sheet=None
):
"""Add a symbol instance to a drawing.
Expand All @@ -248,10 +237,7 @@ def create_symbol(
None
"""
data = {
"symbol_file": symbol_file,
"point": point
}
data = {"symbol_file": symbol_file, "point": point}
if drawing:
data["drawing"] = drawing
if replace_values:
Expand All @@ -261,12 +247,7 @@ def create_symbol(
return client._creoson_post("drawing", "create_symbol", data)


def delete_models(
client,
model=None,
drawing=None,
delete_views=None
):
def delete_models(client, model=None, drawing=None, delete_views=None):
"""Delete one or more models from a drawing.
Args:
Expand Down Expand Up @@ -360,13 +341,7 @@ def delete_symbol_inst(client, symbol_id, drawing=None):
return client._creoson_post("drawing", "delete_symbol_inst", data)


def delete_view(
client,
view,
drawing=None,
sheet=None,
del_children=None
):
def delete_view(client, view, drawing=None, sheet=None, del_children=None):
"""Delete a drawing view.
Args:
Expand Down Expand Up @@ -450,8 +425,7 @@ def get_num_sheets(client, drawing=None):
data = {}
if drawing:
data["drawing"] = drawing
return client._creoson_post(
"drawing", "get_num_sheets", data, "num_sheets")
return client._creoson_post("drawing", "get_num_sheets", data, "num_sheets")


def get_sheet_format(client, sheet, drawing=None):
Expand Down Expand Up @@ -616,12 +590,11 @@ def is_symbol_def_loaded(client, symbol_file, drawing=None):
data = {"symbol_file": symbol_file}
if drawing:
data["drawing"] = drawing
return client._creoson_post(
"drawing", "is_symbol_def_loaded", data, "loaded")
return client._creoson_post("drawing", "is_symbol_def_loaded", data, "loaded")


def list_models(client, model=None, drawing=None):
"""Check whether a symbol definition file is loaded into Creo.
"""List the models contained in a drawing.
Args:
client (obj):
Expand All @@ -644,12 +617,7 @@ def list_models(client, model=None, drawing=None):
return client._creoson_post("drawing", "list_models", data, "files")


def list_symbols(
client,
drawing=None,
symbol_file=None,
sheet=None
):
def list_symbols(client, drawing=None, symbol_file=None, sheet=None):
"""List symbols contained on a drawing.
Args:
Expand Down Expand Up @@ -826,10 +794,7 @@ def rename_view(client, view, new_view, drawing=None):
None
"""
data = {
"view": view,
"new_view": new_view
}
data = {"view": view, "new_view": new_view}
if drawing:
data["drawing"] = drawing
return client._creoson_post("drawing", "rename_view", data)
Expand All @@ -854,10 +819,7 @@ def scale_sheet(client, sheet, scale, drawing=None, model=None):
None
"""
data = {
"sheet": sheet,
"scale": scale
}
data = {"sheet": sheet, "scale": scale}
if drawing:
data["drawing"] = drawing
if model:
Expand Down Expand Up @@ -955,10 +917,7 @@ def set_sheet_format(client, sheet, file_format, dirname=None, drawing=None):
Returns:
None
"""
data = {
"sheet": sheet,
"dirname": dirname
}
data = {"sheet": sheet, "dirname": dirname}
if drawing:
data["drawing"] = drawing
if file_format:
Expand All @@ -983,10 +942,7 @@ def set_view_loc(client, view, point, drawing=None):
None
"""
data = {
"view": view,
"point": point
}
data = {"view": view, "point": point}
if drawing:
data["drawing"] = drawing
return client._creoson_post("drawing", "set_cur_model", data)
Expand Down
53 changes: 12 additions & 41 deletions creopyson/file.py
Expand Up @@ -14,7 +14,7 @@ def assemble(
package_assembly=None,
walk_children=None,
assemble_to_root=None,
suppress=None
suppress=None,
):
"""Assemble a component into an assembly.
Expand Down Expand Up @@ -189,10 +189,7 @@ def display(client, file_, activate=None):
None
"""
data = {
"file": file_,
"activate": True
}
data = {"file": file_, "activate": True}
if activate is not None:
data["activate"] = activate
return client._creoson_post("file", "display", data)
Expand Down Expand Up @@ -299,11 +296,7 @@ def get_cur_material(client, file_=None):
return client._creoson_post("file", "get_cur_material", data, "material")


def get_cur_material_wildcard(
client,
file_=None,
include_non_matching_parts=False
):
def get_cur_material_wildcard(client, file_=None, include_non_matching_parts=False):
"""Get the current material for a part or parts.
Note: This is the same as 'get_cur_material' but this function allows
Expand Down Expand Up @@ -333,12 +326,7 @@ def get_cur_material_wildcard(
data["file"] = active_file["file"]
if include_non_matching_parts:
data["include_non_matching_parts"] = True
return client._creoson_post(
"file",
"get_cur_material_wildcard",
data,
"materials"
)
return client._creoson_post("file", "get_cur_material_wildcard", data, "materials")


def get_fileinfo(client, file_=None):
Expand Down Expand Up @@ -444,7 +432,7 @@ def get_transform(client, asm=None, path=None, csys=None):
data["path"] = path
if csys:
data["csys"] = csys
return client._creoson_post("file", "get_transform", data, "transform")
return client._creoson_post("file", "get_transform", data)


def has_instances(client, file_=None):
Expand Down Expand Up @@ -563,10 +551,7 @@ def list_materials(client, file_=None, material=None):


def list_materials_wildcard(
client,
file_=None,
material=None,
include_non_matching_parts=False
client, file_=None, material=None, include_non_matching_parts=False
):
"""List materials on a part or parts.
Expand Down Expand Up @@ -600,12 +585,7 @@ def list_materials_wildcard(
data["material"] = material
if include_non_matching_parts:
data["include_non_matching_parts"] = True
return client._creoson_post(
"file",
"list_materials_wildcard",
data,
"materials"
)
return client._creoson_post("file", "list_materials_wildcard", data, "materials")


def list_simp_reps(client, file_=None, rep=None):
Expand Down Expand Up @@ -663,10 +643,7 @@ def load_material_file(client, material, dirname=None, file_=None):
List of files impacted.
"""
data = {
"dirname": dirname,
"material": material
}
data = {"dirname": dirname, "material": material}
if file_ is not None:
data["file"] = file_
else:
Expand Down Expand Up @@ -729,7 +706,7 @@ def open_(
display=None,
activate=None,
new_window=None,
regen_force=None
regen_force=None,
):
"""Open one or more files in memory or from the drive.
Expand Down Expand Up @@ -834,8 +811,7 @@ def postregen_relations_get(client, file_=None):
active_file = client.file_get_active()
if active_file is not None:
data["file"] = active_file["file"]
return client._creoson_post(
"file", "postregen_relations_get", data, "relations")
return client._creoson_post("file", "postregen_relations_get", data, "relations")


def postregen_relations_set(client, file_=None, relations=None):
Expand Down Expand Up @@ -988,10 +964,7 @@ def rename(client, new_name, file_=None, onlysession=None):
(str): The new model name.
"""
data = {
"new_name": new_name,
"onlysession": False
}
data = {"new_name": new_name, "onlysession": False}
if file_ is not None:
data["file"] = file_
else:
Expand Down Expand Up @@ -1070,9 +1043,7 @@ def set_cur_material(client, material, file_=None):
list of impacted files.
"""
data = {
"material": material
}
data = {"material": material}
if file_ is not None:
data["file"] = file_
else:
Expand Down
2 changes: 1 addition & 1 deletion docs/usage.rst
Expand Up @@ -14,7 +14,7 @@ Launch CREOSON:

If you want to launch Creo with Creoson, please create a `nitro_proe_remote.bat` file.

You can copy `C:\Program Files\PTC\Creo x.x\Mxxx\Parametric\bin\parametric.bat` and rename it `nitro_proe_remote.bat` anywhere you want.
You can copy `C:\\Program Files\\PTC\\Creo x.x\\Mxxx\\Parametric\\bin\\parametric.bat` and rename it `nitro_proe_remote.bat` anywhere you want.

To use Creopyson in a project::

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.5.1
current_version = 0.5.2
commit = True
tag = False

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -41,6 +41,6 @@
test_suite='tests',
tests_require=test_requirements,
url='https://github.com/Zepmanbc/creopyson',
version='0.5.1',
version='0.5.2',
zip_safe=False,
)

0 comments on commit 38fac67

Please sign in to comment.