(Wish) Content plugin property parameter

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
nsp
Power Member
Power Member
Posts: 1813
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

(Wish) Content plugin property parameter

Post by *nsp »

For some content plugin the column definition is done inside an ini file => one definition become one column. Or definition of the column take parameters from an ini file => some of us do a copy of the plugin folder and renaming to have more than one static def at the time.

Does the content plugin api could accept an open parameter to pass to the property ?
An example could be :
for column :
=MyPlug.property.unit#parameter

Does it make sens ??
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

Does it make sens ??
I don't think so. An additional parameter wouldn't add an additional field - just configure it in some way. The problem here is that the Script content plug-in doesn't allow additional fields. The problem should be solved by the plug-in author.
User avatar
nsp
Power Member
Power Member
Posts: 1813
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

Lefteous wrote:... The problem here is that the Script content plug-in doesn't allow additional fields. The problem should be solved by the plug-in author.
I do not focused the script content plugin exclusively !

My concern is more for some regex plugin where it could be nice to have a parameter describing directly in the custom column definition my regex expression and not using an external ini file to have a new field !

For the script content plugin, for me it could be fine to have smth like
=MyScriptContent.doStuffUsing#c:\myScripts\ScriptA.vbs.

But anyhow, you are right in a sens that <<The problem should be solved by the plug-in author>> in any case !
User avatar
nsp
Power Member
Power Member
Posts: 1813
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Bell (Wish) Content plugin property parameter

Post by *nsp »

nsp wrote: =MyPlug.property.unit#parameter

Does it make sens ??
The concern is to have wdx plugin that have configurable field during call instead of having hundreds of possible static field loaded from ini file.

Somme possible application :
Search like wdx plugin that return the number of occurrence of _any string_
Transformed file name using Regex expression like one used in sed...

I think ini file are for "long term" expression but sometime i need quick definition and do not like to open a ini file, unload/reload plugin to have my column available.....

2C-Ghisler Do you have any opinion on it ?
User avatar
Lev
Junior Member
Junior Member
Posts: 82
Joined: 2004-12-14, 13:08 UTC

Post by *Lev »

I think you can pass parameters to plugins via constructions immitating nonexisting content plugins
For example, I can write in a field:
[=script.Result][=param.qwerty]
param - is nonexisting wdx plugin, so nothing will be added to the column on it's place, but now you can add code to the script executed by Script content plugin to parse wincmd.ini in order to search for [=script.Result][=param.qwerty] construction and to use "qwerty" as a parameter for this script.

Here is a small sample script getting the parameter using the described method. It will just show a file name followed by our parameter.

Code: Select all

'Script for Script Content Plugin
'(c)Lev Freidin, 2005
'http://www.totalcmd.net/plugring/script_wdx.html
'http://wincmd.ru/plugring/script_wdx.html

Dim fso, ts, s, re

'right the path to you ini file here (you can get ini name using TCHelper, but it would make the script slow)
tcini="C:\windows\wincmd.ini"

Set fso = CreateObject("Scripting.FileSystemObject")

Const ForReading = 1
Set ts = fso.OpenTextFile(tcini, ForReading)
s = ts.ReadAll
ts.Close

Set re = New RegExp
re.Global = True
re.IgnoreCase = True
re.MultiLine = True

re.Pattern = "\[=script.result\]\[=param\.(.*)\]"
if re.Test(s) then
Set tt = re.Execute(s)
param = re.Replace(tt(0),"$1")
End if
content=filename & " " & param
set f=nothing
set fso=nothing
set re=nothing
For other wdx plugins - <<The problem should be solved by the plug-in author>> :)
User avatar
nsp
Power Member
Power Member
Posts: 1813
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

Lev wrote:I think you can pass parameters to plugins via constructions immitating nonexisting content plugins
For example, I can write in a field:
[=script.Result][=param.qwerty]
......snip ... snip ... snip .......
For other wdx plugins - <<The problem should be solved by the plug-in author>> :)
My concert is to have a generic way to pass parameters via TC call to any wdx field (that support it). and this to have temporary column or specific call for search plugin... If you use your code, you cannot control multiple call to [=Script.result] because you do not know which one is called by TC.... if you use File Description or SUPER WDX the call is not stored in wincmd.ini....

So even with script wdx you cannot simulate calls with parameters !
User avatar
Lev
Junior Member
Junior Member
Posts: 82
Joined: 2004-12-14, 13:08 UTC

Post by *Lev »

I thought that it was asked to be able to quick change wdx parameters via "Configure custom columns" or "Configure this custom columts view" - this info is stored in %COMMANDER_INI%. It was just a workaround for some specific case for my plugin, which certainly does not cover all possibilities which would we have if real parameters passing is implemented.
Sorry for misunderstanding.
User avatar
nsp
Power Member
Power Member
Posts: 1813
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

What think Mr Ghisler ?

Post by *nsp »

Content plugin with parameter !


In the multi rename tool (user counter, dynamic definition, dynamic script call ...)

In search let the plugin do a search in one call (author="G. Rastor", title=La Vie de%, contain=total, containCount=50-300...)

In the column view this feature can be useful for search like with similarity over an expression.

.... All those implementation are up to plugin developer, just a small change is needed in TC to handle it....

What do you think M. Ghisler ?
Post Reply