This may seem obvious and perhaps bit of work, but is there any way to make
the api backwards compatible by overloading for classes/functions that
have changed arguments and perhaps using new names for those that return
differently?
Just wondering
From: Benjamin Bertrand [mailto:[email protected]]
Sent: Friday, August 01, 2014 9:04 AM
To: Thomas Amland
Cc: Benjamin Bertrand; [email protected]
Subject: Re: [Xbmc-addons] [Please Read] script.module.requests API change
Le 1 aug 2014 à 12:52, Thomas Amland <[email protected]
<mailto:[email protected]> > a écrit :
Maybe things like this should be posted in the forums in the future. I don't
think anybody reads this list..
I know... I got a few answers anyway.
And some were against the API change... For a basic usage, requests v1 is
fine.
IMO creating a new module like this is a really bad idea. Since you have
renamed the module to "requests2", everything that use it will be
incompatible for use outside of xbmc. And the other way around: if you want
to use other modules that depend on requests, you have to either modify them
to import "requests2" be stuck with v1 forever.
For the outside compatibility, you can do:
try:
import requests2 as requests
except ImportError:
import requests
Last time, you updated the module from v0.x to v1.x, which as far as I know
had far more API changes requiring several add-ons to be updated
simultaneously. I don't see why it would be harder this time.
v0.x was not a stable release. That's why I didn't want to stay with it and
pushed for the API changes. It did require some work: all had to submit a
new addon and I pushed all the changes at the same time. I even modified an
addon myself. And not many addons were using requests.
This time, I didn't get feedback for several addons. I didn't want to check
myself if there was an impact or not on all addons.
Anyway, there is no ideal solution.
If I changed the API and it broke someone addon, I'm sure they would not
have been happy...
All that being said, I don't think many use the requests2 module (I have to
check).
And I agree that having to import requests2 is not very nice.
I actually think it'd be better to upgrade the requests module to v2.
I just don't want to break other addons. Not easy to warn everyone.
I don't think the forum is really better than the mailing list.
Any suggestion?
/Benjamin
On Tue, Jan 21, 2014 at 3:05 PM, Benjamin Bertrand
<[email protected] <mailto:[email protected]> > wrote:
Hi all,
I got a pull request to update script.module.requests to v2.2.0.
Current version is 1.1.0.
There are a few API changes when migrating to 2.x... But they are quite
limited.
They probably don't impact most plugins (but I haven't checked).
So the question is, would the devs using requests prefer:
1. An update of the current requests module to 2.2.0. All devs have to
check if changes are needed to their plugins.
2. Creation of a new module script.module.requests2.
Thanks for the feedback.
/beenje
----------------------------------------------------------------------------
--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431
<http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktr
k> &iu=/4140/ostg.clktrk
_______________________________________________
Xbmc-addons mailing list
[email protected] <mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/xbmc-addons
----------------------------------------------------------------------------
--
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Xbmc-addons mailing list
[email protected] <mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/xbmc-addons
<http://s.bl-1.com/f9m3bR7.gif>
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons