Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
denvaar committed Dec 11, 2015
1 parent 1f6a7a9 commit 0bb8825
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 35 deletions.
4 changes: 2 additions & 2 deletions src/controllers/Mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ def isTimeToRun(self):
delta = lastUpdate + datetime.timedelta(seconds=period)
print "Due:", delta
if startDate > now:
logger.debug("Not beginning until %s" % startDate)
logger.info("Not beginning until %s" % startDate)
return False
if delta <= now:
self.recordLastUpdate(now)
return True
else:
logger.debug("Not running until %s" % delta)
logger.info("Not running until %s" % delta)
return False

def recordLastUpdate(self, time):
Expand Down
1 change: 1 addition & 0 deletions src/handlers/csvHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ def byteReader(self, filepath, start_byte, datecol, header=0, sep=None, dataBegi
logger.debug(finished_data)
else:
logger.info('No new data.')
return df

# NOTE: took this out: skiprows=(dataBegin - 1),
columnHeadings = pd.read_csv(filepath, header=(header - 1), sep=sep, nrows=1)
Expand Down
36 changes: 3 additions & 33 deletions src/wizard/controller/frmDataConfigPanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def getInput(self):

for k,v in self.inputDict['Mappings'].iteritems():
#print v
print "values",v
v['IntendedTimeSpacing'] = self.spinTimeSpacing.GetValue()
i = self.choiceUnitID.GetSelection()
unitID = self.timeUnits[str(self.choiceUnitID.GetString(i))]
Expand All @@ -108,28 +109,6 @@ def getInput(self):

return self.inputDict

"""
def setInput(self, data):
# Update the list control only if the new data is different.
if cmp(self.prev_data, data) != 0:
try:
for i in range(0, self.m_listCtrl1.GetNumberCols()):
if str(self.m_listCtrl1.GetColLabelValue(i))\
in self.inputDict['Mappings'].keys():
self.m_listCtrl1.SetColLabelRenderer(\
i,
MyColLabelRenderer('#50c061'))
else:
self.m_listCtrl1.SetColLabelRenderer(\
i,
MyColLabelRenderer(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND)))
self.m_listCtrl1.Refresh()
except KeyError:
pass
# Important to make a deep copy, or else
# data gets changed.
self.prev_data = deepcopy(data)
"""

def setInput(self, data):
"""
Expand Down Expand Up @@ -175,6 +154,7 @@ def setInputMappingList(self, existingData, read):
with any mappings that already exist *and*
match the variables from the configuration file.
"""
# Determine if any mappings exist.
try:
existingData["Mappings"]
except KeyError:
Expand Down Expand Up @@ -337,7 +317,7 @@ def runSeriesSelectDialog(self):
dlg = SeriesSelectDialog(self,
variable=self.selectedColumn,
database=self.parent.db)
dlg.CenterOnParent()
#dlg.CenterOnParent()
if dlg.ShowModal() == wx.ID_OK:
dlg.selectedResult.variableName = self.selectedColumn
#print dlg.selectedResult.variableNameCV
Expand All @@ -350,16 +330,6 @@ def runSeriesSelectDialog(self):
'ResultID':int(dlg.selectedResult.resultID),
'LastByteRead':0,
'CalculateAggInterval':'false'}})
#if "Mappings" not in self.inputDict.keys():
# self.inputDict.update({'Mappings':{}})

#if self.selectedColumn not in \
#self.inputDict["Mappings"].keys():
# self.inputDict['Mappings'].update(\
# {str(self.selectedColumn):{\
# 'ResultID':int(dlg.selectedResult.resultID),
# 'LastByteRead':0,
# 'CalculateAggInterval':'false'}})

#pprint.pprint(self.inputDict)
for m in self.m_listCtrl3.GetObjects():
Expand Down

0 comments on commit 0bb8825

Please sign in to comment.