chiark / gitweb /
Make new "tree-info.txt" file not in revision control for locally approved clients...
[ypp-sc-tools.db-test.git] / yarrg / dictionary-manager
index 5501765992e14e21953238e4fce7724a4801bc32..2231266edc8f0e0ef441067a7e5ffd276ba52ba6 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/wish
 
 #!/usr/bin/wish
 
-# helper program for OCR in PCTB upload client
+# helper program for OCR in yarrg upload client
 
 # This is part of ypp-sc-tools, a set of third-party tools for assisting
 # players of Yohoho Puzzle Pirates.
 
 # This is part of ypp-sc-tools, a set of third-party tools for assisting
 # players of Yohoho Puzzle Pirates.
@@ -25,9 +25,9 @@
 # sponsored by Three Rings.
 
 
 # sponsored by Three Rings.
 
 
-# ./dictionary-manager --approve-updates ijackson@login.chiark.greenend.org.uk /home/ijackson/things/ypp-sc-tools.pctb-dict/pctb /home/ftp/users/ijackson/pctb
+# ./dictionary-manager --approve-updates ijackson@login.chiark.greenend.org.uk /home/ijackson/things/ypp-sc-tools.pctb-dict/yarrg /home/ftp/users/ijackson/yarrg
 
 
-# ./dictionary-manager --approve-updates ijackson@login.chiark.greenend.org.uk /home/ijackson/things/ypp-sc-tools.pctb-dict-test/pctb /home/ftp/users/ijackson/pctb/test
+# ./dictionary-manager --approve-updates ijackson@login.chiark.greenend.org.uk /home/ijackson/things/ypp-sc-tools.pctb-dict-test/yarrg /home/ftp/users/ijackson/yarrg/test
 
 # ./dictionary-manager --approve-updates '' . .
 
 
 # ./dictionary-manager --approve-updates '' . .
 
@@ -450,14 +450,14 @@ proc required/pixmap {} {
     set col 0; foreach {colname coldesc rows} $alloptions {
        debug "INIT $col $colname \"$coldesc\""
        label .pe.grid.t$col -text $colname
     set col 0; foreach {colname coldesc rows} $alloptions {
        debug "INIT $col $colname \"$coldesc\""
        label .pe.grid.t$col -text $colname
-       listbox .pe.grid.l$col
+       listbox .pe.grid.l$col -height -1
        foreach {rowname rowdesc} $rows {
            debug "INIT $col $colname \"$coldesc\" $rowname \"$rowdesc\""
            .pe.grid.l$col insert end $rowdesc
        }
        bind .pe.grid.l$col <<ListboxSelect>> [list pixmap_select $col]
        grid .pe.grid.t$col -column $col -row 0
        foreach {rowname rowdesc} $rows {
            debug "INIT $col $colname \"$coldesc\" $rowname \"$rowdesc\""
            .pe.grid.l$col insert end $rowdesc
        }
        bind .pe.grid.l$col <<ListboxSelect>> [list pixmap_select $col]
        grid .pe.grid.t$col -column $col -row 0
-       grid .pe.grid.l$col -column $col -row 1
+       grid .pe.grid.l$col -column $col -row 1 -sticky ns
        incr col
     }
     pixmap_maybe_ok
        incr col
     }
     pixmap_maybe_ok
@@ -509,6 +509,12 @@ proc upload_init {} {
     if {$privacy_setting} {
        package require http
        ::http::config -urlencoding utf-8
     if {$privacy_setting} {
        package require http
        ::http::config -urlencoding utf-8
+       set ua [::http::config -useragent]
+       debug "USERAGENT OLD \"$ua\""
+       set ua [exec ./database-info-fetch useragentstringmap $ua \
+                   dictionary-manager 2>@ stderr]
+       ::http::config -useragent $ua
+       debug "USERAGENT NEW \"$ua\""
     }
 }
 
     }
 }
 
@@ -516,8 +522,8 @@ proc upload_status {} {
     # returns 0, 1, 2 for none, anon, with pirate name
     global env
 
     # returns 0, 1, 2 for none, anon, with pirate name
     global env
 
-    if {![info exists env(YPPSC_PCTB_DICT_SUBMIT)]} { debug a; return 0 }
-    if {![string compare 0 $env(YPPSC_PCTB_DICT_SUBMIT)]} { debug b; return 0 }
+    if {![info exists env(YPPSC_YARRG_DICT_SUBMIT)]} { debug a; return 0 }
+    if {![string compare 0 $env(YPPSC_YARRG_DICT_SUBMIT)]} { debug b; return 0 }
 
     if {![info exists env(YPPSC_PIRATE)]} { return 1 }
     if {![info exists env(YPPSC_OCEAN)]} { return 1 }
 
     if {![info exists env(YPPSC_PIRATE)]} { return 1 }
     if {![info exists env(YPPSC_OCEAN)]} { return 1 }
@@ -550,7 +556,7 @@ proc maybe_upload_entry {im def} {
     }
     lappend pl entry [format_database_entry/$reqkind $im $def]
 
     }
     lappend pl entry [format_database_entry/$reqkind $im $def]
 
-    set url $env(YPPSC_PCTB_DICT_SUBMIT)
+    set url $env(YPPSC_YARRG_DICT_SUBMIT)
     append url dictionary-update-receiver
 
     set query [eval ::http::formatQuery $pl]
     append url dictionary-update-receiver
 
     set query [eval ::http::formatQuery $pl]