Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kliment/Printrun.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkliment <kliment.yanev@gmail.com>2021-02-05 16:27:26 +0300
committerGitHub <noreply@github.com>2021-02-05 16:27:26 +0300
commitb4647b59083ce0216205f4ae069524177091e222 (patch)
tree407bbe9aa5747033f05606207232c6dfafa5b925
parent5d0ec6d25dd67fc51afccf028d4e77606ec81900 (diff)
parentd1c09af6fdbc56296c67b80993e5c327d8213286 (diff)
Merge pull request #1163 from volconst/fix-runSmallScript
Fix printcore.runSmallScript
-rw-r--r--printrun/printcore.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/printrun/printcore.py b/printrun/printcore.py
index ea209a7..eaa774d 100644
--- a/printrun/printcore.py
+++ b/printrun/printcore.py
@@ -514,13 +514,12 @@ class printcore():
# run a simple script if it exists, no multithreading
def runSmallScript(self, filename):
- if filename is None: return
- f = None
+ if not filename: return
try:
with open(filename) as f:
for i in f:
l = i.replace("\n", "")
- l = l[:l.find(";")] # remove comments
+ l = l.partition(';')[0] # remove comments
self.send_now(l)
except:
pass