tcl

How to test a Tcl/Tk script?

We have a few Tcl/Tk scripts (because a GUI we use can incorporate macros only in Tcl). I have just modified one of these, and want to test it. We make use of Test::More for testing Perl modules, and have made a little use of Selenium for web pages, but we have never had any kind of automatic test rig for our Tcl/Tk scripts. I've tri...

Is there a way to unwrap a Tclkit packed exe?

I have an exe that has been wrapped using this method: http://www.kocjan.org/tclmentor/10-tclkits-building-standalone-tcl-binaries.html Is there any way to unpack it back into a .kit file or a vfs structure? ...

how to do getpwnam/getpwuid etc in tcl

does tcl have a standard way of doing NSS lookups (getpwnam, setpwent,...) ...

does python 2.5 have an equivalent to Tcl's uplevel command?

Does python have an equivalent to Tcl's uplevel command? For those who don't know, the "uplevel" command lets you run code in the context of the caller. Here's how it might look in python: def foo(): answer = 0 print "answer is", answer # should print 0 bar() print "answer is", answer # should print 42 def bar(): u...

How to generate texts into postscript files from the Canvas object of Tcl/Tk library?

Hi All, I've been stuck on this problem for days: I'm trying to generate texts from the canvas object using its "postscript" option to get .ps file. I found that it worked fine if I draw lines, ovals, etc on the canvas and they were shown in the .ps file, however, I had no luck with the text objects -- even if they were shown on the ca...

Expect Tcl script - Error passing quoted argument using spawn

I just wrote a very simple Expect script for wrapping around rsync, but it seems to be giving me trouble. Basically, I am automating the SSH login prompt called from rsync. I also have to pass arguments through rsync to SSH so it doesn't do the host key checking. I am well aware of SSH authentication keys and ssh-keygen, but I have go...

Help: TCL error in Iphone Application

Hello! I compile Tux Racer World Challenger application! But I got a problem with TCL. In some file of this application include: #include TCL_HEADER But when I compile I get error: fatal error: 'tcl.h' file not found I have added libtcl8.5.dylib in to my project. I'm using Xcode 3.2.3 Please help me! ...

tcl/tk button or toplevel pathname conventions

Hello all. When one creates a new toplevel or button in TK, one needs to enter a pathname. I have seen a basic code which looks like: toplevel .a ... button .a.b ... My question is: Are the dots treated differently than letters? Are they some sort of hierarchy delimiters, which create parent child relationship? I have looked at wiki T...

how to use spawn command in TCL

I am using the following code #!/usr/bin/expect -f #!usr/bin/expect #package require Expect puts "Hello world" spawn ssh [email protected] expect -nocase "password:" send "abc123\r" puts "done" while executing, it throws error Hello world invalid command name "spawn" while executing "spawn ssh [email protected]" (file ...

rlwrap hangs jobs while running at the background

I have a problem with rlwrap (see the man page here). Consider this situation: empty.tcl is an empty file. At bash this line tclsh empty.tcl & runs the job in the background and exits it, so i get this prompt [1]+ Done tclsh empty.tcl. While this line rlwrap tclsh empty.tcl & runs the job in the background and ...

difference between tcl list of length one and a scalar?

I have a c function (dbread) that reads 'fields' from a 'database'. Most of those fields are single valued; but sometimes they are multi-valued. So I had c code that said if valcount == 1 return string else make list foreach item in vals append to list return list Because i thought most of the time people want a...

postgres (8.3), useing query result in function

I am trying to create a function to populate 2 tables, the second query containing the new id from the first insert. an example of some of my tables: CREATE TABLE message ( message_id bigserial NOT NULL, member_id bigint NOT NULL, message character varying(8192) NOT NULL, ... ) CREATE TABLE feed_message ( feed_id bigint NOT ...

Fullpath of current TCL script

Is there a possibility to get the full path of the currently executing TCL script? In PHP it would be: __FILE__ ...

tcl command redirect to a variable, tcl version is 8.4

Hello all. I want to redirect the output of 1 command to a variable, where the OUTPUT is usually to STDOUT. I am running an EDA tool, which has tcl interpeter & it's own commands. Let's say that the tool has a tcl query, which says TOOL> find_transistor m* m1 m2 m3 m4 I want to have a way of doing the following: TOOL> set ret redirec...

Open source Task Management modules for OpenACS/TCL

We are about to build a standard task management (collaboration enabled) feature on top of our TCL/OpenACS based website and I would like to know if there are some open source modules we could leverage for this purpose. ...

How to wrap a void* pointer into a TCL Object

I'm trying to save a void* pointer (or any pointer) into a tcl Object so I can retrieve it later. I saw SWIG convert it to a string with some encoding and later decode it. But in order to make it more efficient, I want to directly get the pointer in and out of the tcl obj. Something like a Tcl_GetPointerFromObj(). Is there anyway to do i...

obfuscated way to get "0" in a tcl function, cross platform?

I haven't used tcl before and just need to do one trick, I can do it trivially in something like bash but I need it to work cross-platform (e.g. tcl in cygwin on windows). Can someone suggest a short (5-10) obfuscated function that just returns 0 after taking two string args? It just can't do something like run shell commands that won...

Understanding what files in the TCL are required for distributing frozen Python Tkinter apps

I'm trying to figure out which files in Python's (Python 2.6/Python 2.7) tcl folder are required in order to distribute frozen Python Tkinter apps using Py2exe or similar. The quick and dirty way to do this (using pyexe as an example) is to follow the 2nd example on the following page and then xcopy your python's tcl folder to your dis...

Why does this TCL proc with no args not work?

This should be an easy one for someone... I had a function in a TCL script called unwrap. Modifying it, I realized I no longer needed to pass it args. So I changed it to unwrap {} { ... } Now when I call it with no args, i.e.: unwrap I get an error invalid command unwrap Ideas? How do I properly format a TCL function with no a...

Anti Flood for command

Hi, I have this script I'm working on: bind pub ga !kick pub_do_kick proc pub_do_kick {nick uhost hand chan arg} { # create a sub-proc to delay proc delay {} { return } # timer already running? if {[utimerexists delay] == ""} { # timer is not active, perform something global botnick set who ...