Skip to content
This repository was archived by the owner on Dec 4, 2021. It is now read-only.

Commit 3f201d5

Browse files
authored
server returns which printer was used instead of printed (#61)
1 parent a404723 commit 3f201d5

3 files changed

Lines changed: 15 additions & 14 deletions

File tree

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
"test": "mocha ./test/client"
99
},
1010
"dependencies": {
11-
"@grpc/proto-loader": "^0.5.3",
11+
"@grpc/proto-loader": "^0.5.5",
1212
"axios": "^0.19.2",
1313
"cors": "^2.8.5",
1414
"express": "^4.17.1",
15-
"google-protobuf": "^3.11.4",
16-
"grpc": "^1.24.2",
15+
"google-protobuf": "^3.12.4",
16+
"grpc": "^1.24.3",
1717
"http": "0.0.1-security"
1818
},
1919
"devDependencies": {

server/printing/printing_server.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ def SendRequestToPrinter(self, encoded_file, copies=1, options={}):
3232
else:
3333
command += "-o " + str(current_option) + "="\
3434
+ str(options[current_option]) + " "
35-
command += "-d " + self.DeterminePrinterForJob(copies) + " "
35+
chosenPrinter = self.DeterminePrinterForJob(copies)
36+
command += "-d " + chosenPrinter + " "
3637
command += "tmp.pdf"
3738
status = os.popen(command)
3839
os.remove("tmp.pdf")
39-
return 'printed' if status else 'error'
40+
return chosenPrinter if status else 'error'
4041

4142
def PrintPage(self, request, context):
4243
response = print_pb2.PrintResponse()

0 commit comments

Comments
 (0)