chiark
/
gitweb
/
~yarrgweb
/
ypp-sc-tools.db-live.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
actually do version protocol; use tempfile to stop exec truncating our binary ppm
[ypp-sc-tools.db-live.git]
/
pctb
/
dictionary-manager
diff --git
a/pctb/dictionary-manager
b/pctb/dictionary-manager
index 5079defd1d00abfbc9995a6f439f21efe95758ba..d9de00cb99da21296c1142952e15a2eb4961e23c 100755
(executable)
--- a/
pctb/dictionary-manager
+++ b/
pctb/dictionary-manager
@@
-25,9
+25,10
@@
# 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-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/pctb /home/ftp/users/ijackson/pctb
# ./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-test/pctb /home/ftp/users/ijackson/pctb/test
+
# ./dictionary-manager --approve-updates '' . .
# ./dictionary-manager --approve-updates '' . .
@@
-41,6
+42,9
@@
# if it wrote a byte to fd 4, it can take another question
# if it wrote a byte to fd 4, it can take another question
+set aadepth 2
+
+
#---------- library routines ----------
proc manyset {list args} {
#---------- library routines ----------
proc manyset {list args} {
@@
-284,7
+288,7
@@
proc required/char {} {
label .selctx.title -text \
{Select match context for altering dictionary:}
pack .selctx.title -side left
label .selctx.title -text \
{Select match context for altering dictionary:}
pack .selctx.title -side left
- set new_context
[lindex $unk_contexts 0]
+ set new_context
{}
set ci 0; foreach ctx [lsort [array names all_contexts]] {
set all_contexts($ctx) $ci
set ci 0; foreach ctx [lsort [array names all_contexts]] {
set all_contexts($ctx) $ci
@@
-513,7
+517,7
@@
proc upload_status {} {
}
proc maybe_upload_entry {im def} {
}
proc maybe_upload_entry {im def} {
- global reqkind privacy_setting env dbname quiet
+ global reqkind privacy_setting env dbname quiet
aadepth
debug "DB-UPDATE PRIVACY $privacy_setting"
if {!$privacy_setting} return
debug "DB-UPDATE PRIVACY $privacy_setting"
if {!$privacy_setting} return
@@
-522,6
+526,8
@@
proc maybe_upload_entry {im def} {
set pl {}
lappend pl dict $dbname
set pl {}
lappend pl dict $dbname
+ lappend pl version 3
+ lappend pl depth $aadepth
if {$privacy_setting>=2} {
set pirate [string totitle $env(YPPSC_PIRATE)]
if {$privacy_setting>=2} {
set pirate [string totitle $env(YPPSC_PIRATE)]
@@
-689,9
+695,11
@@
proc char_read_pgm {f} {
append o $ointerl
}
append o $ointerl
}
-# debug "DATA $o"
- set data [exec pnmscale 1 << $o]
- image create photo image/main -data $data
+ debug "DATA1 $o"
+ set tmpfile ./#dictimage#.tmp
+ exec pnmscale 1 << $o >$tmpfile
+ image create photo image/main -file $tmpfile
+ file delete $tmpfile
}
#---------- character set editor display ----------
}
#---------- character set editor display ----------
@@
-897,7
+905,7
@@
proc recursor {} {
# $database($context 0x<bits> 0x<bits>...) = $hex
# $database($context 0x<bits> 0x<bits>...) = $hex
-set database_magic/char
{# ypp-sc-tools pctb font v2}
+set database_magic/char
"# ypp-sc-tools pctb font v3 depth=$aadepth"
proc read_database_header/char {f} {
global rows
proc read_database_header/char {f} {
global rows
@@
-1133,10
+1141,10
@@
proc chop_counted {var} {
}
proc approve_decompose_data {specdata} {
}
proc approve_decompose_data {specdata} {
- global data
+ global data
aadepth
set data $specdata
set data $specdata
- regsub-data
{^ypp-sc-tools dictionary update v2\n}
{}
+ regsub-data
"^ypp-sc-tools dictionary update v3 depth=$aadepth\\n"
{}
uplevel 1 chop_counted pirate
uplevel 1 chop_counted caller
uplevel 1 chop_counted dict
uplevel 1 chop_counted pirate
uplevel 1 chop_counted caller
uplevel 1 chop_counted dict