Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Read printer ID from file

  • Loading branch information...
commit d0068aab19cbc550d493fe0a03db4998d27af8d7 1 parent 4959c01
@andrewn authored
Showing with 10 additions and 1 deletion.
  1. +3 −0  .gitignore
  2. +7 −1 printer.py
View
3  .gitignore
@@ -12,6 +12,9 @@ test/tmp
test/version_tmp
tmp
+#
+PRINTER_ID
+
# YARD artifacts
.yardoc
_yardoc
View
8 printer.py
@@ -11,8 +11,13 @@
printerHost = "http://printer.gofreerange.com:80"
+def readFileContents(filepath):
+ with open(filepath,'r') as f:
+ output = f.read()
+ return output
+
def getPrinterId():
- return "1234abc"
+ return readFileContents('PRINTER_ID')
def initSettings():
print "init settings"
@@ -48,6 +53,7 @@ def sendToPrinter(f):
printer.write(b)
printer.flush()
+
initSettings()
initPrinter()
print printerId
Please sign in to comment.
Something went wrong with that request. Please try again.