From: Ian Jackson Date: Sat, 12 Dec 2009 13:17:03 +0000 (+0000) Subject: move http client setup to yarrglib.tcl X-Git-Tag: 6.3.0~8 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.main.git;a=commitdiff_plain;h=ca7f7a582f148a9e7d5e182451b59c4b2b151389 move http client setup to yarrglib.tcl --- diff --git a/yarrg/dictionary-manager b/yarrg/dictionary-manager index 83c7e54..46a5902 100755 --- a/yarrg/dictionary-manager +++ b/yarrg/dictionary-manager @@ -510,13 +510,7 @@ proc upload_init {} { } 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\"" + httpclientsetup dictionary-manager } } diff --git a/yarrg/yarrglib.tcl b/yarrg/yarrglib.tcl index e1bf6e8..a657537 100644 --- a/yarrg/yarrglib.tcl +++ b/yarrg/yarrglib.tcl @@ -6,3 +6,13 @@ proc manyset {list args} { set my $val } } + +proc httpclientsetup {program} { + ::http::config -urlencoding utf-8 + set ua [::http::config -useragent] + debug "USERAGENT OLD \"$ua\"" + set ua [exec ./database-info-fetch useragentstringmap $ua \ + $program 2>@ stderr] + ::http::config -useragent $ua + debug "USERAGENT NEW \"$ua\"" +}