File tree Expand file tree Collapse file tree 3 files changed +28
-5
lines changed
Expand file tree Collapse file tree 3 files changed +28
-5
lines changed Original file line number Diff line number Diff line change @@ -3,4 +3,6 @@ __pycache__/
33* .egg
44* .egg-info
55dist
6- * build
6+ * build
7+ * .whl
8+ .idea
Original file line number Diff line number Diff line change 11# Mergin python client
22
3- Repo for mergin client and basic utils.
3+ Repo for mergin client and basic utils.
4+
5+ For using mergin client with its dependencies locally run:
6+
7+ python3 setup.py sdist bdist_wheel
8+ mkdir -p mergin/deps
9+ pip wheel -r mergin_client.egg-info/requires.txt -w mergin/deps
Original file line number Diff line number Diff line change 11import os
22import re
33import json
4- import pytz
54import zlib
65import base64
76import shutil
87import urllib .parse
98import urllib .request
10- import dateutil .parser
119from datetime import datetime
12- from requests_toolbelt import MultipartEncoder
10+
11+ this_dir = os .path .dirname (os .path .realpath (__file__ ))
12+
13+ try :
14+ from requests_toolbelt import MultipartEncode
15+ import pytz
16+ import dateutil .parser
17+ except ImportError :
18+ # this is to import all dependencies shipped with package (e.g. to use in qgis-plugin)
19+ deps_dir = os .path .join (this_dir , 'deps' )
20+ if os .path .exists (deps_dir ):
21+ import sys
22+ for f in os .listdir (os .path .join (deps_dir )):
23+ sys .path .append (os .path .join (deps_dir , f ))
24+
25+ from requests_toolbelt import MultipartEncode
26+ import pytz
27+ import dateutil .parser
1328
1429from .utils import save_to_file , generate_checksum , move_file
1530from .multipart import MultipartReader , parse_boundary
You can’t perform that action at this time.
0 commit comments