Skip to content

Commit

Permalink
Merge branch 'fix_region' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
chuongmep committed Mar 5, 2024
2 parents 52d5f68 + e91c643 commit 5234367
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion APSToolkitPython/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setuptools.setup(
name="aps-toolkit",
version="0.2.6",
version="0.2.7",
author="chuong mep",
author_email="[email protected]",
description="A Toolkit Autodesk Platform Services for Python",
Expand Down
4 changes: 2 additions & 2 deletions APSToolkitPython/src/aps_toolkit/ProDbReaderRevit.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@


class PropDbReaderRevit(PropReader):
def __int__(self, urn, token):
super().__init__(urn, token)
def __int__(self, urn, token,region="US"):
super().__init__(urn, token,region)

def _get_recursive_child(self, output, id, name):
children = self.get_children(id)
Expand Down
9 changes: 5 additions & 4 deletions APSToolkitPython/src/aps_toolkit/PropReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class PropReader:
# self.avs = json.load(avs_file)
# self.attrs = json.load(attrs_file)
# self.vals = json.load(vals_file)
def __init__(self, urn, token):
def __init__(self, urn, token,region="US"):
items = [
"objects_attrs.json.gz",
"objects_vals.json.gz",
Expand All @@ -41,7 +41,8 @@ def __init__(self, urn, token):
access_token = token.access_token
# add headers authorization
headers = {
"Authorization": f"Bearer {access_token}"
"Authorization": f"Bearer {access_token}",
"region": region
}
# request
response = requests.get(URL, headers=headers)
Expand All @@ -57,9 +58,9 @@ def __init__(self, urn, token):
path = f"urn:adsk.viewing:fs.file:{urn}/output/Resource/{item}"
url = f"{host}/modelderivative/v2/designdata/{urn}/manifest/{path}"
# add headers authorization

headers = {
"Authorization": f"Bearer {access_token}"
"Authorization": f"Bearer {access_token}",
"region": region
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
Expand Down

0 comments on commit 5234367

Please sign in to comment.