Skip to content

Commit c2b733c

Browse files
Alessio Fabianijendrusk
andauthored
Refactor: Feature/add service settings from @jendrusk (#31)
* Services before refactor * Added services settings * Disabled create_service function * Refactor: Feature/add service settings from @jendrusk Co-authored-by: Andrzej <jendrusk@gmail.com>
1 parent 857c48a commit c2b733c

File tree

19 files changed

+831
-165
lines changed

19 files changed

+831
-165
lines changed

docs/conf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
# All configuration values have a default; values that are commented out
1212
# serve to show the default.
1313

14-
import sys, os
14+
import sys
15+
import os
1516

1617
# If extensions (or modules to document with autodoc) are in another directory,
1718
# add these directories to sys.path here. If the directory is relative to the
@@ -178,8 +179,8 @@
178179
# Grouping the document tree into LaTeX files. List of tuples
179180
# (source start file, target name, title, author, documentclass [howto/manual]).
180181
latex_documents = [
181-
('index', 'gsconfig.tex', u'gsconfig Documentation',
182-
u'David Winslow', 'manual'),
182+
('index', 'gsconfig.tex', u'gsconfig Documentation',
183+
u'David Winslow', 'manual'),
183184
]
184185

185186
# The name of an image file (relative to this directory) to place at the top of

examples/copy_layergroup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,22 @@
1111
from geoserver.catalog import Catalog
1212

1313
demo = Catalog("http://localhost:8080/geoserver/rest",
14-
"admin", "geoserver")
14+
"admin", "geoserver")
1515

1616
live = Catalog("http://localhost:8080/geoserver2/rest",
17-
"admin", "geoserver")
17+
"admin", "geoserver")
1818

1919
groupname = "Wayne"
2020
prefix = "wayne_"
2121

22+
2223
def resolve(layer, style):
2324
if style is not None and style:
2425
return (layer, style)
2526
else:
2627
return (layer, demo.get_layer(layer).default_style.name)
2728

29+
2830
g = demo.get_layergroup("groupname")
2931
resolved = [resolve(l, s) for (l, s) in zip(g.layers, g.styles)]
3032

examples/layersusing.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616

1717
cat = Catalog("http://localhost:8080/geoserver/rest", "admin", "geoserver")
1818

19+
1920
def has_the_style(l):
2021
return (l.default_style.name == style_to_check or
21-
any(s.name == style_to_check for s in l.styles))
22+
any(s.name == style_to_check for s in l.styles))
23+
2224

2325
print([l.name for l in cat.get_layers() if has_the_style(l)])

examples/postgis_import.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@
2525

2626
cat.save(ds)
2727
ds = cat.get_store(name)
28-
components = dict((ext, "myfile." + ext) for ext in ["shp", "prj", "shx", "dbf"])
28+
components = dict((ext, f"myfile.{ext}") for ext in ["shp", "prj", "shx", "dbf"])
2929
cat.add_data_to_store(ds, "mylayer", components)

examples/postgislayers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
cat = Catalog("http://localhost:8080/geoserver/rest", "admin", "geoserver")
1616

1717
pg_stores = [s.name for s in cat.get_stores()
18-
if s.resource_type == 'dataStore' and s.connection_parameters.get("dbtype") == "postgis"]
18+
if s.resource_type == 'dataStore' and s.connection_parameters.get("dbtype") == "postgis"]
1919

2020
print(cat.get_resources(stores=pg_stores))

setup.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
setup(
1212
name="geoserver-restconfig",
13-
version="2.0.4.10",
13+
version="2.0.5",
1414
description="GeoServer REST Configuration",
1515
long_description=readme_text,
1616
keywords="GeoServer REST Configuration",
@@ -26,7 +26,7 @@
2626
],
2727
package_dir={'': 'src'},
2828
packages=find_packages('src'),
29-
test_suite="test.catalogtests",
29+
# test_suite="test.servicestests",
3030
classifiers=[
3131
'Development Status :: 5 - Production/Stable',
3232
'Intended Audience :: Developers',
@@ -35,10 +35,6 @@
3535
'Operating System :: OS Independent',
3636
'Programming Language :: Python',
3737
'Topic :: Scientific/Engineering :: GIS',
38-
'Programming Language :: Python :: 3',
39-
'Programming Language :: Python :: 3.3',
40-
'Programming Language :: Python :: 3.4',
41-
'Programming Language :: Python :: 3.5',
42-
'Programming Language :: Python :: 3.6',
38+
'Programming Language :: Python :: 3.8',
4339
]
4440
)

0 commit comments

Comments
 (0)