@@ -69,10 +69,10 @@ def __init__(self, root_group, *, am_pm=True):
6969
7070 def load_data (self , election_data ):
7171 try :
72- self .electioncal = json .loads (election_data )
73- self .state_text .text = self .electioncal ["dates" ][1 ]["county" ] + ", " + self .electioncal ["dates" ][0 ]["state" ]
72+ self .electioncal = json .loads (election_data ) # pylint: disable=attribute-defined-outside-init
73+ self .state_text .text = self .electioncal ["dates" ][1 ]["county" ] + ", " + self .electioncal ["dates" ][0 ]["state" ] # pylint: disable=line-too-long
7474 except ValueError :
75- print ("Error loading JSON data: Please check the configuration of county and state, in code.py" )
75+ print ("Error loading JSON data: Please check the configuration of county and state, in code.py" ) # pylint: disable=line-too-long
7676 raise
7777
7878 def elections_cycle (self ):
@@ -83,7 +83,7 @@ def elections_cycle(self):
8383 if self .date_text .text [10 :] < self .electioncal ["dates" ][i ]["date" ]:
8484 self .election_date_text .text = self .electioncal ["dates" ][i ]["date" ]
8585 # splitting the line at around 40 chars seems ok for regular PyPortal
86- self .election_name_text_line2 .text , self .election_name_text .text = self .paragrapher (self .electioncal ["dates" ][i ]["name" ], 40 )
86+ self .election_name_text_line2 .text , self .election_name_text .text = self .paragrapher (self .electioncal ["dates" ][i ]["name" ], 40 ) # pylint: disable=line-too-long
8787 time .sleep (30 )
8888
8989 def update_time (self ):
@@ -104,11 +104,11 @@ def update_time(self):
104104 time_format_str = time_format_str + " AM"
105105 if hour == 0 :
106106 hour = 12
107- time_str = time_format_str % (hour , minute )
107+ time_str = time_format_str % (hour , minute ) # pylint: disable=unused-variable
108108 date_str = date_format_str % (year , month , day )
109109 self .date_text .text = "Today is: " + date_str
110110
111- def paragrapher (self , text , cut ):
111+ def paragrapher (self , text , cut ): # pylint: disable=no-self-use
112112 """ Cuts a long line into two, having spaces in mind.
113113 Note we return line2 first as it looks better to clear the line2
114114 before printing a line1 with empty line2
0 commit comments