[openrtm-staff:1349] 12/14の作業報告(河内)

河内のぶ n.kawauchi @ aist.go.jp
2017年 12月 14日 (木) 18:54:22 JST


安藤様

河内です

本日の作業内容をお知らせします。
------------
■omniORB+omniORBpy+Python3.6.3のビルド
・Jenkinsジョブでの確認 ・・・OK!
・昨日のエラーはPythonのパスを設定したら解決
・自分のVM環境はPythonのパスを通しているが、Jenkinsで使うVM環境は
 パスを通していない
・ジョブのビルド用スクリプトに1行追加
-----
set PYTHON_DIR=/cygdrive/c/Python36
set PATH=c:\Python36;%PATH% ←★追加
echo VC_VERSION: %VC_VERSION%
echo ARCH: %ARCH%
build.bat
-----
・Python2.7の時は★の設定が無くてもビルドが通る
・2.7と3.6.3は同じbuild.batを使っており、とりあえず★設定はbuild.bat
 には含めていない

■OpenRTM-aist-Python + Python3.6.3でのマージモジュール作成を目指す
・上記のジョブでアップロードした下記zipファイルを使う
omniORB-4.2.2-win32-vc141-py36.zip
omniORB-4.2.2-win64-vc141-py36.zip

・マージモジュール作成時の共通スクリプトwxsmaker.pyのPython3対応
・os.path.walkが廃止されたため、以下のエラーになる
AttributeError: module 'ntpath' has no attribute 'walk'

・Python3では、os.walkを使用する。
 これに伴い、下記部分を書き換えるための調査中。
-----
    def visitor(self, arg, dirname, names):
        self.set_curr_node(dirname)
        dirs, files = self.dirs_and_files(dirname, names)
        tmp = self.curr_node
        # component element
        if len(files) != 0:
            self.append_component(dirname, names)
        self.insert_direlements(files)
        # file elements
        self.append_files(files)
        # removefile element (*.pyc)
        if self.is_py_exist:
            self.append_removefile(dirname)
        # directory elements
        self.curr_node = tmp
        for d in dirs:
            self.append_directory(d)

    def walk(self):
        os.path.walk(self.target_dir, self.visitor, "hoge")
-----

・合わせて以下の対応も必要
AttributeError: 'dict' object has no attribute 'has_key'

    def set_curr_node(self, dirname):
        if self.dirlist.has_key(dirname): ←★
            self.curr_node = self.dirlist[dirname]
        else:
            sys.stderr.write("Unknown directory name %s. Aborting." % (dirname))
            sys.exit(-1)

・修正したが不十分で動作がおかしい状態
・ソースを読み直す予定

▼参考サイト
https://docs.python.jp/2.7/library/os.html#os.walk
https://torina.top/detail/267/
https://mail.python.org/pipermail/python-3000/2008-May/013583.html
https://stackoverflow.com/questions/33727149/dict-object-has-no-attribute-has-key

以上です。

---------------------------------------------------
河内 のぶ  n.kawauchi @ aist.go.jp
産業技術総合研究所 ロボットイノベーション研究センター
ロボットソフトウエアプラットフォーム研究チーム
テクニカルスタッフ



More information about the openrtm-staff mailing list