Skip to content

Commit

Permalink
fixing style #22
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed Jan 30, 2024
1 parent 27ac073 commit 675366b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
3 changes: 2 additions & 1 deletion tools/build_config/updateMessageIDs.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ def processRules(poFilePath, replaceRules, options, markObsolete=False, filterID
for replaceRule in replaceRules:
if entry.msgstr.startswith("There is unsaved"):
print("%s newline %s origin string %s" % (entry.msgstr, "\n" in entry.msgstr, entry.msgstr ==
"There is unsaved changes in current edited traffic light.\nDo you want to save it before changing mode?"))
"There is unsaved changes in current edited traffic light.\n"
"Do you want to save it before changing mode?"))
if options.strict and replaceRule[0] == entry.msgstr:
replaced = replaceRule[1]
elif replaceRule[3] and not replaceRule[4] and entry.msgstr.startswith(replaceRule[0]): # starts with ...
Expand Down
21 changes: 11 additions & 10 deletions tools/tileGet.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def retrieveOpenStreetMapTiles(options, west, south, east, north, decals, net):
if options.user_agent:
opener = urllib.build_opener()
opener.addheaders = [('User-agent', options.user_agent)]
urllib.install_opener(opener)
urllib.install_opener(opener)

for x in range(sx, ex + 1):
for y in range(sy, ey + 1):
Expand All @@ -112,6 +112,7 @@ def retrieveOpenStreetMapTiles(options, west, south, east, north, decals, net):
(os.path.basename(filename), center[0], center[1],
2 * (center[0] - upperLeft[0]), 2 * (upperLeft[1] - center[1]), options.layer), file=decals)


def retrieveMapServerTiles(options, west, south, east, north, decals, net):
zoom = 20
numTiles = options.tiles + 1
Expand Down Expand Up @@ -156,28 +157,28 @@ def get_options(args=None):
optParser.add_option("-p", "--prefix", category="output", default="tile", help="for output file")
optParser.add_option("-b", "--bbox", category="input",
help="bounding box to retrieve in geo coordinates west,south,east,north")
optParser.add_option("-t", "--tiles", category="processing", type=int, default=1,
optParser.add_option("-t", "--tiles", type=int, default=1,
help="maximum number of tiles the output gets split into")
optParser.add_option("-d", "--output-dir", category="output", default=".",
help="optional output directory (must already exist)")
optParser.add_option("-s", "--decals-file", category="output",
default="settings.xml", help="name of decals settings file")
optParser.add_option("-l", "--layer", category="processing", type=int, default=0,
optParser.add_option("-l", "--layer", type=int, default=0,
help="(int) layer at which the image will appear, default 0")
optParser.add_option("-x", "--polygon", category="input", help="calculate bounding box from polygon data in file")
optParser.add_option("-n", "--net", category="input", help="get bounding box from net file")
optParser.add_option("-k", "--key", category="processing", help="API key to use")
optParser.add_option("-m", "--maptype", category="processing", default="satellite",
optParser.add_option("-k", "--key", help="API key to use")
optParser.add_option("-m", "--maptype", default="satellite",
help="map type (roadmap, satellite, hybrid, terrain)")
optParser.add_option("-u", "--url", category="processing", default="arcgis",
optParser.add_option("-u", "--url", default="arcgis",
help="Download from the given tile server")
optParser.add_option("-a", "--user-agent", category="processing",
optParser.add_option("-a", "--user-agent",
help="user agent string to be used when downloading tiles")
optParser.add_option("-f", "--min-file-size", category="processing", type=int, default=3000,
optParser.add_option("-f", "--min-file-size", type=int, default=3000,
help="maximum number of tiles the output gets split into")
optParser.add_option("-j", "--parallel-jobs", category="processing", type=int, default=8,
optParser.add_option("-j", "--parallel-jobs", type=int, default=8,
help="Number of parallel jobs to run when downloading tiles. 0 means no parallelism.")

URL_SHORTCUTS = {
"arcgis": "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile",
"mapquest": "https://www.mapquestapi.com/staticmap/v5/map",
Expand Down

0 comments on commit 675366b

Please sign in to comment.