Skip to content

Commit b2d7fb9

Browse files
brunoperdigaoMoult
authored andcommitted
changed imports to integrate with blenderbim
1 parent bf945e3 commit b2d7fb9

5 files changed

Lines changed: 27 additions & 30 deletions

File tree

src/blenderbim/blenderbim/bim/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
"covetool": None,
7272
"augin": None,
7373
"debug": None,
74+
"ifcgit": None,
7475
# Uncomment this line to enable loading of the demo module. Happy hacking!
7576
# The name "demo" must correlate to a folder name in `bim/module/`.
7677
# "demo": None,

src/blenderbim/blenderbim/bim/module/ifcgit/data.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import bpy
22
import os
33
import shutil
4-
import tool
5-
import blenderbim.tool as btool
4+
# import tool
5+
import blenderbim.tool as tool
66

77

88
def refresh():
@@ -35,8 +35,8 @@ def load(cls):
3535

3636
@classmethod
3737
def repo(cls):
38-
if bool(btool.Ifc.get()):
39-
path_ifc = btool.Ifc.get_path()
38+
if bool(tool.Ifc.get()):
39+
path_ifc = tool.Ifc.get_path()
4040
if not os.path.isfile(path_ifc):
4141
return None
4242
return tool.IfcGit.repo_from_path(path_ifc)
@@ -49,7 +49,7 @@ def branch_names(cls):
4949

5050
@classmethod
5151
def path_ifc(cls):
52-
return btool.Ifc.get_path()
52+
return tool.Ifc.get_path()
5353

5454
@classmethod
5555
def branches_by_hexsha(cls):
@@ -67,33 +67,33 @@ def tags_by_hexsha(cls):
6767

6868
@classmethod
6969
def name_ifc(cls):
70-
if bool(btool.Ifc.get()):
71-
path_ifc = btool.Ifc.get_path()
70+
if bool(tool.Ifc.get()):
71+
path_ifc = tool.Ifc.get_path()
7272
if tool.IfcGitRepo.repo:
7373
working_dir = tool.IfcGitRepo.repo.working_dir
7474
return os.path.relpath(path_ifc, working_dir)
7575
return None
7676

7777
@classmethod
7878
def dir_name(cls):
79-
if bool(btool.Ifc.get()):
80-
path_ifc = btool.Ifc.get_path()
79+
if bool(tool.Ifc.get()):
80+
path_ifc = tool.Ifc.get_path()
8181
if not os.path.isfile(path_ifc):
8282
return None
8383
return os.path.dirname(path_ifc)
8484
return None
8585

8686
@classmethod
8787
def base_name(cls):
88-
if bool(btool.Ifc.get()):
89-
path_ifc = btool.Ifc.get_path()
88+
if bool(tool.Ifc.get()):
89+
path_ifc = tool.Ifc.get_path()
9090
return os.path.basename(path_ifc)
9191
return None
9292

9393
@classmethod
9494
def is_dirty(cls):
9595
if tool.IfcGitRepo.repo and cls.git_exe():
96-
path_ifc = btool.Ifc.get_path()
96+
path_ifc = tool.Ifc.get_path()
9797
return tool.IfcGitRepo.repo.is_dirty(path=path_ifc)
9898
return False
9999

src/blenderbim/blenderbim/bim/module/ifcgit/operator.py

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
import os
22
import re
33
import bpy
4-
5-
import core
6-
from tool import IfcGit as tool
4+
import blenderbim.core.ifcgit as core
5+
import blenderbim.tool as tool
6+
# from tool import IfcGit as tool
77
from data import IfcGitData
88

9-
# TODO Remove all handler elements once in the correct folder structure
10-
import handler
9+
# import handler
1110

12-
import blenderbim.tool as btool
11+
# import blenderbim.tool as tool
1312

1413

1514
class CreateRepo(bpy.types.Operator):
@@ -34,7 +33,7 @@ def poll(cls, context):
3433

3534
def execute(self, context):
3635

37-
core.create_repo(tool, btool.Ifc)
36+
core.create_repo(tool.IfcGit, tool.Ifc)
3837
handler.refresh_ui_data()
3938
return {"FINISHED"}
4039

@@ -58,7 +57,7 @@ def poll(cls, context):
5857

5958
def execute(self, context):
6059

61-
core.add_file(tool, btool.Ifc)
60+
core.add_file(tool.IfcGit, tool.Ifc)
6261
handler.refresh_ui_data()
6362
return {"FINISHED"}
6463

@@ -72,7 +71,7 @@ class DiscardUncommitted(bpy.types.Operator):
7271

7372
def execute(self, context):
7473

75-
core.discard_uncomitted(tool, btool.Ifc)
74+
core.discard_uncomitted(tool.IfcGit, tool.Ifc)
7675
handler.refresh_ui_data()
7776
return {"FINISHED"}
7877

@@ -107,7 +106,7 @@ def poll(cls, context):
107106
def execute(self, context):
108107

109108
repo = IfcGitData.data["repo"]
110-
core.commit_changes(tool, btool.Ifc, repo, context)
109+
core.commit_changes(tool.IfcGit, tool.Ifc, repo, context)
111110
handler.refresh_ui_data()
112111
return {"FINISHED"}
113112

@@ -129,7 +128,7 @@ def poll(cls, context):
129128
def execute(self, context):
130129

131130
repo = IfcGitData.data["repo"]
132-
core.refresh_revision_list(tool, repo, btool.Ifc)
131+
core.refresh_revision_list(tool.IfcGit, repo, tool.Ifc)
133132
handler.refresh_ui_data()
134133
return {"FINISHED"}
135134

@@ -143,7 +142,7 @@ class DisplayRevision(bpy.types.Operator):
143142

144143
def execute(self, context):
145144

146-
core.colourise_revision(tool, context)
145+
core.colourise_revision(tool.IfcGit, context)
147146
handler.refresh_ui_data()
148147
return {"FINISHED"}
149148

@@ -158,7 +157,7 @@ class DisplayUncommitted(bpy.types.Operator):
158157
def execute(self, context):
159158

160159
repo = IfcGitData.data["repo"]
161-
core.colourise_uncommitted(tool, btool.Ifc, repo)
160+
core.colourise_uncommitted(tool.IfcGit, tool.Ifc, repo)
162161
handler.refresh_ui_data()
163162
return {"FINISHED"}
164163

@@ -172,7 +171,7 @@ class SwitchRevision(bpy.types.Operator):
172171

173172
def execute(self, context):
174173

175-
core.switch_revision(tool, btool.Ifc)
174+
core.switch_revision(tool.IfcGit, tool.Ifc)
176175
handler.refresh_ui_data()
177176
return {"FINISHED"}
178177

@@ -192,7 +191,7 @@ def poll(cls, context):
192191

193192
def execute(self, context):
194193

195-
if core.merge_branch(tool, btool.Ifc, self):
194+
if core.merge_branch(tool.IfcGit, tool.Ifc, self):
196195
handler.refresh_ui_data()
197196
return {"FINISHED"}
198197
else:

src/blenderbim/blenderbim/bim/module/ifcgit/prop.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import bpy
22
from bpy.types import PropertyGroup
3-
43
from bpy.props import (
54
StringProperty,
65
BoolProperty,
76
CollectionProperty,
87
IntProperty,
98
EnumProperty,
109
)
11-
1210
from data import IfcGitData
1311

1412

src/blenderbim/blenderbim/bim/module/ifcgit/ui.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import bpy
32
import time
43
from data import IfcGitData

0 commit comments

Comments
 (0)