Skip to content

Commit e58abd6

Browse files
committed
Modify the package import path to enhance the compatibility.
1 parent 000a34d commit e58abd6

21 files changed

+44
-43
lines changed

samples/language/spellcheck_samples.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ def spellcheck(subscription_key):
3838

3939
if __name__ == "__main__":
4040
import sys, os.path
41-
sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..")))
42-
from tools import execute_samples
41+
sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..", "..")))
42+
from samples.tools import execute_samples
4343
execute_samples(globals(), SUBSCRIPTION_KEY_ENV_NAME)

samples/language/text_analytics_samples.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,6 @@ def sentiment(subscription_key):
122122

123123
if __name__ == "__main__":
124124
import sys, os.path
125-
sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..")))
126-
from tools import execute_samples
125+
sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..", "..")))
126+
from samples.tools import execute_samples
127127
execute_samples(globals(), SUBSCRIPTION_KEY_ENV_NAME)

samples/search/custom_search_samples.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ def custom_search_web_page_result_lookup(subscription_key):
2727

2828
if __name__ == "__main__":
2929
import sys, os.path
30-
sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..")))
31-
from tools import execute_samples
30+
sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..", "..")))
31+
from samples.tools import execute_samples
3232
execute_samples(globals(), SUBSCRIPTION_KEY_ENV_NAME)

samples/search/entity_search_samples.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,6 @@ def error(subscription_key):
183183

184184
if __name__ == "__main__":
185185
import sys, os.path
186-
sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..")))
187-
from tools import execute_samples
186+
sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..", "..")))
187+
from samples.tools import execute_samples
188188
execute_samples(globals(), SUBSCRIPTION_KEY_ENV_NAME)

samples/search/image_search_samples.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,6 @@ def image_detail(subscription_key):
196196

197197
if __name__ == "__main__":
198198
import sys, os.path
199-
sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..")))
200-
from tools import execute_samples
199+
sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..", "..")))
200+
from samples.tools import execute_samples
201201
execute_samples(globals(), SUBSCRIPTION_KEY_ENV_NAME)

samples/search/news_search_samples.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,6 @@ def news_trending(subscription_key):
120120

121121
if __name__ == "__main__":
122122
import sys, os.path
123-
sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..")))
124-
from tools import execute_samples
123+
sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..", "..")))
124+
from samples.tools import execute_samples
125125
execute_samples(globals(), SUBSCRIPTION_KEY_ENV_NAME)

samples/search/video_search_samples.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,6 @@ def video_detail(subscription_key):
145145

146146
if __name__ == "__main__":
147147
import sys, os.path
148-
sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..")))
149-
from tools import execute_samples
148+
sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..", "..")))
149+
from samples.tools import execute_samples
150150
execute_samples(globals(), SUBSCRIPTION_KEY_ENV_NAME)

samples/search/visual_search_samples.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,6 @@ def search_insights_token_with_crop_area(subscription_key):
197197

198198
if __name__ == "__main__":
199199
import sys, os.path
200-
sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..")))
201-
from tools import execute_samples
200+
sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..", "..")))
201+
from samples.tools import execute_samples
202202
execute_samples(globals(), SUBSCRIPTION_KEY_ENV_NAME)

samples/search/web_search_samples.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,6 @@ def web_search_with_answer_count_promote_and_safe_search(subscription_key):
157157

158158
if __name__ == "__main__":
159159
import sys, os.path
160-
sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..")))
161-
from tools import execute_samples
160+
sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..", "..")))
161+
from samples.tools import execute_samples
162162
execute_samples(globals(), SUBSCRIPTION_KEY_ENV_NAME)

samples/vision/computer_vision_samples.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ def image_analysis_in_stream(subscription_key):
4040

4141
if __name__ == "__main__":
4242
import sys, os.path
43-
sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..")))
44-
from tools import execute_samples
43+
sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..", "..")))
44+
from samples.tools import execute_samples
4545
execute_samples(globals(), SUBSCRIPTION_KEY_ENV_NAME)

0 commit comments

Comments
 (0)