Changeset 12242 in josm


Ignore:
Timestamp:
2017-05-23T21:25:30+02:00 (3 years ago)
Author:
stoecker
Message:

see #14655 - handle api keys in URL compare

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/scripts/SyncEditorLayerIndex.groovy

    r12227 r12242  
    187187
    188188        for (def e : eliEntries) {
    189             def url = getUrl(e)
     189            def url = getUrlStripped(e)
    190190            if (url.contains("{z}")) {
    191191                myprintln "+++ ELI-URL uses {z} instead of {zoom}: "+url
     
    305305
    306306        for (def e : josmEntries) {
    307             def url = getUrl(e)
     307            def url = getUrlStripped(e)
    308308            if (url.contains("{z}")) {
    309309                myprintln "+++ JOSM-URL uses {z} instead of {zoom}: "+url
     
    316316            }
    317317            for (def m : e.getMirrors()) {
    318                 url = getUrl(m)
     318                url = getUrlStripped(m)
    319319                m.origName = m.getOriginalName().replaceAll(" mirror server( \\d+)?","")
    320320                if (josmUrls.containsKey(url)) {
     
    367367            def jname = getName(j).replace("'","\u2019")
    368368            if (!ename.equals(jname)) {
    369                 myprintln "* Name differs ('${getName(e)}' != '${getName(j)}'): $url"
     369                myprintln "* Name differs ('${getName(e)}' != '${getName(j)}'): ${getUrl(j)}"
    370370            }
    371371        }
     
    379379            def jname = getId(j)
    380380            if (!ename.equals(jname)) {
    381                 myprintln "+ SKIP * Id differs ('${getId(e)}' != '${getId(j)}'): $url"
     381                myprintln "+ SKIP * Id differs ('${getId(e)}' != '${getId(j)}'): ${getUrl(j)}"
    382382            }
    383383        }
     
    389389            def j = josmUrls.get(url)
    390390            if (!getType(e).equals(getType(j))) {
    391                 myprintln "* Type differs (${getType(e)} != ${getType(j)}): ${getName(j)} - $url"
     391                myprintln "* Type differs (${getType(e)} != ${getType(j)}): ${getName(j)} - ${getUrl(j)}"
    392392            }
    393393        }
     
    704704        return e.get("properties").getString("url")
    705705    }
     706    static String getUrlStripped(Object e) {
     707        return getUrl(e).replaceAll("\\?(apikey|access_token)=.*","")
     708    }
    706709    static String getDate(Object e) {
    707710        if (e instanceof ImageryInfo) return e.date ? e.date : ""
Note: See TracChangeset for help on using the changeset viewer.