<br><br><div class="gmail_quote">On Thu, Feb 2, 2012 at 6:45 AM, Anish Mangal <span dir="ltr"><<a href="mailto:anish@sugarlabs.org">anish@sugarlabs.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
While we're doing this, can we also fix a number of pep8 style errors<br>
;-). There are a number of them on a brief glance of the code.<br>
<div><div class="h5"><br></div></div></blockquote><div><br></div><div>Yes, sounds good.</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="h5">
On Wed, Feb 1, 2012 at 21:17, Rafael Ortiz <<a href="mailto:rafael@activitycentral.com">rafael@activitycentral.com</a>> wrote:<br>
> This patch permits flipsticks to init on dextrose builds, fixing a module name exception<br>
><br>
> Signed-off-by: Rafael Ortiz <<a href="mailto:rafael@activitycentral.com">rafael@activitycentral.com</a>><br>
> ---<br>
> montage.py | 4 +-<br>
> screen.py | 68 ---------------------------------------------------------<br>
> screenflip.py | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++<br>
> 3 files changed, 70 insertions(+), 70 deletions(-)<br>
> delete mode 100644 screen.py<br>
> create mode 100644 screenflip.py<br>
><br>
> diff --git a/montage.py b/montage.py<br>
> index 11e5f3f..553c8b3 100644<br>
> --- a/montage.py<br>
> +++ b/montage.py<br>
> @@ -28,7 +28,7 @@ from gettext import gettext as _<br>
> from sugar.activity.activity import get_bundle_path<br>
><br>
> import model<br>
> -import screen<br>
> +import screenflip<br>
> import kinematic<br>
> import theme<br>
> from theme import *<br>
> @@ -590,7 +590,7 @@ class View(gtk.EventBox):<br>
> for i in range(len(model.keys)):<br>
> self.keys_overlap_stack.append(i)<br>
><br>
> - self.key = screen.ScreenFrame()<br>
> + self.key = screenflip.ScreenFrame()<br>
><br>
> self.kfselected = 0<br>
> self.jointpressed = None<br>
> diff --git a/screen.py b/screen.py<br>
> deleted file mode 100644<br>
> index bd31199..0000000<br>
> --- a/screen.py<br>
> +++ /dev/null<br>
> @@ -1,68 +0,0 @@<br>
> -# This program is free software; you can redistribute it and/or modify<br>
> -# it under the terms of the GNU General Public License as published by<br>
> -# the Free Software Foundation; either version 2 of the License, or<br>
> -# (at your option) any later version.<br>
> -#<br>
> -# This program is distributed in the hope that it will be useful,<br>
> -# but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
> -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>
> -# GNU General Public License for more details.<br>
> -#<br>
> -# You should have received a copy of the GNU General Public License<br>
> -# along with this program; if not, write to the Free Software<br>
> -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA<br>
> -<br>
> -import theme<br>
> -import model<br>
> -<br>
> -class ScreenFrame(model.KeyFrame):<br>
> - def __init__(self):<br>
> - self.reset()<br>
> -<br>
> - def setjoints(self):<br>
> - self._setjoints(self.joints, self.sticks, self.middle)<br>
> -<br>
> - def reset(self):<br>
> - self.parts = theme.PARTS.copy()<br>
> - self.sticks = theme.STICKS.copy()<br>
> - self.joints = self._initjoints()<br>
> - self.middle = (theme.DRAWWIDTH/2, theme.DRAWHEIGHT/3)<br>
> - self.setjoints()<br>
> -<br>
> - def assign(self, x):<br>
> - self.middle = x.middle<br>
> - self.parts = x.parts.copy()<br>
> - self.sticks = x.sticks.copy()<br>
> - self.joints = x.joints.copy()<br>
> - self.setjoints()<br>
> -<br>
> - def getrotatepoint(self):<br>
> - (angle,len) = self.sticks['TORSO']<br>
> - x,y = self.middle<br>
> - (rx,ry) = self._getpoints(x,y,angle,int(len/2.0))<br>
> - return (rx,ry)<br>
> -<br>
> - def inrotate(self, x, y):<br>
> - rx, ry = self.getrotatepoint()<br>
> - if (abs(rx-x) <= 5) and (abs(ry-y) <= 5):<br>
> - return True<br>
> - return False<br>
> -<br>
> - def injoint(self, x, y):<br>
> - for jname in self.joints:<br>
> - jx, jy = self.joints[jname]<br>
> - if (abs(jx-x) <= 5) and (abs(jy-y) <= 5):<br>
> - return jname<br>
> - return False<br>
> -<br>
> - def inmiddle(self, x, y):<br>
> - mx, my = self.middle<br>
> - if (abs(mx-x) <= 5) and (abs(my-y) <= 5):<br>
> - return True<br>
> - return False<br>
> -<br>
> - def move(self, dx, dy):<br>
> - if self.joints:<br>
> - for jname in self.joints:<br>
> - (jx, jy) = self.joints[jname]<br>
> - self.joints[jname] = (jx+dx, jy+dy)<br>
> diff --git a/screenflip.py b/screenflip.py<br>
> new file mode 100644<br>
> index 0000000..bd31199<br>
> --- /dev/null<br>
> +++ b/screenflip.py<br>
> @@ -0,0 +1,68 @@<br>
> +# This program is free software; you can redistribute it and/or modify<br>
> +# it under the terms of the GNU General Public License as published by<br>
> +# the Free Software Foundation; either version 2 of the License, or<br>
> +# (at your option) any later version.<br>
> +#<br>
> +# This program is distributed in the hope that it will be useful,<br>
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>
> +# GNU General Public License for more details.<br>
> +#<br>
> +# You should have received a copy of the GNU General Public License<br>
> +# along with this program; if not, write to the Free Software<br>
> +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA<br>
> +<br>
> +import theme<br>
> +import model<br>
> +<br>
> +class ScreenFrame(model.KeyFrame):<br>
> + def __init__(self):<br>
> + self.reset()<br>
> +<br>
> + def setjoints(self):<br>
> + self._setjoints(self.joints, self.sticks, self.middle)<br>
> +<br>
> + def reset(self):<br>
> + self.parts = theme.PARTS.copy()<br>
> + self.sticks = theme.STICKS.copy()<br>
> + self.joints = self._initjoints()<br>
> + self.middle = (theme.DRAWWIDTH/2, theme.DRAWHEIGHT/3)<br>
> + self.setjoints()<br>
> +<br>
> + def assign(self, x):<br>
> + self.middle = x.middle<br>
> + self.parts = x.parts.copy()<br>
> + self.sticks = x.sticks.copy()<br>
> + self.joints = x.joints.copy()<br>
> + self.setjoints()<br>
> +<br>
> + def getrotatepoint(self):<br>
> + (angle,len) = self.sticks['TORSO']<br>
> + x,y = self.middle<br>
> + (rx,ry) = self._getpoints(x,y,angle,int(len/2.0))<br>
> + return (rx,ry)<br>
> +<br>
> + def inrotate(self, x, y):<br>
> + rx, ry = self.getrotatepoint()<br>
> + if (abs(rx-x) <= 5) and (abs(ry-y) <= 5):<br>
> + return True<br>
> + return False<br>
> +<br>
> + def injoint(self, x, y):<br>
> + for jname in self.joints:<br>
> + jx, jy = self.joints[jname]<br>
> + if (abs(jx-x) <= 5) and (abs(jy-y) <= 5):<br>
> + return jname<br>
> + return False<br>
> +<br>
> + def inmiddle(self, x, y):<br>
> + mx, my = self.middle<br>
> + if (abs(mx-x) <= 5) and (abs(my-y) <= 5):<br>
> + return True<br>
> + return False<br>
> +<br>
> + def move(self, dx, dy):<br>
> + if self.joints:<br>
> + for jname in self.joints:<br>
> + (jx, jy) = self.joints[jname]<br>
> + self.joints[jname] = (jx+dx, jy+dy)<br>
> --<br>
> 1.7.5.4<br>
><br>
</div></div>> _______________________________________________<br>
> Dextrose mailing list<br>
> <a href="mailto:Dextrose@lists.sugarlabs.org">Dextrose@lists.sugarlabs.org</a><br>
> <a href="http://lists.sugarlabs.org/listinfo/dextrose" target="_blank">http://lists.sugarlabs.org/listinfo/dextrose</a><br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
--<br>
Anish | <a href="mailto:anish@sugarlabs.org">anish@sugarlabs.org</a><br>
</font></span></blockquote></div><br>