Skip to content

Commit

Permalink
tab removal from python files
Browse files Browse the repository at this point in the history
  • Loading branch information
rene-dev committed May 9, 2020
1 parent e36c334 commit 93fbd22
Show file tree
Hide file tree
Showing 16 changed files with 87 additions and 90 deletions.
2 changes: 1 addition & 1 deletion configs/sim/axis/remap/getting-started/python/oword.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ def pydevd(self,*args):
def mysub(self, *args):
print "number of parameters passed:", len(args)
for a in args:
print a
print a
22 changes: 11 additions & 11 deletions docs/src/checklinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def do_a(self, attrs):
if self.encoding:
href = href.decode(self.encoding)
href = urllib.unquote(href)
self.refs.add(href)
self.refs.add(href)

class get_anchors(sgmllib.SGMLParser, MetaHandler):
entitydefs = htmlentitydefs.entitydefs
Expand Down Expand Up @@ -67,16 +67,16 @@ def do_a(self, attrs):
_anchors = {}
def get_anchors_cached(filename):
if filename not in _anchors:
a = get_anchors()
a.feed(open(filename).read())
_anchors[filename] = a.anchors
a = get_anchors()
a.feed(open(filename).read())
_anchors[filename] = a.anchors
return _anchors[filename]

def resolve_file(src, target):
if "#" in target:
a, b = target.split("#", 1)
a, b = target.split("#", 1)
else:
a, b = target, None
a, b = target, None

a = a or src

Expand All @@ -99,13 +99,13 @@ def resolve(target, anchor):
for r in refs:
target, anchor = resolve_file(ref, r)
if targets and not target in targets:
unlisted_targets.add(target)
unlisted_targets.add(target)
elif not os.path.exists(target):
missing_file.add(r)
missing_file.add(r)
elif not resolve(target, anchor):
missing_anchor.add(r)
missing_anchor.add(r)
else:
good.add(r)
good.add(r)

if missing_file:
print "Files linked to in %s but could not be found:" % (
Expand All @@ -120,7 +120,7 @@ def resolve(target, anchor):
if unlisted_targets:
print "Links to files not listed as targets:"
for i in sorted(unlisted_targets):
print "\t%r" % i
print "\t%r" % i
print "If all link targets are not listed in the Submakefile, then the results of this program is unreliable."
print "Good links: %d/%d" % (len(good), len(refs))
if missing_anchor or missing_file or unlisted_targets:
Expand Down
18 changes: 9 additions & 9 deletions docs/src/links_db_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
strip = sys.argv[1]

for f in sys.argv[2:]:
base = os.path.splitext(f)[0]
if base.startswith(strip):
base = base[len(strip):]
for l in open(f):
l = l.strip().replace(' ', '_')
if not l:
continue
d[l] = base
base = os.path.splitext(f)[0]
if base.startswith(strip):
base = base[len(strip):]
for l in open(f):
l = l.strip().replace(' ', '_')
if not l:
continue
d[l] = base
for k, v in list(d.items()):
print('%s\t%s' % (k, v))
print('%s\t%s' % (k, v))
3 changes: 1 addition & 2 deletions docs/src/mkpre.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ def substall(s, r):

def mkpre(s):
msubst = [('\\', '\\\\'), (' ', '\\ ')]
hsubst = [('&', '&amp;'), ('<', '&lt;'), ('>', '&gt;'),
(' ', ' &nbsp;'), ('\n', '<BR>'), ('\\', '&#92;')]
hsubst = [('&', '&amp;'), ('<', '&lt;'), ('>', '&gt;'),(' ', ' &nbsp;'), ('\n', '<BR>'), ('\\', '&#92;')]

h = "".join(s)
print(".ie '\\*[.T]'html' .HTML <PRE>%s</PRE>" % substall(h, hsubst))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ def gcode(self,s, data = None):
return -1
return 0

def ocode(self,s, data = None):
def ocode(self,s, data = None):
self.command.mdi(s)
self.stat.poll()
while self.stat.exec_state == 7 or self.stat.exec_state == 3 :
Expand Down
2 changes: 1 addition & 1 deletion lib/python/gladevcp/drowidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def main():
else:
print("cancel")

if __name__ == "__main__":
if __name__ == "__main__":
main()


2 changes: 1 addition & 1 deletion lib/python/gladevcp/offsetwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def main():
else:
print("cancel")

if __name__ == "__main__":
if __name__ == "__main__":
main()


2 changes: 1 addition & 1 deletion lib/python/gladevcp/overridewidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,6 @@ def main():
else:
print("cancel")

if __name__ == "__main__":
if __name__ == "__main__":
main()

2 changes: 1 addition & 1 deletion lib/python/gladevcp/state_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,5 @@ def main():
else:
print("cancel")

if __name__ == "__main__":
if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion lib/python/gladevcp/status_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,5 @@ def main():
else:
print("cancel")

if __name__ == "__main__":
if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion lib/python/qtvcp/plugins/status_label_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def __init__(self, widget, parent = None):
tab = QtWidgets.QTabWidget()
self.tab1 = QtWidgets.QWidget()
self.tab2 = QtWidgets.QWidget()

tab.addTab(self.tab1,'Actions')
self.buildtab1()

Expand Down
106 changes: 53 additions & 53 deletions nc_files/holecircle.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,42 +106,42 @@ def trace(*args):
("units", lambda f, v: optionmenu(f, v, _("G20 (in)"), _("G21 (mm)"))),
("cx", floatentry),
("cy", floatentry),
("th0", floatentry),
("inc", floatentry),
("rad", posfloatentry),
("count", posintentry),
("feedrate", posfloatentry),
("depth", floatentry),
("dwell", posfloatentry),
("retract", floatentry),
("th0", floatentry),
("inc", floatentry),
("rad", posfloatentry),
("count", posintentry),
("feedrate", posfloatentry),
("depth", floatentry),
("dwell", posfloatentry),
("retract", floatentry),
]

defaults = dict(
cx = 0,
cy = 0,
th0 = 0,
inc = 15,
count = 6,
feedrate = 8,
depth=-.1,
retract=.1,
units=0,
dwell=0,
rad=1
cx = 0,
cy = 0,
th0 = 0,
inc = 15,
count = 6,
feedrate = 8,
depth=-.1,
retract=.1,
units=0,
dwell=0,
rad=1
)

texts = dict(
units=_("Units"),
rad=_("Radius"),
cx=_("Center X"),
cy=_("Center Y"),
th0=_("Start Angle"),
inc=_("Increment Angle"),
count=_("Hole Count"),
feedrate=_("Feed Rate"),
depth=_("Hole Depth"),
retract=_("Retract Height"),
dwell=("Dwell (0=no dwell)"),
rad=_("Radius"),
cx=_("Center X"),
cy=_("Center Y"),
th0=_("Start Angle"),
inc=_("Increment Angle"),
count=_("Hole Count"),
feedrate=_("Feed Rate"),
depth=_("Hole Depth"),
retract=_("Retract Height"),
dwell=("Dwell (0=no dwell)"),
)

try:
Expand All @@ -159,31 +159,31 @@ def trace(*args):
widgets[k].grid(row=j, column=1, sticky="ew")

def update_preview(*args):
prev.delete("all")
try:
count = vars['count'].get()
th0 = vars['th0'].get()
inc = vars['inc'].get()
except ValueError: return
for i in range(count):
th = (th0 + i * inc) * math.pi / 180
x = 100 + 75 * math.cos(th)
y = 100 - 75 * math.sin(th)
prev.create_oval((x-4,y-4,x+4,y+4), fill='black')
prev.delete("all")
try:
count = vars['count'].get()
th0 = vars['th0'].get()
inc = vars['inc'].get()
except ValueError: return
for i in range(count):
th = (th0 + i * inc) * math.pi / 180
x = 100 + 75 * math.cos(th)
y = 100 - 75 * math.sin(th)
prev.create_oval((x-4,y-4,x+4,y+4), fill='black')

def update_ok(*args):
result = True
for i in vars.values():
try:
i.get()
except ValueError:
result = False
break
if result: bb.configure(state="normal")
else: bb.configure(state="disabled")
# This line creates an error when you load holecircle twice
# from inside linuxcnc eg. gladevcp filechooser or AXIS GUI
#print >>sys.stderr, "update_ok", args
result = True
for i in vars.values():
try:
i.get()
except ValueError:
result = False
break
if result: bb.configure(state="normal")
else: bb.configure(state="disabled")
# This line creates an error when you load holecircle twice
# from inside linuxcnc eg. gladevcp filechooser or AXIS GUI
#print >>sys.stderr, "update_ok", args

vars['count'].trace('w', update_preview)
vars['inc'].trace('w', update_preview)
Expand All @@ -210,7 +210,7 @@ def update_ok(*args):
app.wait_variable(status)

if status.get() == -1:
raise SystemExit(1)
raise SystemExit(1)

for k, v in vars.items():
defaults[k] = v.get()
Expand Down
2 changes: 1 addition & 1 deletion src/emc/usr_intf/axis/makeicon.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
icon = icon.encode("hex")
print "icon = ("
for i in range(0, len(icon), 72):
print repr(icon[i:i+72])
print repr(icon[i:i+72])
print ").decode('hex')"
4 changes: 2 additions & 2 deletions src/emc/usr_intf/axis/scripts/lintini.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ def report_problem(msg, *args):


def get_int(section, key):
return int(ini.find(section, key).split()[0])
return int(ini.find(section, key).split()[0])
def get_float(section, key):
return float(ini.find(section, key).split()[0])
return float(ini.find(section, key).split()[0])

if ini.find("EMCMOT", "BASE_PERIOD") is None:
period = 0.
Expand Down
3 changes: 1 addition & 2 deletions src/emc/usr_intf/gremlin/gremlin.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,7 @@ def realize(self, widget):
return
self._current_file = None

self.font_base, width, linespace = \
glnav.use_pango_font('courier bold 16', 0, 128)
self.font_base, width, linespace = glnav.use_pango_font('courier bold 16', 0, 128)
self.font_linespace = linespace
self.font_charwidth = width
rs274.glcanon.GlCanonDraw.realize(self)
Expand Down
3 changes: 1 addition & 2 deletions src/emc/usr_intf/gremlin/qt5_graphics.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,7 @@ def realize(self):
return
self._current_file = None

self.font_base, width, linespace = \
glnav.use_pango_font('courier bold 16', 0, 128)
self.font_base, width, linespace = glnav.use_pango_font('courier bold 16', 0, 128)
self.font_linespace = linespace
self.font_charwidth = width
glcanon.GlCanonDraw.realize(self)
Expand Down

0 comments on commit 93fbd22

Please sign in to comment.