Browse Source

update template

master
Nils 3 years ago
parent
commit
2afb1c22e1
  1. 8
      template/helper.py
  2. 2
      template/qtgui/debugScript.py

8
template/helper.py

@ -27,6 +27,14 @@ from functools import lru_cache #https://docs.python.org/3.4/library/functools.h
cache_unlimited = lru_cache(maxsize=None)
#use as @cache_unlimited decorator
def dictdiff(a, b):
"""We use dicts for internal export packages. Compare two of them for changes"""
result = {}
for key, value in a.items():
if not b[key] == value:
result[key] = (value, b[key])
return result
import itertools
def pairwise(iterable):
"s -> (s0,s1), (s1,s2), (s2, s3), ..."

2
template/qtgui/debugScript.py

@ -39,9 +39,11 @@ class DebugScriptRunner(object):
assert nsmClient
self.nsmClient = nsmClient
self.absoluteScriptFilePath = os.path.join(self.nsmClient.ourPath, "debugscript.py")
logger.info(f"{self.nsmClient.ourClientNameUnderNSM}: Using script file: {self.absoluteScriptFilePath}")
def _createEmptyDebugScript(self):
assert self.absoluteScriptFilePath
print(f"{self.nsmClient.ourClientNameUnderNSM}: Script file not found. Initializing: {self.absoluteScriptFilePath}")
logger.info(f"{self.nsmClient.ourClientNameUnderNSM}: Script file not found. Initializing: {self.absoluteScriptFilePath}")
text = ("""#! /usr/bin/env python3"""
"\n"

Loading…
Cancel
Save