Merge lp:~mvo/dee/small-python-fixes into lp:dee
| Status: | Rejected |
|---|---|
| Rejected by: | Michal Hruby on 2013-11-26 |
| Proposed branch: | lp:~mvo/dee/small-python-fixes |
| Merge into: | lp:dee |
| Diff against target: |
36 lines (+5/-4) 2 files modified
bindings/python/Dee.py (+1/-1) examples/slave-model.py (+4/-3) |
| To merge this branch: | bzr merge lp:~mvo/dee/small-python-fixes |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| PS Jenkins bot | continuous-integration | Needs Fixing on 2012-12-15 | |
| Unity Team | 2012-09-11 | Pending | |
|
Review via email:
|
|||
Description of the Change
This fixes the python examples in the source to work
| Michal Hruby (mhr3) wrote : | # |
| Michael Vogt (mvo) wrote : | # |
On Tue, Sep 11, 2012 at 02:53:30PM -0000, Michal Hruby wrote:
> Thanks for these
>
> 8 - self.set_
> 9 + self.set_
>
> Would be nice if pygobject didn't change something every other version :( Ideally there should be a way to make it work with new as well as old pygobject (doesn't pygobject provide it's version in some prop?)
Since recently there is a gi.version_info that could be used, but its
not available on precsie and I don't know when exactly it was added
(nor when exactly the bindings broke).
So I think there these options:
- simply require latest python-gi and change unconditionally
- I could do a try/except AttributeError but that carries the risk that
it shadows other errors so I'm not really advocating it.
- Something like:
=== modified file 'bindings/
--- bindings/
+++ bindings/
@@ -1,3 +1,4 @@
+import gi
from gi.overrides import override
from gi.importer import modules
@@ -40,7 +41,12 @@
def set_schema (self, *args):
- self.set_
+ version = getattr(
+ # mvo: I don't know when *exactly* this changed
+ if version and version[0] > 3 and version[1] > 3:
+ self.set_
+ else:
+ self.set_
def _build_row (self, args):
result = []
| Michal Hruby (mhr3) wrote : | # |
> On Tue, Sep 11, 2012 at 02:53:30PM -0000, Michal Hruby wrote:
> > Thanks for these
> >
> > 8 - self.set_
> > 9 + self.set_
> >
> > Would be nice if pygobject didn't change something every other version :(
> Ideally there should be a way to make it work with new as well as old
> pygobject (doesn't pygobject provide it's version in some prop?)
>
> Since recently there is a gi.version_info that could be used, but its
> not available on precsie and I don't know when exactly it was added
> (nor when exactly the bindings broke).
>
> So I think there these options:
>
> - simply require latest python-gi and change unconditionally
>
> - I could do a try/except AttributeError but that carries the risk that
> it shadows other errors so I'm not really advocating it.
>
As long as it works on both P and Q, I'm fine with it, we don't need to support every version combination... And +1 for avoiding the use of try except.
Could you also link a bug about this pls?
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:380
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
| Michal Hruby (mhr3) wrote : | # |
I think this was fixed long time ago.
Unmerged revisions
- 380. By Michael Vogt on 2012-09-11
-
examples/
slave-model. py: fix the example to actually work - 379. By Michael Vogt on 2012-09-11
-
bindings/
python/ Dee.py: make set_schema() not crash

Thanks for these
8 - self.set_ schema_ full (tuple(args), len(args)) schema_ full (tuple(args))
9 + self.set_
Would be nice if pygobject didn't change something every other version :( Ideally there should be a way to make it work with new as well as old pygobject (doesn't pygobject provide it's version in some prop?)