Skip to content

Commit

Permalink
reads map_usage file
Browse files Browse the repository at this point in the history
  • Loading branch information
acutesoftware committed Feb 16, 2017
1 parent b62987c commit 0656f9d
Showing 1 changed file with 53 additions and 4 deletions.
57 changes: 53 additions & 4 deletions aikif/agents/aggregate/agent_pcusage.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,62 @@

class PCUsageAgent(agt.Agent):
"""
agent that explores a world (2D grid)
agent to process raw PC usage data
"""
def __init__(self, name, fldr, running, LOG_LEVEL):
#agt.Agent.__init__(self, *arg)
agt.Agent.__init__(self, name, fldr, running)
self.LOG_LEVEL = LOG_LEVEL
self.num_steps = 0
self.num_climbs = 0


def process_file(self, fname, map_object):
"""
takes a raw PC usage file and uses the MapUsage
instance to aggregate.
"""
pass


class MapUsage(object):
"""
reads a mapping file of raw PC Usage strings to
classify what user was doing. Useful for aggregate
of time spent on applications and work/life balance
and for measuring billable hours.
"""

def __init__(self, fname):
"""
reads the mapping file used by this agent to
process the raw data.
"""
self.maps = []
cur_line = []
cur_map = {}

with open(fname, 'r') as fip:
for line in fip:
if line != '':
cur_line = line.split(',')
self.maps.append(cur_line)




def process_line(self, line):
"""
takes a single line of data from logged PC usage
and returns the mapped application name, project,
and classification.
"""

res_app = ''
res_proj = ''
res_clas = ''


return res_app, res_proj, res_clas



0 comments on commit 0656f9d

Please sign in to comment.