Skip to content

Commit

Permalink
fix-args
Browse files Browse the repository at this point in the history
  • Loading branch information
Stéphane Brunner committed Aug 7, 2013
1 parent bf42d2d commit 07f1e81
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 20 deletions.
18 changes: 9 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -452,31 +452,31 @@ Generate all the tiles::

Generate a specific layer::

./buildout/bin/generate_tiles --layer=<a_layer>
./buildout/bin/generate_tiles --layer <a_layer>

Generate a specific zoom::

./buildout/bin/generate_tiles --zoom=5
./buildout/bin/generate_tiles --zoom 5

Generate a specific zoom range::

./buildout/bin/generate_tiles --zoom=2-8
./buildout/bin/generate_tiles --zoom 2-8

Generate a specific some zoom levels::

./buildout/bin/generate_tiles --zoom=2,4,7
./buildout/bin/generate_tiles --zoom 2,4,7

Generate tiles on a bbox::

./buildout/bin/generate_tiles --bbox=<minx,miny,maxx,maxy>
./buildout/bin/generate_tiles --bbox <MINX> <MINY> <MAXX> <MAXY>

Generate a tiles near a tile coordinate (useful for test)::

./buildout/bin/generate_tiles --near=z/x/y
./buildout/bin/generate_tiles --near <X> <Y>

Generate a tiles in a deferent cache than the default one::

./buildout/bin/generate_tiles --cache=<a_cache>
./buildout/bin/generate_tiles --cache <a_cache>

And don't forget to generate the WMTS Capabilities::

Expand All @@ -494,7 +494,7 @@ If we set a file path in config file:
error_file: <path>
The tiles that in error will be appen to the file, ant the tiles can be regenerated with
``./buildout/bin/generate_tiles --layer <layer> --tiles-file <path>``.
``./buildout/bin/generate_tiles --layer <layer> --tiles <path>``.


Explain cost
Expand Down Expand Up @@ -675,7 +675,7 @@ Release 0.6

7. Add coveralls support (https://coveralls.io/r/sbrunner/tilecloud-chain).

8. Add an config option ``generation:error_file`` and a command option ``--tiles-file``
8. Add an config option ``generation:error_file`` and a command option ``--tiles``
to store and regenerate errored tiles.


Expand Down
11 changes: 6 additions & 5 deletions tilecloud_chain/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def main():
processes.append(
run_remote_process(
'./buildout/bin/generate_tiles ' +
' '.join(arguments), host, project_dir, gene
' '.join([str(a) for a in arguments]), host, project_dir, gene
)
)

Expand Down Expand Up @@ -311,7 +311,7 @@ def main():
project_dir = gene.config['generation']['code_folder']
run_remote(
'./buildout/bin/generate_tiles ' +
' '.join(arguments), host, project_dir, gene
' '.join([str(a) for a in arguments]), host, project_dir, gene
)

if options.tiles_gen: # pragma: no cover
Expand All @@ -327,7 +327,7 @@ def main():
processes.append(
run_remote_process(
'./buildout/bin/generate_tiles ' +
' '.join(arguments), host, project_dir, gene)
' '.join([str(a) for a in arguments]), host, project_dir, gene)
)

if options.shutdown:
Expand Down Expand Up @@ -378,9 +378,10 @@ def _get_arguments(options):
if options.layer:
arguments.extend(["--layer", options.layer])
if options.near:
arguments.extend(["--near", str(options.near)])
arguments.append("--near")
arguments.extend(options.near)
elif options.bbox:
arguments.extend(["--bbox"])
arguments.append("--bbox")
arguments.extend(options.bbox)
if options.zoom:
arguments.extend(["--zoom", ','.join([str(z) for z in options.zoom])])
Expand Down
4 changes: 2 additions & 2 deletions tilecloud_chain/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def assert_cmd_equals(self, cmd, main_func, empty_err=False, **kargs):
self.assert_result_equals(result=out, **kargs)

def assert_cmd_exit_equals(self, cmd, main_func, expected):
sys.argv = cmd.split(' ')
sys.argv = re.sub(' +', ' ', cmd).split(' ')
try:
main_func()
assert("exit() not called.")
Expand All @@ -66,7 +66,7 @@ def assert_main_equals(self, cmd, main_func, expected, **kargs):
for expect in expected:
if os.path.exists(expect[0]):
os.remove(expect[0])
sys.argv = cmd.replace(' ', ' ').split(' ')
sys.argv = re.sub(' +', ' ', cmd).split(' ')
try:
main_func()
except SystemExit:
Expand Down
6 changes: 3 additions & 3 deletions tilecloud_chain/tests/test_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def test_layer_bbox(self, l):

self.assert_tiles_generated(
cmd='./buildout/bin/generate_tiles %s -c tilegeneration/test-nosns.yaml -l polygon -z 0'
' -b 550000,170000,560000,180000' % d,
' -b 550000 170000 560000 180000' % d,
main_func=generate.main,
directory="/tmp/tiles/",
tiles_pattern='1.0.0/polygon/default/2012/swissgrid_5/0/%i/%i.png',
Expand All @@ -354,7 +354,7 @@ def test_layer_bbox(self, l):

self.assert_tiles_generated(
cmd='./buildout/bin/generate_tiles %s -c tilegeneration/test-nosns.yaml -l polygon -z 0'
' -b 550000.0,170000.0,560000.0,180000.0' % d,
' -b 550000.0 170000.0 560000.0 180000.0' % d,
main_func=generate.main,
directory="/tmp/tiles/",
tiles_pattern='1.0.0/polygon/default/2012/swissgrid_5/0/%i/%i.png',
Expand Down Expand Up @@ -586,7 +586,7 @@ def test_error_file(self):

self.assert_tiles_generated(
cmd='./buildout/bin/generate_tiles -d -c tilegeneration/test-nosns.yaml -l point_hash'
' --tiles-file error.list',
' --tiles error.list',
main_func=generate.main,
directory="/tmp/tiles/",
tiles_pattern='1.0.0/point_hash/default/2012/swissgrid_5/%i/%i/%i.png',
Expand Down
2 changes: 1 addition & 1 deletion tilecloud_chain/tests/test_multihost.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def test_near(self):
class Opt:
zoom = '3'
test = 196
near = [600000.0,200000.0]
near = [600000.0, 200000.0]
verbose = False
debug = False
time = None
Expand Down

0 comments on commit 07f1e81

Please sign in to comment.