taskWeeChat - Tasks: task #12332, Setting default options for script...

 
 

task #12332: Setting default options for script options

Submitted by:  None
Submitted on:  Tue 27 Nov 2012 12:47:35 PM UTC  
 
Category:  scripts Should Start On:  Tue 27 Nov 2012 12:00:00 AM UTC
Should be Finished on:  Tue 27 Nov 2012 12:00:00 AM UTC Priority:  5 - Normal
Status:  In Progress Privacy:  Public
Percent Complete:  0% Assigned to:  Sebastien Helleu <flashcode>
Originator Name:  Peter Boström Originator Email:  -email is unavailable-
Open/Closed:  Open Planned Release:  0.4.2
IRC nick:  pbos

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 03 May 2013 09:48:00 AM UTC, comment #2:

Please use a hashtable as second argument (after name of option), so that any future default can be added without changing API and plugins calling this function.
Thanks!

Sebastien Helleu <flashcode>
Project AdministratorIn charge of this item.
Tue 19 Feb 2013 10:07:10 PM UTC, comment #1:

Patch attached. Coarsely tested for all script languages. :)

Peter Boström <pbos>
Project Member
Tue 27 Nov 2012 12:47:35 PM UTC, original submission:

Plugin variables have no default, so /set plugin.* looks weird because all scripts options have (default: "")

An api function: weechat.config_set_plugin_defaults(option, default_value, description)

Would allow changing the following snippet (from urlserver.py):

to:

Ignoring the int(version) issue, this moves responsibility of displaying plugin defaults in descriptions from scripts to the /set system which already supports it. Scripts don't have to reinvent the wheel to display defaults, it's already in place. Less code duplication, and a more uniform look. Along with shorter code per script.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #27482:  0001-core-API-function-config_set_defaults_plugin-for-set.patch added by pbos (34KiB - text/x-patch - Introduces 'config_set_defaults_plugin', deprecates 'config_set_desc_plugin')

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by pbos (Updated the item)
  • -email is unavailable- added by flashcode (Updated the item)
  • -email is unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-01-04 flashcode Assigned topbos => flashcode
    2013-05-03 flashcode StatusNone => In Progress
        Planned ReleaseNone => 0.4.2
    2013-02-19 pbos Attached File- => Added 0001-core-API-function-config_set_defaults_plugin-for-set.patch, #27482
    2013-02-19 flashcode Assigned toNone => pbos

    Back to the top


    Powered by Savane 3.3