"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "EmailReminder/Event.py" between
email-reminder-0.8.0.tar.gz and email-reminder-0.8.1.tar.gz

About: Email-Reminder lets define events to be reminded of by email via cronjob (with GUI).

Event.py  (email-reminder-0.8.0):Event.py  (email-reminder-0.8.1)
skipping to change at line 23 skipping to change at line 23
# GNU Affero General Public License for more details. # GNU Affero General Public License for more details.
# #
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
from PySide2.QtCore import ( from PySide2.QtCore import (
Qt, QAbstractTableModel, QModelIndex) Qt, QAbstractTableModel, QModelIndex)
from EmailReminder.Utils import readXMLValue, writeXMLValue from EmailReminder.Utils import readXMLValue, writeXMLValue
def parseDay(dayString, lastDay): def parseDay(dayString, lastDay):
day = int(dayString) try:
day = int(dayString)
except ValueError:
return 1
if day < 1: if day < 1:
return 1 return 1
if day > lastDay: if day > lastDay:
return lastDay return lastDay
return day return day
class EventModel(QAbstractTableModel): class EventModel(QAbstractTableModel):
TYPE = 'event' TYPE = 'event'
skipping to change at line 92 skipping to change at line 95
def getDataInternal(self, column, row): def getDataInternal(self, column, row):
if column == 0: if column == 0:
return readXMLValue(self.events[row], 'name') return readXMLValue(self.events[row], 'name')
return None return None
def data(self, index, role=Qt.DisplayRole): def data(self, index, role=Qt.DisplayRole):
column = index.column() column = index.column()
row = index.row() row = index.row()
if role == Qt.DisplayRole or role == Qt.EditRole: if role in (Qt.DisplayRole, Qt.EditRole):
return self.getDataInternal(column, row) return self.getDataInternal(column, row)
return None return None
def flags(self, index): def flags(self, index):
# pylint: disable=unused-argument,no-self-use # pylint: disable=unused-argument,no-self-use
return Qt.ItemIsEditable | Qt.ItemIsEnabled | Qt.ItemIsSelectable return Qt.ItemIsEditable | Qt.ItemIsEnabled | Qt.ItemIsSelectable
def getReminders(self, row): def getReminders(self, row):
sameDay = False sameDay = False
 End of changes. 2 change blocks. 
2 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)