Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Read printer ID from file

  • Loading branch information...
commit d0068aab19cbc550d493fe0a03db4998d27af8d7 1 parent 4959c01
Andrew Nicolaou authored

Showing 2 changed files with 10 additions and 1 deletion. Show diff stats Hide diff stats

  1. +3 0  .gitignore
  2. +7 1 printer.py
3  .gitignore
@@ -12,6 +12,9 @@ test/tmp
12 12 test/version_tmp
13 13 tmp
14 14
  15 +#
  16 +PRINTER_ID
  17 +
15 18 # YARD artifacts
16 19 .yardoc
17 20 _yardoc
8 printer.py
@@ -11,8 +11,13 @@
11 11
12 12 printerHost = "http://printer.gofreerange.com:80"
13 13
  14 +def readFileContents(filepath):
  15 + with open(filepath,'r') as f:
  16 + output = f.read()
  17 + return output
  18 +
14 19 def getPrinterId():
15   - return "1234abc"
  20 + return readFileContents('PRINTER_ID')
16 21
17 22 def initSettings():
18 23 print "init settings"
@@ -48,6 +53,7 @@ def sendToPrinter(f):
48 53 printer.write(b)
49 54 printer.flush()
50 55
  56 +
51 57 initSettings()
52 58 initPrinter()
53 59 print printerId

0 comments on commit d0068aa

Please sign in to comment.
Something went wrong with that request. Please try again.