Skip to content
This repository has been archived by the owner on Dec 28, 2023. It is now read-only.

Feature request: Some suggestions to API #10

Open
moteus opened this issue Jan 21, 2015 · 6 comments
Open

Feature request: Some suggestions to API #10

moteus opened this issue Jan 21, 2015 · 6 comments
Assignees

Comments

@moteus
Copy link
Contributor

moteus commented Jan 21, 2015

  1. Inherite Formats
Base = w:add_format{...}
Derive = Base:derive{...}
-- if we change value in `Base` value also changes in `Derive`
-- If we set value in `Derive` then all changes in `Base` are ignore.
  1. Clone Formats
Base = w:add_format{...}
Derive = Base:clone{...} -- independent
  1. set method
format:set{align = 'center'}
  1. functions should return self
format
  :set_align(...)
  :set_color(...)

sheet
  :write(...)
  :write(...)
@jmcnamara jmcnamara self-assigned this Jan 21, 2015
@jmcnamara jmcnamara changed the title Some suggestions to API Feature request: Some suggestions to API Jan 22, 2015
@marmidr
Copy link

marmidr commented Jun 13, 2016

Hi,
I agree with the above suggestions.
Deriving is a good idea, however I think it may produce some problems.
Clone - method known from another libraries (wx) - for sure it will be safer.
Lack of get() of existing cell format now makes using library uncomfortable. Same for modifying value of already formatted cells.
Also, why there is no parameter, e. in set_bold() ?
In my document I format big range of cells (color and border), and later only for some of them bold style is set. No way to modify, I have to create a new format.

I can make improvements, I only need to know how to test it (modify/create new tests?).

@marmidr
Copy link

marmidr commented Jun 13, 2016

One more: is there some compatibility with Python implementation intended? I mean the API should be the same or we can implement new features freely ?

@jmcnamara
Copy link
Owner

Also, why there is no parameter, e. in set_bold() ?
In my document I format big range of cells (color and border), and later only for some of them bold style is set. No way to modify, I have to create a new format.

Seems reasonable. You should submit a separate issue for that.

@jmcnamara
Copy link
Owner

is there some compatibility with Python implementation intended?

Yes. The API should mirror the Perl/Python APIs.

@marmidr
Copy link

marmidr commented Jun 13, 2016

So (for example) if in Perl implementation there is no parameter in set_bold(), it shouldn't appear in Lua as well, even if this is reasonable thing to do ?

Now I checked: Python version supports input argument in set_bold(), beside that the True is the default

@jmcnamara
Copy link
Owner

Now I checked: Python version supports input argument in set_bold(), beside that the True is the default

Right. So if it isn't in the lua version then it is probably a bug (or oversight). So If you open an issue, I'll fix it (and for the other properties as well).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants