ericmandel / pyds9

Python connection to SAOimage DS9 via XPA
76 stars 41 forks source link

use of __setattr__ make setter of @property not working #33

Closed Fmajor closed 8 years ago

Fmajor commented 8 years ago

I want to use @property and @x.setter to have my own class of ds9, like that

....
    @property
    def frame(self):
        return self.get("frame")
    @frame.setter
    def frame(self, value):
        try:
            int(value)
            self.set("frame {}".format(value))
        except:
            raise Exception("invaild value for frame: {}".format(value))
....

but ds9.frame = 1 did not work for me, i google it, and get the solution http://stackoverflow.com/questions/15750522/class-properties-and-setattr i have made a pull request for this issue.

montefra commented 8 years ago

34 has been merged. Closing the issue