Skip to content

Commit

Permalink
fixed some scripts for python3
Browse files Browse the repository at this point in the history
  • Loading branch information
ban-masa committed Mar 16, 2023
1 parent 6749740 commit 27b8efb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions euscollada/scripts/add_sensor_to_collada.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import xml.dom
import yaml
import argparse
import importlib

reload(sys)
sys.setdefaultencoding('utf-8')
importlib.reload(sys)

from parseColladaBase import parseXmlBase
from parseColladaBase import yamlParser
Expand Down Expand Up @@ -47,7 +47,7 @@
sys.stderr.write('no configuration file !\n')

if args.output:
f = open(args.output, 'wb')
f = open(args.output, 'w')
obj.writeDocument(f)
f.close()
else:
Expand Down
8 changes: 4 additions & 4 deletions euscollada/scripts/parseColladaBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

import tf

reload(sys)
sys.setdefaultencoding('utf-8')
import importlib
importlib.reload(sys)

#### >>> copied from xacro/src/xacro.py
# Better pretty printing of xml
Expand All @@ -22,7 +22,7 @@ def fixed_writexml(self, writer, indent="", addindent="", newl=""):

attrs = self._get_attributes()
a_names = attrs.keys()
a_names.sort()
sorted(a_names)

for a_name in a_names:
writer.write(" %s=\"" % a_name)
Expand Down Expand Up @@ -115,7 +115,7 @@ def parseTranslate (self, translate):
def parseRotate (self, rotate):
if not rotate:
return '0 0 1 0'
if isinstance(rotate, basestring):
if isinstance(rotate, str):
rotate = self.StringToList(rotate)
q = tf.transformations.quaternion_about_axis(math.radians(rotate[3]), rotate[:3])
rpy = tf.transformations.euler_from_quaternion(q)
Expand Down
4 changes: 2 additions & 2 deletions euscollada/scripts/replace_library_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from xml.dom.minidom import parse, parseString
import xml.dom

reload(sys)
sys.setdefaultencoding('utf-8')
import importlib
importlib.reload(sys)

from parseColladaBase import replaceLibraryNode

Expand Down

0 comments on commit 27b8efb

Please sign in to comment.