Skip to content

Commit

Permalink
some refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan Carlos Delgado committed Jan 28, 2015
1 parent 1124fc7 commit 5b96b62
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions queue_read.py
Expand Up @@ -4,10 +4,11 @@
FILE_NAME = settings.QUEUE_FILE_NAME
READ_MODE = "r"
FILE_MODE = READ_MODE
READ_DELAY = 5

def readQueue():
"""
Read file and return Array of lines
Read file and return Array of tuples (lines)
"""
f = open(FILE_NAME, FILE_MODE)
lines = [getTrueData(line) for line in f]
Expand All @@ -20,7 +21,7 @@ def readQueue():

def getTrueData(line):
"""
Input: line ['1111timestamp','value']
Input: line "1111timestamp, value\n"
Return 2 values: timestamp, measure
"""
formated_line = line.strip().replace(" ","")
Expand All @@ -45,6 +46,8 @@ def removeLines(num):
print "measure:", m
print "==================================="

# Remove read lines
removeLines(len_lines)

print;print;print;print
sleep(5)
sleep(READ_DELAY)

0 comments on commit 5b96b62

Please sign in to comment.