Commit 667ccb1c authored by Ana Guerrero López's avatar Ana Guerrero López

Update to use wxpython3.0. Patch by Olly Betts. (Closes: #758955)

parent 1256dd36
cycle (0.3.1-10) unstable; urgency=medium
* Update to use wxpython3.0. Patch by Olly Betts. (Closes: #758955)
* Update cycle depends from python-wxgtk2.8 to python-wxgtk3.0.
* Bump to Standards-Version 3.9.5, no changes required.
-- Ana Beatriz Guerrero Lopez <ana@debian.org> Sun, 07 Sep 2014 16:44:56 +0200
cycle (0.3.1-9) unstable; urgency=low
[ Emilio Pozuelo Monfort ]
......
......@@ -5,14 +5,14 @@ Maintainer: Ana Beatriz Guerrero Lopez <ana@debian.org>
Uploaders: Miriam Ruiz <miriam@debian.org>, Python Applications Team <python-apps-team@lists.alioth.debian.org>
Build-Depends-Indep: python (>= 2.3), gettext
Build-Depends: debhelper (>= 9)
Standards-Version: 3.9.4
Standards-Version: 3.9.5
Vcs-Svn: svn://anonscm.debian.org/python-apps/packages/cycle/trunk/
Vcs-Browser: http://anonscm.debian.org/viewvc/python-apps/packages/cycle/trunk/
Homepage: http://cycle.sourceforge.net/
Package: cycle
Architecture: all
Depends: python (>= 2.3), ${misc:Depends}, python-wxgtk2.8
Depends: python (>= 2.3), ${misc:Depends}, python-wxgtk3.0
Description: calendar program for women
Cycle is a calendar for women. Given a cycle length or statistics for
several periods, it can calculate the days until menstruation, the days
......
Description: Update for wxPython 3.0
These changes should remain compatible with wxPython 2.8.
Bug-Debian: https://bugs.debian.org/758955
Forwarded: no
Last-Update: 2014-09-07
Index: cycle-0.3.1/cal_year.py
===================================================================
--- cycle-0.3.1.orig/cal_year.py
+++ cycle-0.3.1/cal_year.py
@@ -28,11 +28,11 @@ MARK_T22_28 = 1<<10 #tablets 22-28 or pa
MARK_NEXT_TABLET = 1<<11
#-------------------- class Month_Cal -------------------
-class Month_Cal(wx.calendar.CalendarCtrl):
+class Month_Cal(wx.calendar.GenericCalendarCtrl):
def __init__(self, parent, id, dt, pos=wx.DefaultPosition,
size=wx.DefaultSize, style=0 ):
- style = wx.calendar.CAL_NO_YEAR_CHANGE | wx.calendar.CAL_NO_MONTH_CHANGE | wx.NO_BORDER
+ style = wx.calendar.CAL_NO_MONTH_CHANGE | wx.NO_BORDER
if cycle.first_week_day==0:
style = style | wx.calendar.CAL_MONDAY_FIRST
else:
@@ -42,7 +42,7 @@ class Month_Cal(wx.calendar.CalendarCtrl
except NameError:
pass
- wx.calendar.CalendarCtrl.__init__(self, parent, id, dt, pos, size, style)
+ wx.calendar.GenericCalendarCtrl.__init__(self, parent, id, dt, pos, size, style)
self.SetBackgroundColour(wx.WHITE)
self.SetHeaderColours(wx.BLACK,wx.WHITE)
if '__WXMSW__' in wx.PlatformInfo:
@@ -139,8 +139,8 @@ class Month_Cal(wx.calendar.CalendarCtrl
def OnKey(self, event):
k=event.GetKeyCode()
- if k==WXK_LEFT or k==WXK_RIGHT or \
- k==WXK_UP or k==WXK_DOWN:
+ if k==wx.WXK_LEFT or k==wx.WXK_RIGHT or \
+ k==wx.WXK_UP or k==wx.WXK_DOWN:
pass
else:
event.Skip()
@@ -208,10 +208,8 @@ class Cal_Year(wx.ScrolledWindow):
Val.frame.SetTitle(cycle.name+" - "+str(self.year))
for m in range(12):
t=wx.DateTimeFromDMY(1, m, self.year)
- self.month[m].EnableYearChange(True)
self.month[m].EnableMonthChange(True)
self.month[m].SetDate(t)
- self.month[m].EnableYearChange(False)
self.month[m].EnableMonthChange(False)
self.month[m].Refresh()
@@ -234,15 +232,8 @@ class Cal_Year(wx.ScrolledWindow):
for d in range(1,wx.DateTime_GetNumberOfDaysInMonth(m, self.year)+1):
can_hide=True
lab=cycle.mark.get(k,0)
- at=self.month[m].GetAttr(d)
- if at is None :
- at=wx.calendar.CalendarDateAttr(wx.BLACK)
- self.month[m].SetAttr(d,at)
-
- # reset attributes
- at.SetBorder(wx.calendar.CAL_BORDER_NONE)
+ at=wx.calendar.CalendarDateAttr(wx.BLACK)
at.SetBackgroundColour(wx.WHITE)
- at.SetTextColour(wx.BLACK)
at.SetFont(f_norm)
dt=wx.DateTimeFromDMY(d, m, self.year)
@@ -297,6 +288,8 @@ class Cal_Year(wx.ScrolledWindow):
self.month[m].SetHighlightColours(at.GetTextColour(),
at.GetBackgroundColour())
+ self.month[m].SetAttr(d,at)
+
k+=1
# so visual refresh is more fast
Index: cycle-0.3.1/cycle.py
===================================================================
--- cycle-0.3.1.orig/cycle.py
+++ cycle-0.3.1/cycle.py
@@ -10,7 +10,7 @@ import os, sys, gettext
import locale
import wxversion
-wxversion.ensureMinimal('2.5.3')
+wxversion.ensureMinimal('2.8')
import wx
import wx.html
import wx.lib.colourdb
@@ -69,7 +69,6 @@ class MyFrame(wx.Frame):
wx.Frame.__init__(self, parent, ID, title,
wx.DefaultPosition, wx.Size(800, 600))
- wx.Image_AddHandler(wx.PNGHandler())
# self.printer = wx.HtmlEasyPrinting()
icon = wx.Icon(os.path.join(icons_dir,'mini/cycle.xpm'), wx.BITMAP_TYPE_XPM)
self.SetIcon(icon)
@@ -142,7 +141,7 @@ class MyFrame(wx.Frame):
def Export(self, event):
dlg = wx.FileDialog(self, _("Export to iCal"),
- style=wx.SAVE)
+ style=wx.FD_SAVE)
if dlg.ShowModal() == wx.ID_OK:
try:
......@@ -8,3 +8,4 @@
06a_save_load.patch
06b_enter_your_name.patch
07_wxpython3.0.patch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment