Skip to content

Commit 2929873

Browse files
authored
update public and test server URL's (#137)
1 parent f0783fc commit 2929873

File tree

8 files changed

+49
-49
lines changed

8 files changed

+49
-49
lines changed

.github/workflows/autotests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Auto Tests
22
on: [push]
33
env:
4-
TEST_MERGIN_URL: https://test.dev.cloudmergin.com/
4+
TEST_MERGIN_URL: https://test.dev.merginmaps.com/
55
TEST_API_USERNAME: test_plugin
66
TEST_API_PASSWORD: ${{ secrets.MERGINTEST_API_PASSWORD }}
77
TEST_API_USERNAME2: test_plugin2

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
[![Auto Tests/Package](https://github.com/lutraconsulting/mergin-py-client/workflows/Auto%20Tests/badge.svg)](https://github.com/lutraconsulting/mergin-py-client/actions?query=workflow%3A%22Auto+Tests%22)
33
[![Coverage Status](https://img.shields.io/coveralls/lutraconsulting/mergin-py-client.svg)](https://coveralls.io/github/lutraconsulting/mergin-py-client)
44

5-
# Mergin Python Client
5+
# Mergin Maps Python Client
66

7-
This repository contains a Python client module for access to [Mergin](https://public.cloudmergin.com/)
8-
service and a command-line tool for easy access to data stored in Mergin.
7+
This repository contains a Python client module for access to [Mergin Maps](https://merginmaps.com/)
8+
service and a command-line tool for easy access to data stored in Mergin Maps.
99

1010
<div><img align="left" width="45" height="45" src="https://raw.githubusercontent.com/MerginMaps/docs/main/src/.vuepress/public/slack.svg"><a href="https://merginmaps.com/community/join">Join our community chat</a><br/>and ask questions!</div><br />
1111

@@ -43,7 +43,7 @@ When the module is installed, it comes with `mergin` command line tool.
4343
$ mergin --help
4444
Usage: mergin [OPTIONS] COMMAND [ARGS]...
4545
46-
Command line interface for the Mergin client module. For user
46+
Command line interface for the Mergin Maps client module. For user
4747
authentication on server there are two options:
4848
4949
1. authorization token environment variable (MERGIN_AUTH) is defined, or
@@ -55,22 +55,22 @@ Usage: mergin [OPTIONS] COMMAND [ARGS]...
5555
variable manually.
5656
5757
Options:
58-
--url TEXT Mergin server URL. Default is:
59-
https://public.cloudmergin.com
58+
--url TEXT Mergin Maps server URL. Default is:
59+
https://app.merginmaps.com/
6060
--auth-token TEXT Mergin authentication token string
6161
--username TEXT
6262
--password TEXT
6363
--help Show this message and exit.
6464
6565
Commands:
6666
clone Clone project from server.
67-
create Create a new project on Mergin server.
68-
download Download last version of mergin project
67+
create Create a new project on Mergin Maps server.
68+
download Download last version of Mergin Maps project
6969
download-file Download project file at specified version.
7070
list-projects List projects on the server
7171
login Login to the service and see how to set the token...
72-
pull Fetch changes from Mergin repository
73-
push Upload local changes into Mergin repository
72+
pull Fetch changes from Mergin Maps repository
73+
push Upload local changes into Mergin Maps repository
7474
remove Remove project from server.
7575
share Fetch permissions to project
7676
share-add Add permissions to [users] to project
@@ -101,11 +101,11 @@ working directory:
101101
```
102102
$ mergin status
103103
```
104-
2. pull changes from Mergin service
104+
2. pull changes from Mergin Maps service
105105
```
106106
$ mergin pull
107107
```
108-
3. push local changes to Mergin service
108+
3. push local changes to Mergin Maps service
109109
```
110110
$ mergin push
111111
```
@@ -130,7 +130,7 @@ it is possible to run other commands without specifying username/password.
130130

131131
## Development
132132

133-
### How to release
133+
### How to release
134134

135135
1. Update version in `setup.py` and `mergin/version.py`
136136
2. Tag git repository with the new version
@@ -144,16 +144,16 @@ python3 -m twine upload dist/mergin-client-x.y.z.tar.gz
144144
### Installing deps
145145

146146
Python 3.7+ required. Create `mergin/deps` folder where [geodiff](https://github.com/lutraconsulting/geodiff) lib is supposed to be and install dependencies:
147-
```
147+
```
148148
rm -r mergin/deps
149149
mkdir mergin/deps
150-
pip install python-dateutil pytz
150+
pip install python-dateutil pytz
151151
pip install pygeodiff --target=mergin/deps
152152
```
153153

154154
For using mergin client with its dependencies packaged locally run:
155155
```
156-
pip install wheel
156+
pip install wheel
157157
python3 setup.py sdist bdist_wheel
158158
mkdir -p mergin/deps
159159
pip wheel -r mergin_client.egg-info/requires.txt -w mergin/deps
@@ -173,4 +173,4 @@ For running test do:
173173
export TEST_API_PASSWORD2=<pwd2>
174174
pip install pytest pytest-cov coveralls
175175
pytest --cov-report html --cov=mergin mergin/test/
176-
```
176+
```

mergin/cli.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22

33
"""
4-
Command line interface for the Mergin client module. When installed with pip, this script
4+
Command line interface for the Mergin Maps client module. When installed with pip, this script
55
is installed as 'mergin' command line tool (defined in setup.py). If you have installed the module
66
but the tool is not available, you may need to fix your PATH (e.g. add ~/.local/bin where
77
pip puts these tools).
@@ -108,7 +108,7 @@ def get_token(url, username, password):
108108

109109

110110
def get_client(url=None, auth_token=None, username=None, password=None):
111-
"""Return Mergin client."""
111+
"""Return Mergin Maps client."""
112112
if auth_token is not None:
113113
try:
114114
mc = MerginClient(url, auth_token=auth_token)
@@ -148,15 +148,15 @@ def _print_unhandled_exception():
148148
"--url",
149149
envvar="MERGIN_URL",
150150
default=MerginClient.default_url(),
151-
help=f"Mergin server URL. Default is: {MerginClient.default_url()}",
151+
help=f"Mergin Maps server URL. Default is: {MerginClient.default_url()}",
152152
)
153-
@click.option("--auth-token", envvar="MERGIN_AUTH", help="Mergin authentication token string")
153+
@click.option("--auth-token", envvar="MERGIN_AUTH", help="Mergin Maps authentication token string")
154154
@click.option("--username", envvar="MERGIN_USERNAME")
155155
@click.option("--password", cls=OptionPasswordIfUser, prompt=True, hide_input=True, envvar="MERGIN_PASSWORD")
156156
@click.pass_context
157157
def cli(ctx, url, auth_token, username, password):
158158
"""
159-
Command line interface for the Mergin client module.
159+
Command line interface for the Mergin Maps client module.
160160
For user authentication on server there are two options:
161161
162162
1. authorization token environment variable (MERGIN_AUTH) is defined, or
@@ -188,7 +188,7 @@ def login(ctx):
188188
"The directory will get assigned to the project.")
189189
@click.pass_context
190190
def create(ctx, project, public, from_dir):
191-
"""Create a new project on Mergin server. `project` needs to be a combination of namespace/project."""
191+
"""Create a new project on Mergin Maps server. `project` needs to be a combination of namespace/project."""
192192
mc = ctx.obj["client"]
193193
if mc is None:
194194
return
@@ -393,7 +393,7 @@ def status(ctx):
393393
@cli.command()
394394
@click.pass_context
395395
def push(ctx):
396-
"""Upload local changes into Mergin repository."""
396+
"""Upload local changes into Mergin Maps repository."""
397397
mc = ctx.obj["client"]
398398
if mc is None:
399399
return
@@ -425,7 +425,7 @@ def push(ctx):
425425
@cli.command()
426426
@click.pass_context
427427
def pull(ctx):
428-
"""Fetch changes from Mergin repository."""
428+
"""Fetch changes from Mergin Maps repository."""
429429
mc = ctx.obj["client"]
430430
if mc is None:
431431
return

mergin/client.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ def decode_token_data(token):
5353

5454
class MerginClient:
5555
"""
56-
Client for Mergin service.
56+
Client for Mergin Maps service.
5757
58-
:param url: String, Mergin service URL.
59-
:param auth_token: String, Mergin authorization token.
60-
:param login: String, login for Mergin service.
61-
:param password: String, password for Mergin service.
58+
:param url: String, Mergin Maps service URL.
59+
:param auth_token: String, Mergin Maps authorization token.
60+
:param login: String, login for Mergin Maps service.
61+
:param password: String, password for Mergin Maps service.
6262
:param plugin_version: String, info about plugin and QGIS version.
63-
:param proxy_config: Dictionary, proxy settings to use when connecting to Mergin service. At least url and port
63+
:param proxy_config: Dictionary, proxy settings to use when connecting to Mergin Maps service. At least url and port
6464
of the server should be provided. Expected keys: "url", "port", "user", "password".
6565
Currently, only HTTP proxies are supported.
6666
"""
@@ -128,7 +128,7 @@ def __init__(self, url=None, auth_token=None, login=None, password=None, plugin_
128128
self.login(login, password)
129129

130130
def setup_logging(self):
131-
"""Setup Mergin client logging."""
131+
"""Setup Mergin Maps client logging."""
132132
client_log_file = os.environ.get('MERGIN_CLIENT_LOG', None)
133133
self.log = logging.getLogger('mergin.client')
134134
self.log.setLevel(logging.DEBUG) # log everything (it would otherwise log just warnings+errors)
@@ -138,14 +138,14 @@ def setup_logging(self):
138138
log_handler.setFormatter(logging.Formatter('%(asctime)s %(message)s'))
139139
self.log.addHandler(log_handler)
140140
else:
141-
# no Mergin log path in the environment - create a null handler that does nothing
141+
# no Mergin Maps log path in the environment - create a null handler that does nothing
142142
null_logger = logging.NullHandler()
143143
self.log.addHandler(null_logger)
144144

145145
@staticmethod
146146
def default_url():
147-
""" Returns URL of the public instance of Mergin """
148-
return "https://public.cloudmergin.com"
147+
""" Returns URL of the public instance of Mergin Maps"""
148+
return "https://app.merginmaps.com"
149149

150150
def user_agent_info(self):
151151
""" Returns string as it is sent as User-Agent http header to the server """
@@ -328,7 +328,7 @@ def user_service(self):
328328

329329
def create_project(self, project_name, is_public=False, namespace=None):
330330
"""
331-
Create new project repository in user namespace on Mergin server.
331+
Create new project repository in user namespace on Mergin Maps server.
332332
Optionally initialized from given local directory.
333333
334334
:param project_name: Project name
@@ -360,7 +360,7 @@ def create_project_and_push(self, project_name, directory, is_public=False, name
360360
Convenience method to create project and push the initial version right after that.
361361
"""
362362
if os.path.exists(os.path.join(directory, '.mergin')):
363-
raise ClientError('Directory is already assigned to a Mergin project (contains .mergin sub-dir)')
363+
raise ClientError('Directory is already assigned to a Mergin Maps project (contains .mergin sub-dir)')
364364

365365
if namespace is None:
366366
namespace = self.username()
@@ -375,7 +375,7 @@ def create_project_and_push(self, project_name, directory, is_public=False, name
375375
def paginated_projects_list(self, page=1, per_page=50, tags=None, user=None, flag=None, name=None,
376376
namespace=None, order_params=None):
377377
"""
378-
Find all available mergin projects.
378+
Find all available Mergin Maps projects.
379379
380380
:param tags: Filter projects by tags ('valid_qgis', 'mappin_use', input_use')
381381
:type tags: List
@@ -426,7 +426,7 @@ def paginated_projects_list(self, page=1, per_page=50, tags=None, user=None, fla
426426

427427
def projects_list(self, tags=None, user=None, flag=None, q=None):
428428
"""
429-
Find all available Mergin projects. It will always retrieve max 100 projects.
429+
Find all available Mergin Maps projects. It will always retrieve max 100 projects.
430430
Consider using the paginated_projects_list instead.
431431
432432
:param tags: Filter projects by tags ('valid_qgis', 'mappin_use', input_use')
@@ -732,7 +732,7 @@ def get_projects_by_names(self, projects):
732732
""" Returns JSON with projects' info for list of required projects.
733733
The schema of the returned information is the same as the response from projects_list().
734734
735-
This is useful when we have a couple of Mergin projects available locally and we want to
735+
This is useful when we have a couple of Mergin Maps projects available locally and we want to
736736
find out their status at once (e.g. whether there is a new version on the server).
737737
738738
:param projects: list of projects in the form 'namespace/project_name'

mergin/client_pull.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def _cleanup_failed_download(directory, mergin_project=None):
9797
temporary files in it. We want to remove it because a new download would fail because
9898
the directory already exists.
9999
"""
100-
# First try to get the Mergin project logger and remove its handlers to allow the log file deletion
100+
# First try to get the Mergin Maps project logger and remove its handlers to allow the log file deletion
101101
if mergin_project is not None:
102102
mergin_project.remove_logging_handler()
103103

@@ -684,7 +684,7 @@ def download_diffs_async(mc, project_directory, file_path, versions):
684684
Args:
685685
mc (MerginClient): MerginClient instance.
686686
project_directory (str): local project directory.
687-
file_path (str): file path relative to Mergin project root.
687+
file_path (str): file path relative to Mergin Maps project root.
688688
versions (list): list of versions to download diffs for, e.g. ['v1', 'v2'].
689689
690690
Returns:

mergin/merginproject.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737

3838
class MerginProject:
39-
""" Base class for Mergin local projects.
39+
""" Base class for Mergin Maps local projects.
4040
4141
Linked to existing local directory, with project metadata (mergin.json) and backups located in .mergin directory.
4242
"""

mergin/test/test_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def mc2():
4444

4545

4646
def create_client(user, pwd):
47-
assert SERVER_URL and SERVER_URL.rstrip('/') != 'https://public.cloudmergin.com' and user and pwd
47+
assert SERVER_URL and SERVER_URL.rstrip('/') != 'https://app.merginmaps.com' and user and pwd
4848
return MerginClient(SERVER_URL, login=user, password=pwd)
4949

5050

@@ -1681,7 +1681,7 @@ def test_report(mc):
16811681
warnings = create_report(mc, directory, "v1", "v5", report_file)
16821682
assert warnings
16831683

1684-
# rm local mergin project and try again
1684+
# rm local Mergin Maps project and try again
16851685
shutil.rmtree(directory)
16861686
with pytest.raises(InvalidProject):
16871687
create_report(mc, directory, since, to, report_file)

mergin/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def conflicted_copy_file_name(path, user, version):
190190
:type path: str
191191
:param user: name of the user
192192
:type user: str
193-
:param version: version of the mergin project
193+
:param version: version of the Mergin Maps project
194194
:type version: str
195195
:returns: new file name
196196
:rtype: str
@@ -202,7 +202,7 @@ def conflicted_copy_file_name(path, user, version):
202202
ext = ''.join(Path(tail).suffixes)
203203
file_name = tail.replace(ext, '')
204204
# in case of QGIS project files we have to add "~" (tilde) to suffix
205-
# to avoid having several QGIS project files inside Mergin project.
205+
# to avoid having several QGIS project files inside Mergin Maps project.
206206
# See https://github.com/lutraconsulting/qgis-mergin-plugin/issues/382
207207
# for more details
208208
if ext.lower() in (".qgz", ".qgs"):
@@ -220,7 +220,7 @@ def edit_conflict_file_name(path, user, version):
220220
:type path: str
221221
:param user: name of the user
222222
:type user: str
223-
:param version: version of the mergin project
223+
:param version: version of the Mergin Maps project
224224
:type version: str
225225
:returns: new file name
226226
:rtype: str

0 commit comments

Comments
 (0)