Changeset 13593 in josm for trunk/scripts
- Timestamp:
- 2018-04-01T23:36:18+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/scripts/SyncEditorLayerIndex.groovy
r13592 r13593 373 373 } 374 374 375 List inOneButNotTheOther(Map m1, Map m2, String code, String https) { 376 def l = [] 377 def k = new LinkedList<String>(m1.keySet()) 378 for (def url : k) { 379 if (!m2.containsKey(url)) { 380 String urlhttps = url.replace("http:","https:") 381 if(!https || !m2.containsKey(urlhttps)) 375 void checkInOneButNotTheOther() { 376 def le = new LinkedList<String>(eliUrls.keySet()) 377 def lj = new LinkedList<String>(josmUrls.keySet()) 378 379 def ke = new LinkedList<String>(le) 380 for (def url : ke) { 381 if(lj.contains(url)) { 382 le.remove(url) 383 lj.remove(url) 384 } 385 } 386 387 if(le && lj) { 388 ke = new LinkedList<String>(le) 389 for (def urle : ke) { 390 def e = eliUrls.get(urle) 391 def ide = getId(e) 392 String urlhttps = urle.replace("http:","https:") 393 if(lj.contains(urlhttps)) 382 394 { 383 def name = getName(m1.get(url)) 384 l += code+" "+getDescription(m1.get(url)) 385 } 386 else 387 { 388 l += https+" Missing https: "+getDescription(m1.get(url)) 389 m1.put(urlhttps, m1.get(url)) 390 m1.remove(url) 391 } 392 } 393 } 394 l.sort() 395 } 396 397 void checkInOneButNotTheOther() { 398 def l1 = inOneButNotTheOther(eliUrls, josmUrls, "-", "+") 399 myprintln "*** URLs found in ELI but not in JOSM (${l1.size()}): ***" 400 if (!l1.isEmpty()) { 401 for (def l : l1) { 402 myprintln l 403 } 404 } 405 406 def l2 = inOneButNotTheOther(josmUrls, eliUrls, "+", "") 407 myprintln "*** URLs found in JOSM but not in ELI (${l2.size()}): ***" 408 if (!l2.isEmpty()) { 409 for (def l : l2) { 410 myprintln l 395 myprintln l += "+ Missing https: ${getDescription(e)}" 396 eliUrls.put(urlhttps, eliUrls.get(urle)) 397 eliUrls.remove(urle) 398 le.remove(urle) 399 lj.remove(urlj) 400 } else if(ide) { 401 def kj = new LinkedList<String>(lj) 402 for (def urlj : kj) { 403 def j = josmUrls.get(urlj) 404 def idj = getId(j) 405 406 if (ide.equals(idj) && getType(j) == getType(e)) { 407 myprintln "* URL for id ${idj} differs ($urle): ${getDescription(j)}" 408 le.remove(urle) 409 lj.remove(urlj) 410 /* replace key for this entry with JOSM URL */ 411 eliUrls.remove(e) 412 eliUrls.put(urlj,e) 413 break; 414 } 415 } 416 } 417 } 418 } 419 420 myprintln "*** URLs found in ELI but not in JOSM (${le.size()}): ***" 421 le.sort() 422 if (!le.isEmpty()) { 423 for (def l : le) { 424 myprintln "- " + getDescription(eliUrls.get(l)) 425 } 426 } 427 myprintln "*** URLs found in JOSM but not in ELI (${lj.size()}): ***" 428 lj.sort() 429 if (!lj.isEmpty()) { 430 for (def l : lj) { 431 myprintln "+ " + getDescription(josmUrls.get(l)) 411 432 } 412 433 }
Note:
See TracChangeset
for help on using the changeset viewer.