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:
-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