[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb: [463] trunk/utils/cli
- Subject: SF.net SVN: ledger-smb: [463] trunk/utils/cli
- From: ..hidden..
- Date: Wed, 01 Nov 2006 22:57:27 -0800
Revision: 463
http://svn.sourceforge.net/ledger-smb/?rev=463&view=rev
Author: einhverfr
Date: 2006-11-01 22:57:25 -0800 (Wed, 01 Nov 2006)
Log Message:
-----------
CLI script host works enough that the sample can retrieve a customer by id.
Modified Paths:
--------------
trunk/utils/cli/ledgersmb_cli.pl
trunk/utils/cli/sample.lsmb
Modified: trunk/utils/cli/ledgersmb_cli.pl
===================================================================
--- trunk/utils/cli/ledgersmb_cli.pl 2006-11-02 06:52:55 UTC (rev 462)
+++ trunk/utils/cli/ledgersmb_cli.pl 2006-11-02 06:57:25 UTC (rev 463)
@@ -30,8 +30,8 @@
$syntax = << '_END_SYNTAX_';
KEY : /\w[a-z0-9_]*/i
- MODSTR : /\w[a-z0-9_]*/i
- FNKEY : /(?:\w|:)+/
+ MODSTR : /\w[a-z0-9_:]*/i
+ FNKEY : /(?:\w|:|\-\>)+/
OP : m([-+*/%])
NUMBER : /[+-]?\d*\.?\d+/
@@ -51,7 +51,7 @@
{ main::call_and_assign($item{FNKEY}, $item{ARGSTR}, $item{KEY}) }
FUNCTIONCALL : /call/i FNKEY '(' ARGS ')'
- { main::call($item{FNKEY}, $item{ARGS})}
+ { main::call($item{FNKEY}, $item{ARGS});}
for : /for/i KEY
{ main::push_loop($item{KEY}) }
@@ -112,7 +112,7 @@
$argstr =~ s/form/\\\%\$form/;
$argstr =~ s/user/\\\%myconfig/;
my @args = split /,\s/, $argstr;
- return $call(@args);
+ eval "$call($argstr);\n" || print STDERR $@ . "\n";
}
sub call_and_assign {
@@ -149,7 +149,7 @@
sub load_mod {
my $mod = shift;
$mod =~ s/::/\//;
- eval { require "$mod.pm"; };
+ require "$mod.pm";;
}
my $scriptparse = new Parse::RecDescent($syntax);
Modified: trunk/utils/cli/sample.lsmb
===================================================================
--- trunk/utils/cli/sample.lsmb 2006-11-02 06:52:55 UTC (rev 462)
+++ trunk/utils/cli/sample.lsmb 2006-11-02 06:57:25 UTC (rev 463)
@@ -2,5 +2,8 @@
login = demo # How to set a form variable
password = demo
LOGIN # Log in
-MODULE AR # Load a module
-CALL AR::transactions(form, user) # call a function
+MODULE LedgerSMB::CT # Load a module
+id = 10139
+vc = customer
+db = customer
+CALL CT->create_links(user, form) # call a function
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.