<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to patches</title><link href="https://sourceforge.net/p/tcllib/patches/" rel="alternate"/><link href="https://sourceforge.net/p/tcllib/patches/feed.atom" rel="self"/><id>https://sourceforge.net/p/tcllib/patches/</id><updated>2013-04-10T18:11:03Z</updated><subtitle>Recent changes to patches</subtitle><entry><title>Symmetrical json conversion</title><link href="https://sourceforge.net/p/tcllib/patches/257/" rel="alternate"/><published>2013-04-10T18:11:03Z</published><updated>2013-04-10T18:11:03Z</updated><author><name>Thomas Perschak</name><uri>https://sourceforge.net/u/tombert/</uri></author><id>https://sourceforge.net20045a75d107ff21ed6d99c33d6c1936604a6140</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I propose the following enhancement:&lt;/p&gt;
&lt;p&gt;proc json::dict2json {dictVal {keys {}}} {&lt;br /&gt;
set json ""&lt;br /&gt;
dict for {key val} $dictVal {&lt;br /&gt;
# key must always be a string, val may be a number, string or&lt;br /&gt;
# bare word (true|false|null) or a dict if provided in keys&lt;/p&gt;
&lt;p&gt;## check if we can resolve the value to a dictionary&lt;br /&gt;
if {($key in $keys) &amp;amp;&amp;amp; ![catch {dict keys $val}]} {&lt;br /&gt;
set val [json::dict2json $val $keys]&lt;br /&gt;
} elseif {![string is double -strict $val]&lt;br /&gt;
&amp;amp;&amp;amp; ![regexp {^(?:true|false|null)$} $val]} {&lt;br /&gt;
set val "\"$val\""&lt;br /&gt;
}&lt;br /&gt;
if {$json ne ""} {append json ","}&lt;br /&gt;
append json "\"$key\":$val"&lt;br /&gt;
}&lt;br /&gt;
return "\{${json}\}"&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;Normally one knows the keys in a dictionary, how else would you be able to access them? Thus you could also pass a list of all possible keys allowing for symmetric conversion:&lt;/p&gt;
&lt;p&gt;&amp;gt; json::json2dict {{"user1":{"maint":"yes"},"user2":{"maint":"no","home":{"town":"Vienna","state":"Austria"}}}}&lt;br /&gt;
user1 {maint yes} user2 {maint no home {town Vienna state Austria}}&lt;/p&gt;
&lt;p&gt;&amp;gt; json::dict2json {user1 {maint yes} user2 {maint no home {town Vienna state Austria}}} {user1 user2 home}&lt;br /&gt;
{"user1":{"maint":"yes"},"user2":{"maint":"no","home":{"town":"Vienna","state":"Austria"}}}&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Calendar closes by clicking year/month navigation arrow.</title><link href="https://sourceforge.net/p/tcllib/patches/256/" rel="alternate"/><published>2013-03-08T01:01:20Z</published><updated>2013-03-08T01:01:20Z</updated><author><name>Yusuke Yamasaki</name><uri>https://sourceforge.net/u/yyamasak/</uri></author><id>https://sourceforge.netdf7b414a2a336ca2be32cbf2a6574e2713c17ff6</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I have modified dateentry &amp;lt;ButtonPress&amp;gt; binding not to close a calendar by clicking items tagged with "cbutton".&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>update iban valtype</title><link href="https://sourceforge.net/p/tcllib/patches/255/" rel="alternate"/><published>2013-02-26T19:17:53Z</published><updated>2013-02-26T19:17:53Z</updated><author><name>MaxJarek</name><uri>https://sourceforge.net/u/maxjarek/</uri></author><id>https://sourceforge.net078e5173d5042d1cae802ecbf797ad02d5c25a9e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Update version for compatibility with IBAN Registry version 43&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>added imap "copy" command</title><link href="https://sourceforge.net/p/tcllib/patches/254/" rel="alternate"/><published>2013-02-11T17:24:26Z</published><updated>2013-02-11T17:24:26Z</updated><author><name>Magnatune</name><uri>https://sourceforge.net/u/magnatune/</uri></author><id>https://sourceforge.netfb2f558e77d87c0e2f838d5a6319974834c58b2d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I've added a proc for the imap "copy" function, which is needed if you want to move a message from one mailbox to another.  Currently, it's not possible to move messages between folders with the imap4 library. This proc fixes that problem.&lt;/p&gt;
&lt;p&gt;To add this feature, paste the following proc below the "proc expunge" function in imap4.tcl&lt;/p&gt;
&lt;p&gt;May I ask that you add this patch to the imap library ?&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;-john&lt;/p&gt;
&lt;p&gt;# copy : copy a message to a destination mailbox&lt;br /&gt;
proc copy {chan msgid mailbox} {&lt;br /&gt;
if {[simplecmd $chan COPY SELECT [list $msgid $mailbox]]} {&lt;br /&gt;
return 1&lt;br /&gt;
}&lt;br /&gt;
return 0&lt;br /&gt;
}&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>huddle get does not accept non-scalar dict keys</title><link href="https://sourceforge.net/p/tcllib/patches/253/" rel="alternate"/><published>2012-06-20T20:06:50Z</published><updated>2012-06-20T20:06:50Z</updated><author><name>ethanp</name><uri>https://sourceforge.net/u/ethanp/</uri></author><id>https://sourceforge.netf075984888465e0780b3474ed0f5c402da4ff75e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Found a bug in how huddle dict objects lookup non-scalar keys.  The bug is in huddle::_key_reflexive and stems from the a non-scalar single key being passed via args (variadic mechanism).  The problem is that an extra set of curly braces ends up enclosing the key path when it finally gets passed to dict get (which errors).  A simple example is:&lt;br /&gt;
set h [huddle create {a a} b]&lt;br /&gt;
huddle get $h {a a}; # error thrown here&lt;/p&gt;
&lt;p&gt;I've seen this bug in huddle versions 0.1.3 through 0.1.5.&lt;/p&gt;
&lt;p&gt;A fix for this is attached along with some new tests, the files are modified versions of the huddle 0.1.5 source.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>iban validate</title><link href="https://sourceforge.net/p/tcllib/patches/252/" rel="alternate"/><published>2012-06-05T21:34:28Z</published><updated>2012-06-05T21:34:28Z</updated><author><name>MaxJarek</name><uri>https://sourceforge.net/u/maxjarek/</uri></author><id>https://sourceforge.neteb28746e0ccd691464000a33587fd4ff18be7fc9</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;update version for compatibility with IBAN Registry version 35&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>json:  pretty-printing a dictionary</title><link href="https://sourceforge.net/p/tcllib/patches/251/" rel="alternate"/><published>2012-03-19T11:40:11Z</published><updated>2012-03-19T11:40:11Z</updated><author><name>Aldo Buratti</name><uri>https://sourceforge.net/u/aldobu/</uri></author><id>https://sourceforge.net2717ee49a4892ab879a3c07101d2b069e9473b13</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Based on json.tcl (1.1.2)&lt;br /&gt;
I added a new proc named "json2prettydict"&lt;/p&gt;
&lt;p&gt;Aim of this proc is to return a "pretty-printed" tcl-dictionary.&lt;/p&gt;
&lt;p&gt;I think this proc could be useful for documentating complex nested dictionaries.&lt;/p&gt;
&lt;p&gt;- Internal Notes -&lt;br /&gt;
"json2prettydict" is heavily based on existing json2dict and json::parseXXX procs.&lt;br /&gt;
I slightly changed the internal code of all json::parseXXX procs, so that&lt;br /&gt;
these procs, may be called in two ways: for getting a (traditional) tcl-dict&lt;br /&gt;
or for getting a pretty-printed tcl-dict.&lt;/p&gt;
&lt;p&gt;[Source code is attached]&lt;/p&gt;
&lt;p&gt;-------------------------------------&lt;br /&gt;
Here is a demo:&lt;/p&gt;
&lt;p&gt;set jsonStr { \
{ "photos": { "page": 1, "pages": "726", "perpage": 3, "total": "7257", &lt;br /&gt;
"photo": [&lt;br /&gt;
{ "id": "6974156079", "owner": "74957296@N08", "secret": "005d743f82", "server": "7197", "farm": 8, "title": "Kenya Watamu \"Deep Sea Fishing\" \"Indian Ocean\" \"Blue Marlin\"", "ispublic": 1, "isfriend": 0, "isfamily": 0 },&lt;br /&gt;
{ "id": "6822988100", "owner": "52857411@N08", "secret": "56630c18e8", "server": "7183", "farm": 8, "title": "Gedi Ruins, Local Guide", "ispublic": 1, "isfriend": 0, "isfamily": 0 },&lt;br /&gt;
{ "id": "6822909640", "owner": "52857411@N08", "secret": "f4e392ea36", "server": "7063", "farm": 8, "title": "Local Fisherman, Mida Creek", "ispublic": 1, "isfriend": 0, "isfamily": 0 }&lt;br /&gt;
] }, "stat": "ok" }&lt;br /&gt;
}&lt;br /&gt;
# First, just for comparision, call json2dict&lt;br /&gt;
set d1 [json::json2dict $jsonStr]&lt;br /&gt;
# result is the following&lt;br /&gt;
if {0} {&lt;/p&gt;
&lt;p&gt;photos {page 1 pages 726 perpage 3 total 7257 photo {{id 6974156079 owner 74957296@N08 secret 005d743f82 server 7197 farm 8 title {Kenya Watamu "Deep Sea Fishing" "Indian Ocean" "Blue Marlin"} ispublic 1 isfriend 0 isfamily 0} {id 6822988100 owner 52857411@N08 secret 56630c18e8 server 7183 farm 8 title {Gedi Ruins, Local Guide} ispublic 1 isfriend 0 isfamily 0} {id 6822909640 owner 52857411@N08 secret f4e392ea36 server 7063 farm 8 title {Local Fisherman, Mida Creek} ispublic 1 isfriend 0 isfamily 0}}} stat ok&lt;/p&gt;
&lt;p&gt;}&lt;br /&gt;
# Then create a pretty printed dictionary&lt;br /&gt;
set d2 [json::json2prettydict $jsonStr]&lt;br /&gt;
# result is the following&lt;br /&gt;
if {0} {&lt;/p&gt;
&lt;p&gt;photos {&lt;br /&gt;
page 1&lt;br /&gt;
pages 726&lt;br /&gt;
perpage 3&lt;br /&gt;
total 7257&lt;br /&gt;
photo {&lt;br /&gt;
{&lt;br /&gt;
id 6974156079&lt;br /&gt;
owner 74957296@N08&lt;br /&gt;
secret 005d743f82&lt;br /&gt;
server 7197&lt;br /&gt;
farm 8&lt;br /&gt;
title {Kenya Watamu "Deep Sea Fishing" "Indian Ocean" "Blue Marlin"}&lt;br /&gt;
ispublic 1&lt;br /&gt;
isfriend 0&lt;br /&gt;
isfamily 0&lt;br /&gt;
}&lt;br /&gt;
{&lt;br /&gt;
id 6822988100&lt;br /&gt;
owner 52857411@N08&lt;br /&gt;
secret 56630c18e8&lt;br /&gt;
server 7183&lt;br /&gt;
farm 8&lt;br /&gt;
title {Gedi Ruins, Local Guide}&lt;br /&gt;
ispublic 1&lt;br /&gt;
isfriend 0&lt;br /&gt;
isfamily 0&lt;br /&gt;
}&lt;br /&gt;
{&lt;br /&gt;
id 6822909640&lt;br /&gt;
owner 52857411@N08&lt;br /&gt;
secret f4e392ea36&lt;br /&gt;
server 7063&lt;br /&gt;
farm 8&lt;br /&gt;
title {Local Fisherman, Mida Creek}&lt;br /&gt;
ispublic 1&lt;br /&gt;
isfriend 0&lt;br /&gt;
isfamily 0&lt;br /&gt;
}&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;}&lt;br /&gt;
stat ok&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;# -- end&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>New Module: socks5</title><link href="https://sourceforge.net/p/tcllib/patches/250/" rel="alternate"/><published>2012-03-10T23:19:28Z</published><updated>2012-03-10T23:19:28Z</updated><author><name>Blair Kitchen</name><uri>https://sourceforge.net/u/dongola7/</uri></author><id>https://sourceforge.netb5441b5e6155df0fce78120375b775924aa5a32b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Patch to add a new module for establishing connections via SOCKS 5 proxies.  The patch was generated against the 1.14 release tarball.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>::S3 missing "Host:" header</title><link href="https://sourceforge.net/p/tcllib/patches/249/" rel="alternate"/><published>2012-03-01T22:18:55Z</published><updated>2012-03-01T22:18:55Z</updated><author><name>Sam O'Connor</name><uri>https://sourceforge.net/u/samoconnor/</uri></author><id>https://sourceforge.net6d831abe7fa08c803baf2358e02d5c2b80529b76</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;::S3 does not send a "Host:" header.&lt;br /&gt;
This causes "HTTP/1.1 400 Bad Request" to be returned by some transparent proxies.&lt;br /&gt;
(e.g. when using Telstra 3G through the telstra.iph APN).&lt;/p&gt;
&lt;p&gt;The patch below sets the host header.&lt;/p&gt;
&lt;p&gt;--- /System/Library/Tcl/tcllib1.12/amazon-s3/S3.tcl.orig   2012-02-25 15:32:45.000000000 +1100&lt;br /&gt;
+++ /System/Library/Tcl/tcllib1.12/amazon-s3/S3.tcl 2012-03-02 09:13:07.000000000 +1100&lt;br /&gt;
@@ -252,6 +252,7 @@&lt;br /&gt;
if {${content-type} != ""} {&lt;br /&gt;
dict set headers content-type ${content-type}&lt;br /&gt;
}&lt;br /&gt;
+    dict set headers host s3.amazonaws.com &lt;br /&gt;
set xamz ""&lt;br /&gt;
foreach key [lsort [dict keys $headers x-amz-*]] {&lt;br /&gt;
# Assume each is seen only once, for now, and is canonical already.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>First go at installing tcl modules</title><link href="https://sourceforge.net/p/tcllib/patches/248/" rel="alternate"/><published>2012-02-29T23:26:49Z</published><updated>2012-02-29T23:26:49Z</updated><author><name>Stuart Cassoff</name><uri>https://sourceforge.net/u/stwo/</uri></author><id>https://sourceforge.net0df18ef278237c64f9e58366e12805dca9e78339</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Attached patch gives the installer the ability to install (some) packages as tcl modules.&lt;br /&gt;
Also adds -destdir option, similar to ${DESTDIR} in Tcl's Makefile.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>