Skip to content

Commit

Permalink
fix metaclass conflict; add general and chapter-specific requirements…
Browse files Browse the repository at this point in the history
….txt
  • Loading branch information
Michael Beyeler committed Nov 30, 2016
1 parent 16c183d commit f7fe25f
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 17 deletions.
10 changes: 6 additions & 4 deletions chapter1/gui.py
Expand Up @@ -13,7 +13,11 @@
__license__ = "GNU GPL 3.0 or later"


class BaseLayout(wx.Frame):
class Meta1(wx.Frame):
pass


class BaseLayout(Meta1):
"""Abstract base class for all layouts
A custom layout needs to implement at least three methods:
Expand Down Expand Up @@ -81,13 +85,12 @@ def _init_base_layout(self):
"""
# set up periodic screen capture
self.timer = wx.Timer(self)
self.timer.Start(1000./self.fps)
self.timer.Start(1000. / self.fps)
self.Bind(wx.EVT_TIMER, self._on_next_frame)

# allow for custom modifications
self._init_custom_layout()


def _create_base_layout(self):
"""Create generic layout
Expand Down Expand Up @@ -117,7 +120,6 @@ def _create_base_layout(self):
self.SetSizer(self.panels_vertical)
self.Centre()


def _on_next_frame(self, event):
"""
This method captures a new frame from the camera (or capture
Expand Down
2 changes: 2 additions & 0 deletions chapter1/requirements.txt
@@ -0,0 +1,2 @@
wx
scipy
10 changes: 6 additions & 4 deletions chapter2/gui.py
Expand Up @@ -13,7 +13,11 @@
__license__ = "GNU GPL 3.0 or later"


class BaseLayout(wx.Frame):
class Meta1(wx.Frame):
pass


class BaseLayout(Meta1):
"""Abstract base class for all layouts
A custom layout needs to implement at least three methods:
Expand Down Expand Up @@ -81,13 +85,12 @@ def _init_base_layout(self):
"""
# set up periodic screen capture
self.timer = wx.Timer(self)
self.timer.Start(1000./self.fps)
self.timer.Start(1000. / self.fps)
self.Bind(wx.EVT_TIMER, self._on_next_frame)

# allow for custom modifications
self._init_custom_layout()


def _create_base_layout(self):
"""Create generic layout
Expand Down Expand Up @@ -117,7 +120,6 @@ def _create_base_layout(self):
self.SetSizer(self.panels_vertical)
self.Centre()


def _on_next_frame(self, event):
"""
This method captures a new frame from the camera (or capture
Expand Down
2 changes: 2 additions & 0 deletions chapter2/requirements.txt
@@ -0,0 +1,2 @@
wx
freenect
4 changes: 3 additions & 1 deletion chapter3/gui.py
Expand Up @@ -12,8 +12,10 @@
__author__ = "Michael Beyeler"
__license__ = "GNU GPL 3.0 or later"

class Meta1(wx.Frame):
pass

class BaseLayout(wx.Frame):
class BaseLayout(Meta1):
"""Abstract base class for all layouts
A custom layout needs to implement at least three methods:
Expand Down
1 change: 1 addition & 0 deletions chapter3/requirements.txt
@@ -0,0 +1 @@
wx
10 changes: 6 additions & 4 deletions chapter4/gui.py
Expand Up @@ -13,7 +13,11 @@
__license__ = "GNU GPL 3.0 or later"


class BaseLayout(wx.Frame):
class Meta1(wx.Frame):
pass


class BaseLayout(Meta1):
"""Abstract base class for all layouts
A custom layout needs to implement at least three methods:
Expand Down Expand Up @@ -81,13 +85,12 @@ def _init_base_layout(self):
"""
# set up periodic screen capture
self.timer = wx.Timer(self)
self.timer.Start(1000./self.fps)
self.timer.Start(1000. / self.fps)
self.Bind(wx.EVT_TIMER, self._on_next_frame)

# allow for custom modifications
self._init_custom_layout()


def _create_base_layout(self):
"""Create generic layout
Expand Down Expand Up @@ -117,7 +120,6 @@ def _create_base_layout(self):
self.SetSizer(self.panels_vertical)
self.Centre()


def _on_next_frame(self, event):
"""
This method captures a new frame from the camera (or capture
Expand Down
2 changes: 2 additions & 0 deletions chapter4/requirements.txt
@@ -0,0 +1,2 @@
wx
matplotlib
1 change: 1 addition & 0 deletions chapter5/requirements.txt
@@ -0,0 +1 @@
matplotlib
1 change: 1 addition & 0 deletions chapter6/requirements.txt
@@ -0,0 +1 @@
matplotlib
10 changes: 6 additions & 4 deletions chapter7/gui.py
Expand Up @@ -13,7 +13,11 @@
__license__ = "GNU GPL 3.0 or later"


class BaseLayout(wx.Frame):
class Meta1(wx.Frame):
pass


class BaseLayout(Meta1):
"""Abstract base class for all layouts
A custom layout needs to implement at least three methods:
Expand Down Expand Up @@ -81,13 +85,12 @@ def _init_base_layout(self):
"""
# set up periodic screen capture
self.timer = wx.Timer(self)
self.timer.Start(1000./self.fps)
self.timer.Start(1000. / self.fps)
self.Bind(wx.EVT_TIMER, self._on_next_frame)

# allow for custom modifications
self._init_custom_layout()


def _create_base_layout(self):
"""Create generic layout
Expand Down Expand Up @@ -117,7 +120,6 @@ def _create_base_layout(self):
self.SetSizer(self.panels_vertical)
self.Centre()


def _on_next_frame(self, event):
"""
This method captures a new frame from the camera (or capture
Expand Down
1 change: 1 addition & 0 deletions chapter7/requirements.txt
@@ -0,0 +1 @@
wx
2 changes: 2 additions & 0 deletions requirements.txt
@@ -0,0 +1,2 @@
cv2
numpy

1 comment on commit f7fe25f

@AlmitraB
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I have this error with chapter 2 / gui.py: ValueError: Invalid data buffer size. Could you help me please ?

Please sign in to comment.