Revert "upgrade to python 3.x" 45/274445/1
authorWei Zhang <wei625.zhang@samsung.com>
Thu, 28 Apr 2022 10:27:46 +0000 (10:27 +0000)
committerWei Zhang <wei625.zhang@samsung.com>
Thu, 28 Apr 2022 10:27:46 +0000 (10:27 +0000)
This reverts commit e336b104310c58c2184340190102b66fbb269e96.

Change-Id: Id515dcdeaea4a66631a71d5490beb00d53adfc4a

857 files changed:
common/tct-2dtransforms-css3-tests/inst.apk.py
common/tct-2dtransforms-css3-tests/inst.wgt.py
common/tct-2dtransforms-css3-tests/inst.xpk.py
common/tct-2dtransforms-css3-tests/pack.py
common/tct-3dtransforms-css3-tests/inst.apk.py
common/tct-3dtransforms-css3-tests/inst.wgt.py
common/tct-3dtransforms-css3-tests/inst.xpk.py
common/tct-3dtransforms-css3-tests/pack.py
common/tct-ResponsiveImage-w3c-tests/inst.apk.py
common/tct-ResponsiveImage-w3c-tests/inst.wgt.py
common/tct-ResponsiveImage-w3c-tests/inst.xpk.py
common/tct-ResponsiveImage-w3c-tests/pack.py
common/tct-account-tizen-tests/inst.apk.py
common/tct-account-tizen-tests/inst.wgt.py
common/tct-account-tizen-tests/inst.xpk.py
common/tct-account-tizen-tests/pack.py
common/tct-alarm-tizen-tests/inst.apk.py
common/tct-alarm-tizen-tests/inst.wgt.py
common/tct-alarm-tizen-tests/inst.xpk.py
common/tct-alarm-tizen-tests/pack.py
common/tct-animations-css3-tests/inst.apk.py
common/tct-animations-css3-tests/inst.wgt.py
common/tct-animations-css3-tests/inst.xpk.py
common/tct-animations-css3-tests/pack.py
common/tct-animationtiming-w3c-tests/inst.apk.py
common/tct-animationtiming-w3c-tests/inst.wgt.py
common/tct-animationtiming-w3c-tests/inst.xpk.py
common/tct-animationtiming-w3c-tests/pack.py
common/tct-appcache-html5-tests/inst.apk.py
common/tct-appcache-html5-tests/inst.wgt.py
common/tct-appcache-html5-tests/inst.xpk.py
common/tct-appcache-html5-tests/pack.py
common/tct-appcontrol-tizen-tests/inst.apk.py
common/tct-appcontrol-tizen-tests/inst.wgt.py
common/tct-appcontrol-tizen-tests/inst.xpk.py
common/tct-appcontrol-tizen-tests/pack.py
common/tct-application-tizen-tests/inst.apk.py
common/tct-application-tizen-tests/inst.wgt.py
common/tct-application-tizen-tests/inst.xpk.py
common/tct-application-tizen-tests/pack.py
common/tct-archive-tizen-tests/inst.apk.py
common/tct-archive-tizen-tests/inst.wgt.py
common/tct-archive-tizen-tests/inst.xpk.py
common/tct-archive-tizen-tests/pack.py
common/tct-audio-html5-tests/inst.apk.py
common/tct-audio-html5-tests/inst.wgt.py
common/tct-audio-html5-tests/inst.xpk.py
common/tct-audio-html5-tests/pack.py
common/tct-backgrounds-css3-tests/inst.apk.py
common/tct-backgrounds-css3-tests/inst.wgt.py
common/tct-backgrounds-css3-tests/inst.xpk.py
common/tct-backgrounds-css3-tests/pack.py
common/tct-badge-tizen-tests/inst.apk.py
common/tct-badge-tizen-tests/inst.wgt.py
common/tct-badge-tizen-tests/inst.xpk.py
common/tct-badge-tizen-tests/pack.py
common/tct-batterystatus-w3c-tests/inst.apk.py
common/tct-batterystatus-w3c-tests/inst.wgt.py
common/tct-batterystatus-w3c-tests/inst.xpk.py
common/tct-batterystatus-w3c-tests/pack.py
common/tct-beacon-w3c-tests/inst.apk.py
common/tct-beacon-w3c-tests/inst.wgt.py
common/tct-beacon-w3c-tests/inst.xpk.py
common/tct-beacon-w3c-tests/pack.py
common/tct-bluetooth-tizen-tests/inst.apk.py
common/tct-bluetooth-tizen-tests/inst.wgt.py
common/tct-bluetooth-tizen-tests/inst.xpk.py
common/tct-bluetooth-tizen-tests/pack.py
common/tct-browserstate-html5-tests/inst.apk.py
common/tct-browserstate-html5-tests/inst.wgt.py
common/tct-browserstate-html5-tests/inst.xpk.py
common/tct-browserstate-html5-tests/pack.py
common/tct-calendar-tizen-tests/inst.apk.py
common/tct-calendar-tizen-tests/inst.wgt.py
common/tct-calendar-tizen-tests/inst.xpk.py
common/tct-calendar-tizen-tests/pack.py
common/tct-callhistory-tizen-tests/inst.apk.py
common/tct-callhistory-tizen-tests/inst.wgt.py
common/tct-callhistory-tizen-tests/inst.xpk.py
common/tct-callhistory-tizen-tests/pack.py
common/tct-canvas-html5-tests/inst.apk.py
common/tct-canvas-html5-tests/inst.wgt.py
common/tct-canvas-html5-tests/inst.xpk.py
common/tct-canvas-html5-tests/pack.py
common/tct-colors-css3-tests/inst.apk.py
common/tct-colors-css3-tests/inst.wgt.py
common/tct-colors-css3-tests/inst.xpk.py
common/tct-colors-css3-tests/pack.py
common/tct-contact-tizen-tests/inst.apk.py
common/tct-contact-tizen-tests/inst.wgt.py
common/tct-contact-tizen-tests/inst.xpk.py
common/tct-contact-tizen-tests/pack.py
common/tct-content-tizen-tests/inst.apk.py
common/tct-content-tizen-tests/inst.wgt.py
common/tct-content-tizen-tests/inst.xpk.py
common/tct-content-tizen-tests/pack.py
common/tct-convergence-tizen-tests/inst.apk.py
common/tct-convergence-tizen-tests/inst.wgt.py
common/tct-convergence-tizen-tests/inst.xpk.py
common/tct-convergence-tizen-tests/pack.py
common/tct-cors-w3c-tests/inst.apk.py
common/tct-cors-w3c-tests/inst.wgt.py
common/tct-cors-w3c-tests/inst.xpk.py
common/tct-cors-w3c-tests/pack.py
common/tct-crypto-w3c-tests/inst.apk.py
common/tct-crypto-w3c-tests/inst.wgt.py
common/tct-crypto-w3c-tests/inst.xpk.py
common/tct-crypto-w3c-tests/pack.py
common/tct-csp-w3c-tests/inst.apk.py
common/tct-csp-w3c-tests/inst.wgt.py
common/tct-csp-w3c-tests/inst.xpk.py
common/tct-csp-w3c-tests/pack.py
common/tct-customelement-w3c-tests/inst.apk.py
common/tct-customelement-w3c-tests/inst.wgt.py
common/tct-customelement-w3c-tests/inst.xpk.py
common/tct-customelement-w3c-tests/pack.py
common/tct-datacontrol-tizen-tests/inst.apk.py
common/tct-datacontrol-tizen-tests/inst.wgt.py
common/tct-datacontrol-tizen-tests/inst.xpk.py
common/tct-datacontrol-tizen-tests/pack.py
common/tct-device-cordova-tests/inst.apk.py
common/tct-device-cordova-tests/inst.wgt.py
common/tct-device-cordova-tests/inst.xpk.py
common/tct-device-cordova-tests/pack.py
common/tct-devicemotion-cordova-tests/inst.apk.py
common/tct-devicemotion-cordova-tests/inst.wgt.py
common/tct-devicemotion-cordova-tests/inst.xpk.py
common/tct-devicemotion-cordova-tests/pack.py
common/tct-deviceorientation-w3c-tests/inst.apk.py
common/tct-deviceorientation-w3c-tests/inst.wgt.py
common/tct-deviceorientation-w3c-tests/inst.xpk.py
common/tct-deviceorientation-w3c-tests/pack.py
common/tct-dialogs-cordova-tests/inst.apk.py
common/tct-dialogs-cordova-tests/inst.wgt.py
common/tct-dialogs-cordova-tests/inst.xpk.py
common/tct-dialogs-cordova-tests/pack.py
common/tct-dnd-html5-tests/inst.apk.py
common/tct-dnd-html5-tests/inst.wgt.py
common/tct-dnd-html5-tests/inst.xpk.py
common/tct-dnd-html5-tests/pack.py
common/tct-download-tizen-tests/inst.apk.py
common/tct-download-tizen-tests/inst.wgt.py
common/tct-download-tizen-tests/inst.xpk.py
common/tct-download-tizen-tests/pack.py
common/tct-events-cordova-tests/inst.apk.py
common/tct-events-cordova-tests/inst.wgt.py
common/tct-events-cordova-tests/inst.xpk.py
common/tct-events-cordova-tests/pack.py
common/tct-events-cordova-tests/tests.xml
common/tct-exif-tizen-tests/inst.apk.py
common/tct-exif-tizen-tests/inst.wgt.py
common/tct-exif-tizen-tests/inst.xpk.py
common/tct-exif-tizen-tests/pack.py
common/tct-extra-html5-tests/inst.apk.py
common/tct-extra-html5-tests/inst.wgt.py
common/tct-extra-html5-tests/inst.xpk.py
common/tct-extra-html5-tests/pack.py
common/tct-feedback-tizen-tests/inst.apk.py
common/tct-feedback-tizen-tests/inst.wgt.py
common/tct-feedback-tizen-tests/inst.xpk.py
common/tct-feedback-tizen-tests/pack.py
common/tct-file-cordova-tests/inst.apk.py
common/tct-file-cordova-tests/inst.wgt.py
common/tct-file-cordova-tests/inst.xpk.py
common/tct-file-cordova-tests/pack.py
common/tct-file-transfer-cordova-tests/inst.apk.py
common/tct-file-transfer-cordova-tests/inst.wgt.py
common/tct-file-transfer-cordova-tests/inst.xpk.py
common/tct-file-transfer-cordova-tests/pack.py
common/tct-fileapi-w3c-tests/inst.apk.py
common/tct-fileapi-w3c-tests/inst.wgt.py
common/tct-fileapi-w3c-tests/inst.xpk.py
common/tct-fileapi-w3c-tests/pack.py
common/tct-filesystem-tizen-tests/inst.apk.py
common/tct-filesystem-tizen-tests/inst.wgt.py
common/tct-filesystem-tizen-tests/inst.xpk.py
common/tct-filesystem-tizen-tests/pack.py
common/tct-flexiblebox-css3-tests/inst.apk.py
common/tct-flexiblebox-css3-tests/inst.wgt.py
common/tct-flexiblebox-css3-tests/inst.xpk.py
common/tct-flexiblebox-css3-tests/pack.py
common/tct-fmradio-tizen-tests/inst.apk.py
common/tct-fmradio-tizen-tests/inst.wgt.py
common/tct-fmradio-tizen-tests/inst.xpk.py
common/tct-fmradio-tizen-tests/pack.py
common/tct-fonts-css3-tests/inst.apk.py
common/tct-fonts-css3-tests/inst.wgt.py
common/tct-fonts-css3-tests/inst.xpk.py
common/tct-fonts-css3-tests/pack.py
common/tct-forms-html5-tests/inst.apk.py
common/tct-forms-html5-tests/inst.wgt.py
common/tct-forms-html5-tests/inst.xpk.py
common/tct-forms-html5-tests/pack.py
common/tct-fullscreen-nonw3c-tests/inst.apk.py
common/tct-fullscreen-nonw3c-tests/inst.wgt.py
common/tct-fullscreen-nonw3c-tests/inst.xpk.py
common/tct-fullscreen-nonw3c-tests/pack.py
common/tct-geoallow-w3c-tests/inst.apk.py
common/tct-geoallow-w3c-tests/inst.wgt.py
common/tct-geoallow-w3c-tests/inst.xpk.py
common/tct-geoallow-w3c-tests/pack.py
common/tct-geodeny-w3c-tests/inst.apk.py
common/tct-geodeny-w3c-tests/inst.wgt.py
common/tct-geodeny-w3c-tests/inst.xpk.py
common/tct-geodeny-w3c-tests/pack.py
common/tct-globalization-cordova-tests/inst.apk.py
common/tct-globalization-cordova-tests/inst.wgt.py
common/tct-globalization-cordova-tests/inst.xpk.py
common/tct-globalization-cordova-tests/pack.py
common/tct-gumallow-w3c-tests/inst.apk.py
common/tct-gumallow-w3c-tests/inst.wgt.py
common/tct-gumallow-w3c-tests/inst.xpk.py
common/tct-gumallow-w3c-tests/pack.py
common/tct-humanactivitymonitor-tizen-tests/inst.apk.py
common/tct-humanactivitymonitor-tizen-tests/inst.wgt.py
common/tct-humanactivitymonitor-tizen-tests/inst.xpk.py
common/tct-humanactivitymonitor-tizen-tests/pack.py
common/tct-ime-tizen-tests/inst.apk.py
common/tct-ime-tizen-tests/inst.wgt.py
common/tct-ime-tizen-tests/inst.xpk.py
common/tct-ime-tizen-tests/pack.py
common/tct-indexeddb-w3c-tests/inst.apk.py
common/tct-indexeddb-w3c-tests/inst.wgt.py
common/tct-indexeddb-w3c-tests/inst.xpk.py
common/tct-indexeddb-w3c-tests/pack.py
common/tct-inputdevice-tizen-tests/inst.apk.py
common/tct-inputdevice-tizen-tests/inst.wgt.py
common/tct-inputdevice-tizen-tests/inst.xpk.py
common/tct-inputdevice-tizen-tests/pack.py
common/tct-iotcon-tizen-tests/inst.apk.py
common/tct-iotcon-tizen-tests/inst.wgt.py
common/tct-iotcon-tizen-tests/inst.xpk.py
common/tct-iotcon-tizen-tests/pack.py
common/tct-jsenhance-html5-tests/inst.apk.py
common/tct-jsenhance-html5-tests/inst.wgt.py
common/tct-jsenhance-html5-tests/inst.xpk.py
common/tct-jsenhance-html5-tests/pack.py
common/tct-keymanager-tizen-tests/inst.apk.py
common/tct-keymanager-tizen-tests/inst.wgt.py
common/tct-keymanager-tizen-tests/inst.xpk.py
common/tct-keymanager-tizen-tests/pack.py
common/tct-media-cordova-tests/inst.apk.py
common/tct-media-cordova-tests/inst.wgt.py
common/tct-media-cordova-tests/inst.xpk.py
common/tct-media-cordova-tests/pack.py
common/tct-mediacapture-w3c-tests/inst.apk.py
common/tct-mediacapture-w3c-tests/inst.wgt.py
common/tct-mediacapture-w3c-tests/inst.xpk.py
common/tct-mediacapture-w3c-tests/pack.py
common/tct-mediacontroller-tizen-tests/inst.apk.py
common/tct-mediacontroller-tizen-tests/inst.wgt.py
common/tct-mediacontroller-tizen-tests/inst.xpk.py
common/tct-mediacontroller-tizen-tests/pack.py
common/tct-mediakey-tizen-tests/inst.apk.py
common/tct-mediakey-tizen-tests/inst.wgt.py
common/tct-mediakey-tizen-tests/inst.xpk.py
common/tct-mediakey-tizen-tests/pack.py
common/tct-mediaqueries-css3-tests/inst.apk.py
common/tct-mediaqueries-css3-tests/inst.wgt.py
common/tct-mediaqueries-css3-tests/inst.xpk.py
common/tct-mediaqueries-css3-tests/pack.py
common/tct-messageport-tizen-tests/inst.apk.py
common/tct-messageport-tizen-tests/inst.wgt.py
common/tct-messageport-tizen-tests/inst.xpk.py
common/tct-messageport-tizen-tests/pack.py
common/tct-messaging-email-tizen-tests/inst.apk.py
common/tct-messaging-email-tizen-tests/inst.wgt.py
common/tct-messaging-email-tizen-tests/inst.xpk.py
common/tct-messaging-email-tizen-tests/pack.py
common/tct-messaging-mms-tizen-tests/inst.apk.py
common/tct-messaging-mms-tizen-tests/inst.wgt.py
common/tct-messaging-mms-tizen-tests/inst.xpk.py
common/tct-messaging-mms-tizen-tests/pack.py
common/tct-messaging-sms-tizen-tests/inst.apk.py
common/tct-messaging-sms-tizen-tests/inst.wgt.py
common/tct-messaging-sms-tizen-tests/inst.xpk.py
common/tct-messaging-sms-tizen-tests/pack.py
common/tct-metadata-tizen-tests/inst.apk.py
common/tct-metadata-tizen-tests/inst.wgt.py
common/tct-metadata-tizen-tests/inst.xpk.py
common/tct-metadata-tizen-tests/pack.py
common/tct-ml-tizen-tests/inst.apk.py
common/tct-ml-tizen-tests/inst.wgt.py
common/tct-ml-tizen-tests/inst.xpk.py
common/tct-ml-tizen-tests/pack.py
common/tct-mlpipeline-tizen-tests/inst.apk.py
common/tct-mlpipeline-tizen-tests/inst.wgt.py
common/tct-mlpipeline-tizen-tests/inst.xpk.py
common/tct-mlpipeline-tizen-tests/pack.py
common/tct-mlsingleshot-tizen-tests/inst.apk.py
common/tct-mlsingleshot-tizen-tests/inst.wgt.py
common/tct-mlsingleshot-tizen-tests/inst.xpk.py
common/tct-mlsingleshot-tizen-tests/pack.py
common/tct-mse-w3c-tests/inst.apk.py
common/tct-mse-w3c-tests/inst.wgt.py
common/tct-mse-w3c-tests/inst.xpk.py
common/tct-mse-w3c-tests/pack.py
common/tct-multicolumn-css3-tests/inst.apk.py
common/tct-multicolumn-css3-tests/inst.wgt.py
common/tct-multicolumn-css3-tests/inst.xpk.py
common/tct-multicolumn-css3-tests/pack.py
common/tct-namespace-tizen-tests/inst.apk.py
common/tct-namespace-tizen-tests/inst.wgt.py
common/tct-namespace-tizen-tests/inst.xpk.py
common/tct-namespace-tizen-tests/pack.py
common/tct-navigationtiming-w3c-tests/inst.apk.py
common/tct-navigationtiming-w3c-tests/inst.wgt.py
common/tct-navigationtiming-w3c-tests/inst.xpk.py
common/tct-navigationtiming-w3c-tests/pack.py
common/tct-network-information-cordova-tests/inst.apk.py
common/tct-network-information-cordova-tests/inst.wgt.py
common/tct-network-information-cordova-tests/inst.xpk.py
common/tct-network-information-cordova-tests/pack.py
common/tct-networkbearerselection-tizen-tests/inst.apk.py
common/tct-networkbearerselection-tizen-tests/inst.wgt.py
common/tct-networkbearerselection-tizen-tests/inst.xpk.py
common/tct-networkbearerselection-tizen-tests/pack.py
common/tct-nfc-tizen-tests/inst.apk.py
common/tct-nfc-tizen-tests/inst.wgt.py
common/tct-nfc-tizen-tests/inst.xpk.py
common/tct-nfc-tizen-tests/pack.py
common/tct-notification-tizen-tests/inst.apk.py
common/tct-notification-tizen-tests/inst.wgt.py
common/tct-notification-tizen-tests/inst.xpk.py
common/tct-notification-tizen-tests/pack.py
common/tct-notification-w3c-tests/inst.apk.py
common/tct-notification-w3c-tests/inst.wgt.py
common/tct-notification-w3c-tests/inst.xpk.py
common/tct-notification-w3c-tests/pack.py
common/tct-package-tizen-tests/inst.apk.py
common/tct-package-tizen-tests/inst.wgt.py
common/tct-package-tizen-tests/inst.xpk.py
common/tct-package-tizen-tests/pack.py
common/tct-pagevisibility-w3c-tests/inst.apk.py
common/tct-pagevisibility-w3c-tests/inst.wgt.py
common/tct-pagevisibility-w3c-tests/inst.xpk.py
common/tct-pagevisibility-w3c-tests/pack.py
common/tct-playerutil-tizen-tests/inst.apk.py
common/tct-playerutil-tizen-tests/inst.wgt.py
common/tct-playerutil-tizen-tests/inst.xpk.py
common/tct-playerutil-tizen-tests/pack.py
common/tct-power-tizen-tests/inst.apk.py
common/tct-power-tizen-tests/inst.wgt.py
common/tct-power-tizen-tests/inst.xpk.py
common/tct-power-tizen-tests/pack.py
common/tct-preference-tizen-tests/inst.apk.py
common/tct-preference-tizen-tests/inst.wgt.py
common/tct-preference-tizen-tests/inst.xpk.py
common/tct-preference-tizen-tests/pack.py
common/tct-privacyprivilege-tizen-tests/inst.apk.py
common/tct-privacyprivilege-tizen-tests/inst.wgt.py
common/tct-privacyprivilege-tizen-tests/inst.xpk.py
common/tct-privacyprivilege-tizen-tests/pack.py
common/tct-privilege-tizen-tests/inst.apk.py
common/tct-privilege-tizen-tests/inst.wgt.py
common/tct-privilege-tizen-tests/inst.xpk.py
common/tct-privilege-tizen-tests/pack.py
common/tct-push-tizen-tests/inst.apk.py
common/tct-push-tizen-tests/inst.wgt.py
common/tct-push-tizen-tests/inst.xpk.py
common/tct-push-tizen-tests/pack.py
common/tct-push-w3c-tests/inst.apk.py
common/tct-push-w3c-tests/inst.wgt.py
common/tct-push-w3c-tests/inst.xpk.py
common/tct-push-w3c-tests/pack.py
common/tct-sandbox-html5-tests/inst.apk.py
common/tct-sandbox-html5-tests/inst.wgt.py
common/tct-sandbox-html5-tests/inst.xpk.py
common/tct-sandbox-html5-tests/pack.py
common/tct-screenorientation-w3c-tests/inst.apk.py
common/tct-screenorientation-w3c-tests/inst.wgt.py
common/tct-screenorientation-w3c-tests/inst.xpk.py
common/tct-screenorientation-w3c-tests/pack.py
common/tct-secureelement-tizen-tests/inst.apk.py
common/tct-secureelement-tizen-tests/inst.wgt.py
common/tct-secureelement-tizen-tests/inst.xpk.py
common/tct-secureelement-tizen-tests/pack.py
common/tct-security-tcs-tests/inst.apk.py
common/tct-security-tcs-tests/inst.wgt.py
common/tct-security-tcs-tests/inst.xpk.py
common/tct-security-tcs-tests/pack.py
common/tct-selectorslevel1-w3c-tests/inst.apk.py
common/tct-selectorslevel1-w3c-tests/inst.wgt.py
common/tct-selectorslevel1-w3c-tests/inst.xpk.py
common/tct-selectorslevel1-w3c-tests/pack.py
common/tct-selectorslevel2-w3c-tests/inst.apk.py
common/tct-selectorslevel2-w3c-tests/inst.wgt.py
common/tct-selectorslevel2-w3c-tests/inst.xpk.py
common/tct-selectorslevel2-w3c-tests/pack.py
common/tct-sensor-tizen-tests/inst.apk.py
common/tct-sensor-tizen-tests/inst.wgt.py
common/tct-sensor-tizen-tests/inst.xpk.py
common/tct-sensor-tizen-tests/pack.py
common/tct-serviceworkers-w3c-tests/inst.apk.py
common/tct-serviceworkers-w3c-tests/inst.wgt.py
common/tct-serviceworkers-w3c-tests/inst.xpk.py
common/tct-serviceworkers-w3c-tests/pack.py
common/tct-sessionhistory-html5-tests/inst.apk.py
common/tct-sessionhistory-html5-tests/inst.wgt.py
common/tct-sessionhistory-html5-tests/inst.xpk.py
common/tct-sessionhistory-html5-tests/pack.py
common/tct-sound-tizen-tests/inst.apk.py
common/tct-sound-tizen-tests/inst.wgt.py
common/tct-sound-tizen-tests/inst.xpk.py
common/tct-sound-tizen-tests/pack.py
common/tct-speech-w3c-tests/inst.apk.py
common/tct-speech-w3c-tests/inst.wgt.py
common/tct-speech-w3c-tests/inst.xpk.py
common/tct-speech-w3c-tests/pack.py
common/tct-sse-w3c-tests/inst.apk.py
common/tct-sse-w3c-tests/inst.wgt.py
common/tct-sse-w3c-tests/inst.xpk.py
common/tct-sse-w3c-tests/pack.py
common/tct-svg-html5-tests/inst.apk.py
common/tct-svg-html5-tests/inst.wgt.py
common/tct-svg-html5-tests/inst.xpk.py
common/tct-svg-html5-tests/pack.py
common/tct-systeminfo-tizen-tests/inst.apk.py
common/tct-systeminfo-tizen-tests/inst.wgt.py
common/tct-systeminfo-tizen-tests/inst.xpk.py
common/tct-systeminfo-tizen-tests/pack.py
common/tct-systemsetting-tizen-tests/inst.apk.py
common/tct-systemsetting-tizen-tests/inst.wgt.py
common/tct-systemsetting-tizen-tests/inst.xpk.py
common/tct-systemsetting-tizen-tests/pack.py
common/tct-template-w3c-tests/inst.apk.py
common/tct-template-w3c-tests/inst.wgt.py
common/tct-template-w3c-tests/inst.xpk.py
common/tct-template-w3c-tests/pack.py
common/tct-text-css3-tests/inst.apk.py
common/tct-text-css3-tests/inst.wgt.py
common/tct-text-css3-tests/inst.xpk.py
common/tct-text-css3-tests/pack.py
common/tct-time-tizen-tests/inst.apk.py
common/tct-time-tizen-tests/inst.wgt.py
common/tct-time-tizen-tests/inst.xpk.py
common/tct-time-tizen-tests/pack.py
common/tct-tizen-tizen-tests/inst.apk.py
common/tct-tizen-tizen-tests/inst.wgt.py
common/tct-tizen-tizen-tests/inst.xpk.py
common/tct-tizen-tizen-tests/pack.py
common/tct-touchevent-w3c-tests/inst.apk.py
common/tct-touchevent-w3c-tests/inst.wgt.py
common/tct-touchevent-w3c-tests/inst.xpk.py
common/tct-touchevent-w3c-tests/pack.py
common/tct-transitions-css3-tests/inst.apk.py
common/tct-transitions-css3-tests/inst.wgt.py
common/tct-transitions-css3-tests/inst.xpk.py
common/tct-transitions-css3-tests/pack.py
common/tct-tv-audiocontrol-tizen-tests/inst.apk.py
common/tct-tv-audiocontrol-tizen-tests/inst.wgt.py
common/tct-tv-audiocontrol-tizen-tests/inst.xpk.py
common/tct-tv-audiocontrol-tizen-tests/pack.py
common/tct-tv-channel-tizen-tests/inst.apk.py
common/tct-tv-channel-tizen-tests/inst.wgt.py
common/tct-tv-channel-tizen-tests/inst.xpk.py
common/tct-tv-channel-tizen-tests/pack.py
common/tct-tv-displaycontrol-tizen-tests/inst.apk.py
common/tct-tv-displaycontrol-tizen-tests/inst.wgt.py
common/tct-tv-displaycontrol-tizen-tests/inst.xpk.py
common/tct-tv-displaycontrol-tizen-tests/pack.py
common/tct-tv-info-tizen-tests/inst.apk.py
common/tct-tv-info-tizen-tests/inst.wgt.py
common/tct-tv-info-tizen-tests/inst.xpk.py
common/tct-tv-info-tizen-tests/pack.py
common/tct-tv-window-tizen-tests/inst.apk.py
common/tct-tv-window-tizen-tests/inst.wgt.py
common/tct-tv-window-tizen-tests/inst.xpk.py
common/tct-tv-window-tizen-tests/pack.py
common/tct-typedarrays-nonw3c-tests/inst.apk.py
common/tct-typedarrays-nonw3c-tests/inst.wgt.py
common/tct-typedarrays-nonw3c-tests/inst.xpk.py
common/tct-typedarrays-nonw3c-tests/pack.py
common/tct-ui-css3-tests/inst.apk.py
common/tct-ui-css3-tests/inst.wgt.py
common/tct-ui-css3-tests/inst.xpk.py
common/tct-ui-css3-tests/pack.py
common/tct-vibration-w3c-tests/inst.apk.py
common/tct-vibration-w3c-tests/inst.wgt.py
common/tct-vibration-w3c-tests/inst.xpk.py
common/tct-vibration-w3c-tests/pack.py
common/tct-video-html5-tests/inst.apk.py
common/tct-video-html5-tests/inst.wgt.py
common/tct-video-html5-tests/inst.xpk.py
common/tct-video-html5-tests/pack.py
common/tct-voicecontrol-tizen-tests/inst.apk.py
common/tct-voicecontrol-tizen-tests/inst.wgt.py
common/tct-voicecontrol-tizen-tests/inst.xpk.py
common/tct-voicecontrol-tizen-tests/pack.py
common/tct-webaudio-w3c-tests/inst.apk.py
common/tct-webaudio-w3c-tests/inst.wgt.py
common/tct-webaudio-w3c-tests/inst.xpk.py
common/tct-webaudio-w3c-tests/pack.py
common/tct-webgl-nonw3c-tests/inst.apk.py
common/tct-webgl-nonw3c-tests/inst.wgt.py
common/tct-webgl-nonw3c-tests/inst.xpk.py
common/tct-webgl-nonw3c-tests/pack.py
common/tct-webmessaging-w3c-tests/inst.apk.py
common/tct-webmessaging-w3c-tests/inst.wgt.py
common/tct-webmessaging-w3c-tests/inst.xpk.py
common/tct-webmessaging-w3c-tests/pack.py
common/tct-websetting-tizen-tests/inst.apk.py
common/tct-websetting-tizen-tests/inst.wgt.py
common/tct-websetting-tizen-tests/inst.xpk.py
common/tct-websetting-tizen-tests/pack.py
common/tct-websocket-w3c-tests/inst.apk.py
common/tct-websocket-w3c-tests/inst.wgt.py
common/tct-websocket-w3c-tests/inst.xpk.py
common/tct-websocket-w3c-tests/pack.py
common/tct-webstorage-w3c-tests/inst.apk.py
common/tct-webstorage-w3c-tests/inst.wgt.py
common/tct-webstorage-w3c-tests/inst.xpk.py
common/tct-webstorage-w3c-tests/pack.py
common/tct-webwidget-w3c-tests/inst.apk.py
common/tct-webwidget-w3c-tests/inst.wgt.py
common/tct-webwidget-w3c-tests/inst.xpk.py
common/tct-webwidget-w3c-tests/pack.py
common/tct-wgtapi01-w3c-tests/inst.apk.py
common/tct-wgtapi01-w3c-tests/inst.wgt.py
common/tct-wgtapi01-w3c-tests/inst.xpk.py
common/tct-wgtapi01-w3c-tests/pack.py
common/tct-wgtapi02-w3c-tests/inst.apk.py
common/tct-wgtapi02-w3c-tests/inst.wgt.py
common/tct-wgtapi02-w3c-tests/inst.xpk.py
common/tct-wgtapi02-w3c-tests/pack.py
common/tct-widget01-w3c-tests/inst.apk.py
common/tct-widget01-w3c-tests/inst.wgt.py
common/tct-widget01-w3c-tests/inst.xpk.py
common/tct-widget01-w3c-tests/pack.py
common/tct-widget02-w3c-tests/inst.apk.py
common/tct-widget02-w3c-tests/inst.wgt.py
common/tct-widget02-w3c-tests/inst.xpk.py
common/tct-widget02-w3c-tests/pack.py
common/tct-widgetpolicy-w3c-tests/inst.apk.py
common/tct-widgetpolicy-w3c-tests/inst.wgt.py
common/tct-widgetpolicy-w3c-tests/inst.xpk.py
common/tct-widgetpolicy-w3c-tests/pack.py
common/tct-widgetservice-tizen-tests/inst.apk.py
common/tct-widgetservice-tizen-tests/inst.wgt.py
common/tct-widgetservice-tizen-tests/inst.xpk.py
common/tct-widgetservice-tizen-tests/pack.py
common/tct-woff-w3c-tests/inst.apk.py
common/tct-woff-w3c-tests/inst.wgt.py
common/tct-woff-w3c-tests/inst.xpk.py
common/tct-woff-w3c-tests/pack.py
common/tct-workers-w3c-tests/inst.apk.py
common/tct-workers-w3c-tests/inst.wgt.py
common/tct-workers-w3c-tests/inst.xpk.py
common/tct-workers-w3c-tests/pack.py
common/tct-xmlhttprequest-w3c-tests/inst.apk.py
common/tct-xmlhttprequest-w3c-tests/inst.wgt.py
common/tct-xmlhttprequest-w3c-tests/inst.xpk.py
common/tct-xmlhttprequest-w3c-tests/pack.py
iot/tct-capability-tests/inst.apk.py
iot/tct-capability-tests/inst.wgt.py
iot/tct-capability-tests/inst.xpk.py
iot/tct-capability-tests/pack.py
iot/tct-deprecatedapi-tizen-tests/inst.apk.py
iot/tct-deprecatedapi-tizen-tests/inst.wgt.py
iot/tct-deprecatedapi-tizen-tests/inst.xpk.py
iot/tct-deprecatedapi-tizen-tests/pack.py
ivi/tct-2dtransforms-css3-tests/inst.apk.py
ivi/tct-2dtransforms-css3-tests/inst.wgt.py
ivi/tct-2dtransforms-css3-tests/inst.xpk.py
ivi/tct-3dtransforms-css3-tests/inst.apk.py
ivi/tct-3dtransforms-css3-tests/inst.wgt.py
ivi/tct-3dtransforms-css3-tests/inst.xpk.py
ivi/tct-alarm-tizen-tests/inst.apk.py
ivi/tct-alarm-tizen-tests/inst.wgt.py
ivi/tct-alarm-tizen-tests/inst.xpk.py
ivi/tct-animations-css3-tests/inst.apk.py
ivi/tct-animations-css3-tests/inst.wgt.py
ivi/tct-animations-css3-tests/inst.xpk.py
ivi/tct-animationtiming-w3c-tests/inst.apk.py
ivi/tct-animationtiming-w3c-tests/inst.wgt.py
ivi/tct-animationtiming-w3c-tests/inst.xpk.py
ivi/tct-appcache-html5-tests/inst.apk.py
ivi/tct-appcache-html5-tests/inst.wgt.py
ivi/tct-appcache-html5-tests/inst.xpk.py
ivi/tct-appcontrol-tizen-tests/inst.apk.py
ivi/tct-appcontrol-tizen-tests/inst.wgt.py
ivi/tct-appcontrol-tizen-tests/inst.xpk.py
ivi/tct-application-tizen-tests/inst.apk.py
ivi/tct-application-tizen-tests/inst.wgt.py
ivi/tct-application-tizen-tests/inst.xpk.py
ivi/tct-audio-html5-tests/inst.apk.py
ivi/tct-audio-html5-tests/inst.wgt.py
ivi/tct-audio-html5-tests/inst.xpk.py
ivi/tct-backgrounds-css3-tests/inst.apk.py
ivi/tct-backgrounds-css3-tests/inst.wgt.py
ivi/tct-backgrounds-css3-tests/inst.xpk.py
ivi/tct-bluetooth-tizen-tests/inst.apk.py
ivi/tct-bluetooth-tizen-tests/inst.wgt.py
ivi/tct-bluetooth-tizen-tests/inst.xpk.py
ivi/tct-bookmark-tizen-tests/inst.apk.py
ivi/tct-bookmark-tizen-tests/inst.wgt.py
ivi/tct-bookmark-tizen-tests/inst.xpk.py
ivi/tct-browserstate-html5-tests/inst.apk.py
ivi/tct-browserstate-html5-tests/inst.wgt.py
ivi/tct-browserstate-html5-tests/inst.xpk.py
ivi/tct-canvas-html5-tests/inst.apk.py
ivi/tct-canvas-html5-tests/inst.wgt.py
ivi/tct-canvas-html5-tests/inst.xpk.py
ivi/tct-capability-tests/inst.apk.py
ivi/tct-capability-tests/inst.wgt.py
ivi/tct-capability-tests/inst.xpk.py
ivi/tct-clipboard-w3c-tests/inst.apk.py
ivi/tct-clipboard-w3c-tests/inst.wgt.py
ivi/tct-clipboard-w3c-tests/inst.xpk.py
ivi/tct-colors-css3-tests/inst.apk.py
ivi/tct-colors-css3-tests/inst.wgt.py
ivi/tct-colors-css3-tests/inst.xpk.py
ivi/tct-content-tizen-tests/inst.apk.py
ivi/tct-content-tizen-tests/inst.wgt.py
ivi/tct-content-tizen-tests/inst.xpk.py
ivi/tct-cors-w3c-tests/inst.apk.py
ivi/tct-cors-w3c-tests/inst.wgt.py
ivi/tct-cors-w3c-tests/inst.xpk.py
ivi/tct-csp-w3c-tests/inst.apk.py
ivi/tct-csp-w3c-tests/inst.wgt.py
ivi/tct-csp-w3c-tests/inst.xpk.py
ivi/tct-dnd-html5-tests/inst.apk.py
ivi/tct-dnd-html5-tests/inst.wgt.py
ivi/tct-dnd-html5-tests/inst.xpk.py
ivi/tct-download-tizen-tests/inst.apk.py
ivi/tct-download-tizen-tests/inst.wgt.py
ivi/tct-download-tizen-tests/inst.xpk.py
ivi/tct-extra-html5-tests/inst.apk.py
ivi/tct-extra-html5-tests/inst.wgt.py
ivi/tct-extra-html5-tests/inst.xpk.py
ivi/tct-fileapi-w3c-tests/inst.apk.py
ivi/tct-fileapi-w3c-tests/inst.wgt.py
ivi/tct-fileapi-w3c-tests/inst.xpk.py
ivi/tct-filesystem-tizen-tests/inst.apk.py
ivi/tct-filesystem-tizen-tests/inst.wgt.py
ivi/tct-filesystem-tizen-tests/inst.xpk.py
ivi/tct-filesystemapi-w3c-tests/inst.apk.py
ivi/tct-filesystemapi-w3c-tests/inst.wgt.py
ivi/tct-filesystemapi-w3c-tests/inst.xpk.py
ivi/tct-filewriterapi-w3c-tests/inst.apk.py
ivi/tct-filewriterapi-w3c-tests/inst.wgt.py
ivi/tct-filewriterapi-w3c-tests/inst.xpk.py
ivi/tct-flexiblebox-css3-tests/inst.apk.py
ivi/tct-flexiblebox-css3-tests/inst.wgt.py
ivi/tct-flexiblebox-css3-tests/inst.xpk.py
ivi/tct-fonts-css3-tests/inst.apk.py
ivi/tct-fonts-css3-tests/inst.wgt.py
ivi/tct-fonts-css3-tests/inst.xpk.py
ivi/tct-forms-html5-tests/inst.apk.py
ivi/tct-forms-html5-tests/inst.wgt.py
ivi/tct-forms-html5-tests/inst.xpk.py
ivi/tct-fullscreen-nonw3c-tests/inst.apk.py
ivi/tct-fullscreen-nonw3c-tests/inst.wgt.py
ivi/tct-fullscreen-nonw3c-tests/inst.xpk.py
ivi/tct-geoallow-w3c-tests/inst.apk.py
ivi/tct-geoallow-w3c-tests/inst.wgt.py
ivi/tct-geoallow-w3c-tests/inst.xpk.py
ivi/tct-geodeny-w3c-tests/inst.apk.py
ivi/tct-geodeny-w3c-tests/inst.wgt.py
ivi/tct-geodeny-w3c-tests/inst.xpk.py
ivi/tct-getcapabilities/inst.apk.py
ivi/tct-getcapabilities/inst.wgt.py
ivi/tct-getcapabilities/inst.xpk.py
ivi/tct-gumallow-w3c-tests/inst.apk.py
ivi/tct-gumallow-w3c-tests/inst.wgt.py
ivi/tct-gumallow-w3c-tests/inst.xpk.py
ivi/tct-indexeddb-w3c-tests/inst.apk.py
ivi/tct-indexeddb-w3c-tests/inst.wgt.py
ivi/tct-indexeddb-w3c-tests/inst.xpk.py
ivi/tct-jsenhance-html5-tests/inst.apk.py
ivi/tct-jsenhance-html5-tests/inst.wgt.py
ivi/tct-jsenhance-html5-tests/inst.xpk.py
ivi/tct-mediaqueries-css3-tests/inst.apk.py
ivi/tct-mediaqueries-css3-tests/inst.wgt.py
ivi/tct-mediaqueries-css3-tests/inst.xpk.py
ivi/tct-messageport-tizen-tests/inst.apk.py
ivi/tct-messageport-tizen-tests/inst.wgt.py
ivi/tct-messageport-tizen-tests/inst.xpk.py
ivi/tct-multicolumn-css3-tests/inst.apk.py
ivi/tct-multicolumn-css3-tests/inst.wgt.py
ivi/tct-multicolumn-css3-tests/inst.xpk.py
ivi/tct-namespace-tizen-tests/inst.apk.py
ivi/tct-namespace-tizen-tests/inst.wgt.py
ivi/tct-namespace-tizen-tests/inst.xpk.py
ivi/tct-navigationtiming-w3c-tests/inst.apk.py
ivi/tct-navigationtiming-w3c-tests/inst.wgt.py
ivi/tct-navigationtiming-w3c-tests/inst.xpk.py
ivi/tct-notification-tizen-tests/inst.apk.py
ivi/tct-notification-tizen-tests/inst.wgt.py
ivi/tct-notification-tizen-tests/inst.xpk.py
ivi/tct-notification-w3c-tests/inst.apk.py
ivi/tct-notification-w3c-tests/inst.wgt.py
ivi/tct-notification-w3c-tests/inst.xpk.py
ivi/tct-package-tizen-tests/inst.apk.py
ivi/tct-package-tizen-tests/inst.wgt.py
ivi/tct-package-tizen-tests/inst.xpk.py
ivi/tct-pagevisibility-w3c-tests/inst.apk.py
ivi/tct-pagevisibility-w3c-tests/inst.wgt.py
ivi/tct-pagevisibility-w3c-tests/inst.xpk.py
ivi/tct-power-tizen-tests/inst.apk.py
ivi/tct-power-tizen-tests/inst.wgt.py
ivi/tct-power-tizen-tests/inst.xpk.py
ivi/tct-privilege-tizen-tests/inst.apk.py
ivi/tct-privilege-tizen-tests/inst.wgt.py
ivi/tct-privilege-tizen-tests/inst.xpk.py
ivi/tct-sandbox-html5-tests/inst.apk.py
ivi/tct-sandbox-html5-tests/inst.wgt.py
ivi/tct-sandbox-html5-tests/inst.xpk.py
ivi/tct-screenorientation-w3c-tests/inst.apk.py
ivi/tct-screenorientation-w3c-tests/inst.wgt.py
ivi/tct-screenorientation-w3c-tests/inst.xpk.py
ivi/tct-security-tcs-tests/inst.apk.py
ivi/tct-security-tcs-tests/inst.wgt.py
ivi/tct-security-tcs-tests/inst.xpk.py
ivi/tct-selectorslevel1-w3c-tests/inst.apk.py
ivi/tct-selectorslevel1-w3c-tests/inst.wgt.py
ivi/tct-selectorslevel1-w3c-tests/inst.xpk.py
ivi/tct-selectorslevel2-w3c-tests/inst.apk.py
ivi/tct-selectorslevel2-w3c-tests/inst.wgt.py
ivi/tct-selectorslevel2-w3c-tests/inst.xpk.py
ivi/tct-sessionhistory-html5-tests/inst.apk.py
ivi/tct-sessionhistory-html5-tests/inst.wgt.py
ivi/tct-sessionhistory-html5-tests/inst.xpk.py
ivi/tct-sse-w3c-tests/inst.apk.py
ivi/tct-sse-w3c-tests/inst.wgt.py
ivi/tct-sse-w3c-tests/inst.xpk.py
ivi/tct-svg-html5-tests/inst.apk.py
ivi/tct-svg-html5-tests/inst.wgt.py
ivi/tct-svg-html5-tests/inst.xpk.py
ivi/tct-systeminfo-tizen-tests/inst.apk.py
ivi/tct-systeminfo-tizen-tests/inst.wgt.py
ivi/tct-systeminfo-tizen-tests/inst.xpk.py
ivi/tct-systemsetting-tizen-tests/inst.apk.py
ivi/tct-systemsetting-tizen-tests/inst.wgt.py
ivi/tct-systemsetting-tizen-tests/inst.xpk.py
ivi/tct-testconfig/inst.apk.py
ivi/tct-testconfig/inst.wgt.py
ivi/tct-testconfig/inst.xpk.py
ivi/tct-time-tizen-tests/inst.apk.py
ivi/tct-time-tizen-tests/inst.wgt.py
ivi/tct-time-tizen-tests/inst.xpk.py
ivi/tct-tizen-tizen-tests/inst.apk.py
ivi/tct-tizen-tizen-tests/inst.wgt.py
ivi/tct-tizen-tizen-tests/inst.xpk.py
ivi/tct-touchevent-w3c-tests/inst.apk.py
ivi/tct-touchevent-w3c-tests/inst.wgt.py
ivi/tct-touchevent-w3c-tests/inst.xpk.py
ivi/tct-transitions-css3-tests/inst.apk.py
ivi/tct-transitions-css3-tests/inst.wgt.py
ivi/tct-transitions-css3-tests/inst.xpk.py
ivi/tct-typedarrays-nonw3c-tests/inst.apk.py
ivi/tct-typedarrays-nonw3c-tests/inst.wgt.py
ivi/tct-typedarrays-nonw3c-tests/inst.xpk.py
ivi/tct-ui-css3-tests/inst.apk.py
ivi/tct-ui-css3-tests/inst.wgt.py
ivi/tct-ui-css3-tests/inst.xpk.py
ivi/tct-video-html5-tests/inst.apk.py
ivi/tct-video-html5-tests/inst.wgt.py
ivi/tct-video-html5-tests/inst.xpk.py
ivi/tct-webaudio-w3c-tests/inst.apk.py
ivi/tct-webaudio-w3c-tests/inst.wgt.py
ivi/tct-webaudio-w3c-tests/inst.xpk.py
ivi/tct-webdatabase-w3c-tests/inst.apk.py
ivi/tct-webdatabase-w3c-tests/inst.wgt.py
ivi/tct-webdatabase-w3c-tests/inst.xpk.py
ivi/tct-webgl-nonw3c-tests/inst.apk.py
ivi/tct-webgl-nonw3c-tests/inst.wgt.py
ivi/tct-webgl-nonw3c-tests/inst.xpk.py
ivi/tct-webmessaging-w3c-tests/inst.apk.py
ivi/tct-webmessaging-w3c-tests/inst.wgt.py
ivi/tct-webmessaging-w3c-tests/inst.xpk.py
ivi/tct-websetting-tizen-tests/inst.apk.py
ivi/tct-websetting-tizen-tests/inst.wgt.py
ivi/tct-websetting-tizen-tests/inst.xpk.py
ivi/tct-websocket-w3c-tests/inst.apk.py
ivi/tct-websocket-w3c-tests/inst.wgt.py
ivi/tct-websocket-w3c-tests/inst.xpk.py
ivi/tct-webstorage-w3c-tests/inst.apk.py
ivi/tct-webstorage-w3c-tests/inst.wgt.py
ivi/tct-webstorage-w3c-tests/inst.xpk.py
ivi/tct-wgtapi01-w3c-tests/inst.apk.py
ivi/tct-wgtapi01-w3c-tests/inst.wgt.py
ivi/tct-wgtapi01-w3c-tests/inst.xpk.py
ivi/tct-wgtapi02-w3c-tests/inst.apk.py
ivi/tct-wgtapi02-w3c-tests/inst.wgt.py
ivi/tct-wgtapi02-w3c-tests/inst.xpk.py
ivi/tct-widget01-w3c-tests/inst.apk.py
ivi/tct-widget01-w3c-tests/inst.wgt.py
ivi/tct-widget01-w3c-tests/inst.xpk.py
ivi/tct-widget02-w3c-tests/inst.apk.py
ivi/tct-widget02-w3c-tests/inst.wgt.py
ivi/tct-widget02-w3c-tests/inst.xpk.py
ivi/tct-widgetpolicy-w3c-tests/inst.apk.py
ivi/tct-widgetpolicy-w3c-tests/inst.wgt.py
ivi/tct-widgetpolicy-w3c-tests/inst.xpk.py
ivi/tct-woff-w3c-tests/inst.apk.py
ivi/tct-woff-w3c-tests/inst.wgt.py
ivi/tct-woff-w3c-tests/inst.xpk.py
ivi/tct-workers-w3c-tests/inst.apk.py
ivi/tct-workers-w3c-tests/inst.wgt.py
ivi/tct-workers-w3c-tests/inst.xpk.py
ivi/tct-xmlhttprequest-w3c-tests/inst.apk.py
ivi/tct-xmlhttprequest-w3c-tests/inst.wgt.py
ivi/tct-xmlhttprequest-w3c-tests/inst.xpk.py
ivi/webapi-hrtime-w3c-tests/inst.apk.py
ivi/webapi-hrtime-w3c-tests/inst.wgt.py
ivi/webapi-hrtime-w3c-tests/inst.xpk.py
ivi/webapi-nfc-w3c-tests/inst.apk.py
ivi/webapi-nfc-w3c-tests/inst.wgt.py
ivi/webapi-nfc-w3c-tests/inst.xpk.py
ivi/webapi-performancetimeline-w3c-tests/inst.apk.py
ivi/webapi-performancetimeline-w3c-tests/inst.wgt.py
ivi/webapi-performancetimeline-w3c-tests/inst.xpk.py
ivi/webapi-resourcetiming-w3c-tests/inst.apk.py
ivi/webapi-resourcetiming-w3c-tests/inst.wgt.py
ivi/webapi-resourcetiming-w3c-tests/inst.xpk.py
ivi/webapi-speechapi-tizen-tests/inst.apk.py
ivi/webapi-speechapi-tizen-tests/inst.wgt.py
ivi/webapi-speechapi-tizen-tests/inst.xpk.py
ivi/webapi-usertiming-w3c-tests/inst.apk.py
ivi/webapi-usertiming-w3c-tests/inst.wgt.py
ivi/webapi-usertiming-w3c-tests/inst.xpk.py
ivi/webapi-vehicleinfo-ivi-tests/inst.apk.py
ivi/webapi-vehicleinfo-ivi-tests/inst.wgt.py
ivi/webapi-vehicleinfo-ivi-tests/inst.xpk.py
ivi/webapi-webrtc-w3c-tests/inst.apk.py
ivi/webapi-webrtc-w3c-tests/inst.wgt.py
ivi/webapi-webrtc-w3c-tests/inst.xpk.py
mobile/tct-capability-tests/inst.apk.py
mobile/tct-capability-tests/inst.wgt.py
mobile/tct-capability-tests/inst.xpk.py
mobile/tct-capability-tests/pack.py
mobile/tct-deprecatedapi-tizen-tests/inst.apk.py
mobile/tct-deprecatedapi-tizen-tests/inst.wgt.py
mobile/tct-deprecatedapi-tizen-tests/inst.xpk.py
mobile/tct-deprecatedapi-tizen-tests/pack.py
tools/build/pack.py
tools/coverage/stats.py
tools/xml/csv2xml.py
tools/xml/xml2csv.py
tools/xml/xmlverifier.py
tv/tct-capability-tests/inst.apk.py
tv/tct-capability-tests/inst.wgt.py
tv/tct-capability-tests/inst.xpk.py
tv/tct-capability-tests/pack.py
tv/tct-deprecatedapi-tizen-tests/inst.apk.py
tv/tct-deprecatedapi-tizen-tests/inst.wgt.py
tv/tct-deprecatedapi-tizen-tests/inst.xpk.py
tv/tct-deprecatedapi-tizen-tests/pack.py
wearable/tct-capability-tests/inst.apk.py
wearable/tct-capability-tests/inst.wgt.py
wearable/tct-capability-tests/inst.xpk.py
wearable/tct-capability-tests/pack.py
wearable/tct-deprecatedapi-tizen-tests/inst.apk.py
wearable/tct-deprecatedapi-tizen-tests/inst.wgt.py
wearable/tct-deprecatedapi-tizen-tests/inst.xpk.py
wearable/tct-deprecatedapi-tizen-tests/pack.py

index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 909755af3b4e03918ae3823bc036ddf994a43999..c7f89fd44607b570bbcae5447b935557cf8e590b 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -191,8 +191,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -211,7 +211,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -223,10 +223,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..bbc0c85581a68f5f5301d6d08108fc5d52aec1dc 100755 (executable)
@@ -8,7 +8,6 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +15,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +23,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +182,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +202,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +212,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index fb496b6e97a232af7659dc9e9f20dccf224fb1dd..7e3caa6c37e5ece07ffd4a4d06e7dce5ed8dc929 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -191,8 +191,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -211,7 +211,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -223,10 +223,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 3bcf73639d0dfee35216b86bc89b730fd63d01fa..93ac8ad714963bd2c8c224982d78ae0ac055b042 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -32,14 +32,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -190,8 +190,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -210,7 +210,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -222,10 +222,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 245e3b7c20561bdb4688cae97ced1a23f82c7dd9..a5295f0ab0fd7b9e820168dabc4ca3e1caee5b9c 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -21,14 +21,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -180,8 +180,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -200,7 +200,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -210,10 +210,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 8f1ecdb9b8653d67400b033d1938db6b7e701c56..2316502f49110c5656326bade9353be9d7932cdd 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -36,7 +36,7 @@ def askpolicyremoving():
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
    
-    print (pkg_id)
+    print pkg_id
     print (os.getcwd())
     print (os.path.dirname(os.path.realpath(__file__)) )
     if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
@@ -48,14 +48,14 @@ def askpolicyremoving():
        
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -206,8 +206,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -226,7 +226,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -238,10 +238,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 0c9ab8085c52b28b64c69c2e292b1bca9d257164..7f7d2c9d3fea0a314729b4046bc22de215f853d8 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -195,8 +195,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -215,7 +215,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -227,10 +227,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 9b2adfeddef2d6452874bab916b002c81107f43c..c0c358eccbe00400cf69651e2937542462b771d2 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -166,8 +166,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -186,7 +186,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -196,10 +196,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 92866ab2ed6acacf72d8704056c4c25f4835332a..08d55aafea37b74455bc394308459ede3844bb7c 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index fb496b6e97a232af7659dc9e9f20dccf224fb1dd..7e3caa6c37e5ece07ffd4a4d06e7dce5ed8dc929 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -191,8 +191,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -211,7 +211,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -223,10 +223,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 1e6b799087b3266ca391beca12866af0e77adb71..aa292c3795e83842b3a33fef0f81bac408e3b979 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -181,8 +181,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -201,7 +201,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -211,10 +211,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index fb496b6e97a232af7659dc9e9f20dccf224fb1dd..7e3caa6c37e5ece07ffd4a4d06e7dce5ed8dc929 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -191,8 +191,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -211,7 +211,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -223,10 +223,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 21f138a35ebe698176774458d61e85c165ac281a..8ed577c13fa1502efd2413b1f191aae30c227262 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -189,8 +189,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -209,7 +209,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -221,10 +221,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index b72850d63dbd293fed9df13eaab0dd8c4298025b..8b44f9c8d2dc1ed2572a8639dc42097f87fb041d 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -191,8 +191,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -211,7 +211,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -223,10 +223,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 4cd2306f27b1e149ddd8eb415240953bf0a363b8..2b5e3f2e1645d072aa408f8ea5bac2e434f728a8 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index 997d98f378383bf25adb2e29457b44aa19b30eae..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -7,7 +7,7 @@ import time
 import sys
 import subprocess
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 4baa95007d2fe09f7ee306b4964549df603686ba..9e0c931c314f52699c738d27c3315abdaf7256e6 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -190,8 +190,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -210,7 +210,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -222,10 +222,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 9a9a8f4e39b8c71aac5872e950809d105dabc930..371cc3088b64a6bf329cda62ffbeea6f445c9932 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -181,8 +181,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -201,7 +201,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -211,10 +211,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index 997d98f378383bf25adb2e29457b44aa19b30eae..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -7,7 +7,7 @@ import time
 import sys
 import subprocess
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index a20ec241c89085a179a3b5a7c697b1f3ce72b08e..b8776ee4956365e7c913402066ad636156c7a260 100755 (executable)
@@ -10,7 +10,7 @@ import string
 import logging
 import Queue
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 from shellmanager import ShellManager
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -18,7 +18,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 USER_DIR = tct_parser.get('DEVICE', 'DEVICE_USER_30')
@@ -53,10 +53,10 @@ def getInternalStorage():
         shell_mgr.write_cmd('export `tzplatform-get --user ' +PARAMETERS.user+' TZ_USER_CONTENT`', '', None)
         INTERNAL_STORAGE=shell_mgr.write_cmd('echo $TZ_USER_CONTENT','', None)
         INTERNAL_STORAGE=str(INTERNAL_STORAGE[len(INTERNAL_STORAGE)-1])
-        print (str(INTERNAL_STORAGE))
+        print str(INTERNAL_STORAGE)
         
     except Exception as ex:
-        print (ex)
+        print ex
     finally:
         shell_mgr.close_shellpipe()
 
@@ -72,7 +72,7 @@ def getInternalStorage():
 #                PARAMETERS.device)
 #        return doCMD(cmd)
 #    except Exception as ex:
-#        print (ex)
+#        print ex
 #    else:
 #        print ("aaaaaaaaaaaaaaa")
 #    os.system(
@@ -85,14 +85,14 @@ def getInternalStorage():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -245,8 +245,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -265,7 +265,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -279,10 +279,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 9a9a8f4e39b8c71aac5872e950809d105dabc930..371cc3088b64a6bf329cda62ffbeea6f445c9932 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -181,8 +181,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -201,7 +201,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -211,10 +211,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 6ae9cae4a2dd6e08388d943e816c9ac51b721bc0..a7478a0613c9939079c22eb209166b7ec72a5b53 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -191,8 +191,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -211,7 +211,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -223,10 +223,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 21f138a35ebe698176774458d61e85c165ac281a..8ed577c13fa1502efd2413b1f191aae30c227262 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -189,8 +189,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -209,7 +209,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -221,10 +221,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index c3285e19ca51f2e76d7e47e2a5578991abd9a167..18690763e66ef8bdab827e9de7d7691a83ab6d80 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -192,8 +192,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -212,7 +212,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -224,10 +224,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index fb496b6e97a232af7659dc9e9f20dccf224fb1dd..7e3caa6c37e5ece07ffd4a4d06e7dce5ed8dc929 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -191,8 +191,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -211,7 +211,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -223,10 +223,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 21f138a35ebe698176774458d61e85c165ac281a..8ed577c13fa1502efd2413b1f191aae30c227262 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -189,8 +189,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -209,7 +209,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -221,10 +221,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 0f5e3baa11e24ff29fb940d13879654eed5d1ac5..d7b962bfa82776fca71e2303a49cf948e5f9ffac 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -189,8 +189,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -209,7 +209,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -221,10 +221,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 9b2adfeddef2d6452874bab916b002c81107f43c..c0c358eccbe00400cf69651e2937542462b771d2 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -166,8 +166,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -186,7 +186,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -196,10 +196,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index fb496b6e97a232af7659dc9e9f20dccf224fb1dd..7e3caa6c37e5ece07ffd4a4d06e7dce5ed8dc929 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -191,8 +191,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -211,7 +211,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -223,10 +223,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 6e0726097c3b3cf38821ce5ab9232b33f5fdbf78..ef38eb600f18f1c170e0054cddaf87319822cc58 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -37,7 +37,7 @@ def askpolicyremoving():
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
    
-    print (pkg_id)
+    print pkg_id
     print (os.getcwd())
     print (os.path.dirname(os.path.realpath(__file__)) )
     if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
@@ -49,14 +49,14 @@ def askpolicyremoving():
        
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -205,8 +205,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -225,7 +225,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -237,10 +237,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 3a5bc906722e61d402d73c18b76443659743d028..36b426acba322a44e19eb93fe221ea55337dd8f7 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -21,14 +21,14 @@ PKG_SRC_DIR = ""
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 6e0726097c3b3cf38821ce5ab9232b33f5fdbf78..ef38eb600f18f1c170e0054cddaf87319822cc58 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -37,7 +37,7 @@ def askpolicyremoving():
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
    
-    print (pkg_id)
+    print pkg_id
     print (os.getcwd())
     print (os.path.dirname(os.path.realpath(__file__)) )
     if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
@@ -49,14 +49,14 @@ def askpolicyremoving():
        
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -205,8 +205,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -225,7 +225,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -237,10 +237,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 275a9362dc8d517d92f500a41640b1d07eb14b45..84a331b62dc6dbffaa9542a138e4b8281dfb87a2 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -189,8 +189,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -209,7 +209,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -221,10 +221,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 909755af3b4e03918ae3823bc036ddf994a43999..c7f89fd44607b570bbcae5447b935557cf8e590b 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -191,8 +191,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -211,7 +211,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -223,10 +223,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 80b6b1ba82c774b1babdd56ffb78e1b05d125b28..f04d84498da7020290008080fed75b8de38b1250 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -36,7 +36,7 @@ def askpolicyremoving():
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
    
-    print (pkg_id)
+    print pkg_id
     print (os.getcwd())
     print (os.path.dirname(os.path.realpath(__file__)) )
     if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
@@ -48,14 +48,14 @@ def askpolicyremoving():
        
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -199,8 +199,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -219,7 +219,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -231,10 +231,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 34cd55034a8a205d40f1f3794a6b7219b62060b8..371cc3088b64a6bf329cda62ffbeea6f445c9932 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -181,8 +181,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -201,7 +201,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -211,10 +211,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index 997d98f378383bf25adb2e29457b44aa19b30eae..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -7,7 +7,7 @@ import time
 import sys
 import subprocess
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 1508860d8fbe25050e68dd96af8e8689327d3134..08c6d3d3437383a63c269297e5c6b51e869b63b5 100755 (executable)
@@ -10,7 +10,7 @@ import string
 import logging
 import Queue
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 from shellmanager import ShellManager
 
 time.sleep(3)
@@ -20,7 +20,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 #INTERNAL_STORAGE = tct_parser.get('DEVICE', 'DEVICE_STORAGE_30')
@@ -72,28 +72,51 @@ def getInternalStorage():
         shell_mgr.write_cmd('export `tzplatform-get --user ' +PARAMETERS.user+' TZ_USER_CONTENT`', '', None)
         INTERNAL_STORAGE=shell_mgr.write_cmd('echo $TZ_USER_CONTENT','', None)
         INTERNAL_STORAGE=str(INTERNAL_STORAGE[len(INTERNAL_STORAGE)-1])
-        print (str(INTERNAL_STORAGE))
+        print str(INTERNAL_STORAGE)
         
     except Exception as ex:
-        print (ex)
+        print ex
     finally:
         shell_mgr.close_shellpipe()
 
 def askpolicyremoving():
+    print "0"
+    print "0"
+    print "0"
+    print "0"
+    print "0"
     for root, dirs, files in os.walk(SCRIPT_DIR):
         for file in files:
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
     
-    print (pkg_id)
+    print pkg_id
+    print pkg_id
+    print pkg_id
+    print pkg_id
     print (os.getcwd())
+    print (os.getcwd())
+    print (os.path.dirname(os.path.realpath(__file__)) )
     print (os.path.dirname(os.path.realpath(__file__)) )
     if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
         action_status = False
+    print "1"
+    print "1"
+    print "1"
+    print "1"
+    print "1"
     if PARAMETERS.mode == "SDB":
         cmd = "sdb -s %s shell .%s/askpolicy.sh %s" % (PARAMETERS.device, 
         SRC_DIR, pkg_id)
-    return doCMD(cmd)
+        print cmd
+        print cmd
+        print cmd
+        print cmd
+        print cmd
+    return doCMD(cmd)        
+    print "2"
+    print "2"
+    print "2"
         
 def recordInternalStorage():
     try:
@@ -107,7 +130,7 @@ def recordInternalStorage():
                 PARAMETERS.device)
         return doCMD(cmd)
     except Exception as ex:
-        print (ex)
+        print ex
     else:
         print ("aaaaaaaaaaaaaaa")
 #    os.system(
@@ -120,14 +143,14 @@ def recordInternalStorage():
     
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -250,6 +273,8 @@ def instPKGs():
                         action_status = False
                         break
     print(INTERNAL_STORAGE)
+    print(INTERNAL_STORAGE)
+    print(INTERNAL_STORAGE)
     if not doRemoteCopy("%s/media" % SCRIPT_DIR, "%s/%s" % (SRC_DIR, PKG_NAME)):
         action_status = False
     if not doRemoteCopy("%s/media" % SCRIPT_DIR, "%s/Downloads/" % (INTERNAL_STORAGE)):
@@ -278,8 +303,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -298,7 +323,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -312,10 +337,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
@@ -323,6 +348,11 @@ def main():
             sys.exit(1)
     else:
         if not instPKGs():
+            print "inst"
+            print "inst"
+            print "inst"
+            print "inst"
+            print "inst"
             #askpolicyremoving()
             sys.exit(1)
 
index 3626cd23a52e42bf8c16533d5f908c282294d733..c3b031d9a3fdd166a84d260199e9b57d7eae0f21 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -173,8 +173,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -193,7 +193,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -203,10 +203,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 1141c4c3749d69907faedc251a8f52697f179614..0c4e2056a3aa7b494e929ca7f813051c1276e906 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -173,8 +173,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -193,7 +193,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -205,10 +205,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 9b2adfeddef2d6452874bab916b002c81107f43c..c0c358eccbe00400cf69651e2937542462b771d2 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -166,8 +166,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -186,7 +186,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -196,10 +196,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 92866ab2ed6acacf72d8704056c4c25f4835332a..08d55aafea37b74455bc394308459ede3844bb7c 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5df0b661c5683ffa964a9b2b5a6d129731768435..30dfea1b203fb8045811eb301861c74840cab84b 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -32,14 +32,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -189,8 +189,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -209,7 +209,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -221,10 +221,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 0f5e3baa11e24ff29fb940d13879654eed5d1ac5..d7b962bfa82776fca71e2303a49cf948e5f9ffac 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -189,8 +189,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -209,7 +209,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -221,10 +221,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 245e3b7c20561bdb4688cae97ced1a23f82c7dd9..a5295f0ab0fd7b9e820168dabc4ca3e1caee5b9c 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -21,14 +21,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -180,8 +180,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -200,7 +200,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -210,10 +210,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index be3dfd026d8e0d57838409cd5a61d8a0c037db1f..076b4489e7c9bad7c44d0241000feb9268660eee 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -184,8 +184,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -204,7 +204,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -216,10 +216,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 0f5e3baa11e24ff29fb940d13879654eed5d1ac5..d7b962bfa82776fca71e2303a49cf948e5f9ffac 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -189,8 +189,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -209,7 +209,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -221,10 +221,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 4785d8b9b34e98b1109cd9580f307923ab5a6b3c..9198206757f8fcfd46b33f9bbce3686eb05238cb 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -172,8 +172,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -192,7 +192,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -204,10 +204,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 1e6b799087b3266ca391beca12866af0e77adb71..aa292c3795e83842b3a33fef0f81bac408e3b979 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -181,8 +181,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -201,7 +201,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -211,10 +211,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ecdac7ff6768250380aa10ed74f64066d84bf6f8..70534429f792a7e9ce70758f0450468097a1fe79 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -37,7 +37,7 @@ def askpolicyremoving():
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
    
-    print (pkg_id)
+    print pkg_id
     print (os.getcwd())
     print (os.path.dirname(os.path.realpath(__file__)) )
     if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
@@ -49,14 +49,14 @@ def askpolicyremoving():
        
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -204,8 +204,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -224,7 +224,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -236,10 +236,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ecdac7ff6768250380aa10ed74f64066d84bf6f8..70534429f792a7e9ce70758f0450468097a1fe79 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -37,7 +37,7 @@ def askpolicyremoving():
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
    
-    print (pkg_id)
+    print pkg_id
     print (os.getcwd())
     print (os.path.dirname(os.path.realpath(__file__)) )
     if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
@@ -49,14 +49,14 @@ def askpolicyremoving():
        
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -204,8 +204,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -224,7 +224,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -236,10 +236,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 3bcf73639d0dfee35216b86bc89b730fd63d01fa..93ac8ad714963bd2c8c224982d78ae0ac055b042 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -32,14 +32,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -190,8 +190,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -210,7 +210,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -222,10 +222,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ecdac7ff6768250380aa10ed74f64066d84bf6f8..70534429f792a7e9ce70758f0450468097a1fe79 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -37,7 +37,7 @@ def askpolicyremoving():
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
    
-    print (pkg_id)
+    print pkg_id
     print (os.getcwd())
     print (os.path.dirname(os.path.realpath(__file__)) )
     if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
@@ -49,14 +49,14 @@ def askpolicyremoving():
        
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -204,8 +204,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -224,7 +224,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -236,10 +236,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 3bcf73639d0dfee35216b86bc89b730fd63d01fa..93ac8ad714963bd2c8c224982d78ae0ac055b042 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -32,14 +32,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -190,8 +190,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -210,7 +210,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -222,10 +222,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index d2daaf7c41bfb720fe5bf08b1895e8525c02dec7..dccbfe5ebff1d5664bc1cfa5ee52c1d94f3c4e9e 100755 (executable)
@@ -10,7 +10,7 @@ import string
 import logging
 import Queue
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 from shellmanager import ShellManager
 
 time.sleep(3)
@@ -20,7 +20,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -43,23 +43,23 @@ def getInternalStorage():
         shell_mgr.write_cmd('export `tzplatform-get --user ' +PARAMETERS.user+' TZ_USER_CONTENT`', '', None)
         INTERNAL_STORAGE=shell_mgr.write_cmd('echo $TZ_USER_CONTENT','', None)
         INTERNAL_STORAGE=str(INTERNAL_STORAGE[len(INTERNAL_STORAGE)-1])
-        print (str(INTERNAL_STORAGE))
+        print str(INTERNAL_STORAGE)
     except Exception as ex:
-        print (ex)
+        print ex
     finally:
         shell_mgr.close_shellpipe()
 
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -216,8 +216,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -236,23 +236,26 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
 
+    print "1"
     getInternalStorage()
-    user_info = getUSERID() 
+    print "2"
+    user_info = getUSERID()
+    print "3"    
     re_code = user_info[0]
     if re_code == 0 :
         global XW_ENV
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index cdc72d3b36ca50d331a1d9770f514a83e57955cd..28b1eb42a8050b6e383212dd04fd0aec51784495 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -176,8 +176,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -196,7 +196,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -206,10 +206,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index 155fecf5b65b28ae1f648d4509080cae79847995..53270edda4a217e4b5b225532daa861b4b61d57b 100755 (executable)
@@ -91,7 +91,7 @@
               <expected>TC is running</expected>
             </step>
             <step order="2">
-              <step_desc>Click the "power" button or switch to a different application and then return to the test application.</step_desc>
+              <step_desc>Click the &quot;power&quot; button or switch to a different application and then return to the test application.</step_desc>
               <expected>TC is pass</expected>
             </step>
           </steps>
               <expected>TC is running</expected>
             </step>
             <step order="2">
-              <step_desc>Click the "power" button or switch to a different application and then return to the test application.</step_desc>
+              <step_desc>Click the &quot;power&quot; button or switch to a different application and then return to the test application.</step_desc>
               <expected>TC is pass</expected>
             </step>
           </steps>
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 8ef95b07b0e62792553009fc11e4cc097f49f514..d458986499bc2a7f197a809113f71723667c766f 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -182,8 +182,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -202,7 +202,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -214,10 +214,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1dff255b937094670f74f023eed56d71cd4b8af..c3b031d9a3fdd166a84d260199e9b57d7eae0f21 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -173,8 +173,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -193,7 +193,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -203,10 +203,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 21f138a35ebe698176774458d61e85c165ac281a..8ed577c13fa1502efd2413b1f191aae30c227262 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -189,8 +189,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -209,7 +209,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -221,10 +221,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 21f138a35ebe698176774458d61e85c165ac281a..8ed577c13fa1502efd2413b1f191aae30c227262 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -189,8 +189,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -209,7 +209,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -221,10 +221,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ecdac7ff6768250380aa10ed74f64066d84bf6f8..70534429f792a7e9ce70758f0450468097a1fe79 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -37,7 +37,7 @@ def askpolicyremoving():
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
    
-    print (pkg_id)
+    print pkg_id
     print (os.getcwd())
     print (os.path.dirname(os.path.realpath(__file__)) )
     if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
@@ -49,14 +49,14 @@ def askpolicyremoving():
        
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -204,8 +204,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -224,7 +224,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -236,10 +236,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index eee87514d0839834e892e0baad3387d55f15d7f6..4bcbd777fe52ac33fb287667607bbeb4600c32c2 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -37,7 +37,7 @@ def askpolicyremoving():
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
    
-    print (pkg_id)
+    print pkg_id
     print (os.getcwd())
     print (os.path.dirname(os.path.realpath(__file__)) )
     if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
@@ -49,14 +49,14 @@ def askpolicyremoving():
        
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -208,8 +208,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -228,7 +228,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -240,10 +240,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 275a9362dc8d517d92f500a41640b1d07eb14b45..84a331b62dc6dbffaa9542a138e4b8281dfb87a2 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -189,8 +189,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -209,7 +209,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -221,10 +221,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index d46e4924e446633bd01b1939f61bceb215fc42d3..44e57cf176811a997dd4abf590ad6d6c821d1835 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -191,8 +191,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -211,7 +211,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -223,10 +223,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 3bcf73639d0dfee35216b86bc89b730fd63d01fa..93ac8ad714963bd2c8c224982d78ae0ac055b042 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -32,14 +32,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -190,8 +190,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -210,7 +210,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -222,10 +222,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index c6d1ddce76add1c3e85438e954b6f9a2c9bd1620..dc5e8b8b3b44d332f5bafdfa76849620596a137e 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -189,8 +189,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -209,7 +209,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -221,10 +221,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 1e6b799087b3266ca391beca12866af0e77adb71..aa292c3795e83842b3a33fef0f81bac408e3b979 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -181,8 +181,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -201,7 +201,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -211,10 +211,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 795d087c4a049ae1d2035b240983faae6e12ac41..122ddbf63fd9859b222d5a03900b770e97dc06be 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -34,14 +34,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -210,8 +210,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -230,7 +230,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -242,10 +242,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 3bcf73639d0dfee35216b86bc89b730fd63d01fa..93ac8ad714963bd2c8c224982d78ae0ac055b042 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -32,14 +32,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -190,8 +190,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -210,7 +210,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -222,10 +222,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 0f5e3baa11e24ff29fb940d13879654eed5d1ac5..d7b962bfa82776fca71e2303a49cf948e5f9ffac 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -189,8 +189,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -209,7 +209,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -221,10 +221,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index e210b7d434e6f34a5e720877d2da493c1fdbe92a..d4fcbeb70aa7e9c2766b367bd41b364a2166fa11 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -37,7 +37,7 @@ def askpolicyremoving():
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
    
-    print (pkg_id)
+    print pkg_id
     print (os.getcwd())
     print (os.path.dirname(os.path.realpath(__file__)) )
     if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
@@ -49,14 +49,14 @@ def askpolicyremoving():
        
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -205,8 +205,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -225,7 +225,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -237,10 +237,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index e210b7d434e6f34a5e720877d2da493c1fdbe92a..d4fcbeb70aa7e9c2766b367bd41b364a2166fa11 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -37,7 +37,7 @@ def askpolicyremoving():
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
    
-    print (pkg_id)
+    print pkg_id
     print (os.getcwd())
     print (os.path.dirname(os.path.realpath(__file__)) )
     if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
@@ -49,14 +49,14 @@ def askpolicyremoving():
        
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -205,8 +205,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -225,7 +225,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -237,10 +237,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 9604b1805263e4020cd07b21c2b5fb82f00d3227..1f51fd5adc5612985041675d5fb10803111c10d3 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -182,8 +182,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -202,7 +202,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -214,10 +214,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index e210b7d434e6f34a5e720877d2da493c1fdbe92a..d4fcbeb70aa7e9c2766b367bd41b364a2166fa11 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -37,7 +37,7 @@ def askpolicyremoving():
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
    
-    print (pkg_id)
+    print pkg_id
     print (os.getcwd())
     print (os.path.dirname(os.path.realpath(__file__)) )
     if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
@@ -49,14 +49,14 @@ def askpolicyremoving():
        
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -205,8 +205,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -225,7 +225,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -237,10 +237,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index a235446b2752750cef404c4337e61628fd9488f6..851f32dae29f411e16c94359ce69be37f0ea13ea 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -37,7 +37,7 @@ def askpolicyremoving():
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
    
-    print (pkg_id)
+    print pkg_id
     print (os.getcwd())
     print (os.path.dirname(os.path.realpath(__file__)) )
     if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
@@ -49,14 +49,14 @@ def askpolicyremoving():
        
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -208,8 +208,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -228,7 +228,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -240,10 +240,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5edd243439a82190d7ae922c24137b90d839ec77..10347d27d5b4d9186792d41501d77bf6cf133808 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -186,8 +186,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -206,7 +206,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -218,10 +218,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 191f5ff620aaf7a66ae4bb2849a3fa8dbb1da0b9..c904d861abee64276be647b0be529bc56e687fe3 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -188,8 +188,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -208,7 +208,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -218,10 +218,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 3bcf73639d0dfee35216b86bc89b730fd63d01fa..93ac8ad714963bd2c8c224982d78ae0ac055b042 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -32,14 +32,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -190,8 +190,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -210,7 +210,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -222,10 +222,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 3bcf73639d0dfee35216b86bc89b730fd63d01fa..93ac8ad714963bd2c8c224982d78ae0ac055b042 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -32,14 +32,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -190,8 +190,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -210,7 +210,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -222,10 +222,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 76475d82bca3772232f361f70273bc34fdd616c3..2a5d8ad03ba296b13a1a6cfc9299c52849f2ae22 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -192,8 +192,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -212,7 +212,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -224,10 +224,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 3bcf73639d0dfee35216b86bc89b730fd63d01fa..93ac8ad714963bd2c8c224982d78ae0ac055b042 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -32,14 +32,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -190,8 +190,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -210,7 +210,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -222,10 +222,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 4a54d50a3ab8f734766a1d21c85f820a7baee219..dff1eedb285754c9b87a66d0e67d1e4d7952e9b9 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -187,8 +187,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -207,7 +207,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -219,10 +219,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 1c0e2dd03682539f1e1868c43067fe7cefb8cbc0..bfad76c335abd26e245f17f4e762f4204e93f129 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -21,14 +21,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 92866ab2ed6acacf72d8704056c4c25f4835332a..08d55aafea37b74455bc394308459ede3844bb7c 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index bd19546533cbb97c8c573b2d862dfbd6243aa1e3..36c3332761239f253f97edd19106df3282dcdf60 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -37,7 +37,7 @@ def askpolicyremoving():
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
    
-    print (pkg_id)
+    print pkg_id
     print (os.getcwd())
     print (os.path.dirname(os.path.realpath(__file__)) )
     if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
@@ -49,14 +49,14 @@ def askpolicyremoving():
        
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -210,8 +210,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -230,7 +230,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -242,10 +242,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 3bcf73639d0dfee35216b86bc89b730fd63d01fa..93ac8ad714963bd2c8c224982d78ae0ac055b042 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -32,14 +32,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -190,8 +190,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -210,7 +210,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -222,10 +222,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 376418451e6a96885f7a9ed10666776644504bc0..f35c72947631f65e55b5c5bacea8ff1214082f2e 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -215,10 +215,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 1e6b799087b3266ca391beca12866af0e77adb71..aa292c3795e83842b3a33fef0f81bac408e3b979 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -181,8 +181,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -201,7 +201,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -211,10 +211,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index d46e4924e446633bd01b1939f61bceb215fc42d3..44e57cf176811a997dd4abf590ad6d6c821d1835 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -191,8 +191,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -211,7 +211,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -223,10 +223,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 3bcf73639d0dfee35216b86bc89b730fd63d01fa..93ac8ad714963bd2c8c224982d78ae0ac055b042 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -32,14 +32,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -190,8 +190,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -210,7 +210,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -222,10 +222,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 9028456719d2898eff87ba73c51fbe30f26d6dd2..244c4552d1c741d565bee7fc8d9908380d8a7893 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -184,8 +184,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -204,7 +204,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -216,10 +216,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 245e3b7c20561bdb4688cae97ced1a23f82c7dd9..a5295f0ab0fd7b9e820168dabc4ca3e1caee5b9c 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -21,14 +21,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -180,8 +180,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -200,7 +200,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -210,10 +210,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ec51f5207bf54074bbf9c9f8f9c44d091daddbe5..ea1c0dfa326bd5b92d10453f6f4dce8fe874ab39 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -37,7 +37,7 @@ def askpolicyremoving():
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
    
-    print (pkg_id)
+    print pkg_id
     print (os.getcwd())
     print (os.path.dirname(os.path.realpath(__file__)) )
     if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
@@ -49,14 +49,14 @@ def askpolicyremoving():
        
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -207,8 +207,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -227,7 +227,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -239,10 +239,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 4cd2306f27b1e149ddd8eb415240953bf0a363b8..2b5e3f2e1645d072aa408f8ea5bac2e434f728a8 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index fd2e87dda5143cb6fef5d2d08594d2bf2c75c2f9..71805b47fdf5650675c5558408bf87691f582d96 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -37,7 +37,7 @@ def askpolicyremoving():
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
    
-    print (pkg_id)
+    print pkg_id
     print (os.getcwd())
     print (os.path.dirname(os.path.realpath(__file__)) )
     if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
@@ -49,14 +49,14 @@ def askpolicyremoving():
        
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -204,8 +204,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -224,7 +224,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -236,10 +236,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 4cd2306f27b1e149ddd8eb415240953bf0a363b8..2b5e3f2e1645d072aa408f8ea5bac2e434f728a8 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 6e0726097c3b3cf38821ce5ab9232b33f5fdbf78..ef38eb600f18f1c170e0054cddaf87319822cc58 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -37,7 +37,7 @@ def askpolicyremoving():
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
    
-    print (pkg_id)
+    print pkg_id
     print (os.getcwd())
     print (os.path.dirname(os.path.realpath(__file__)) )
     if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
@@ -49,14 +49,14 @@ def askpolicyremoving():
        
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -205,8 +205,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -225,7 +225,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -237,10 +237,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ecdac7ff6768250380aa10ed74f64066d84bf6f8..70534429f792a7e9ce70758f0450468097a1fe79 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -37,7 +37,7 @@ def askpolicyremoving():
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
    
-    print (pkg_id)
+    print pkg_id
     print (os.getcwd())
     print (os.path.dirname(os.path.realpath(__file__)) )
     if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
@@ -49,14 +49,14 @@ def askpolicyremoving():
        
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -204,8 +204,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -224,7 +224,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -236,10 +236,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ecdac7ff6768250380aa10ed74f64066d84bf6f8..70534429f792a7e9ce70758f0450468097a1fe79 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -37,7 +37,7 @@ def askpolicyremoving():
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
    
-    print (pkg_id)
+    print pkg_id
     print (os.getcwd())
     print (os.path.dirname(os.path.realpath(__file__)) )
     if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
@@ -49,14 +49,14 @@ def askpolicyremoving():
        
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -204,8 +204,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -224,7 +224,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -236,10 +236,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ecdac7ff6768250380aa10ed74f64066d84bf6f8..70534429f792a7e9ce70758f0450468097a1fe79 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -37,7 +37,7 @@ def askpolicyremoving():
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
    
-    print (pkg_id)
+    print pkg_id
     print (os.getcwd())
     print (os.path.dirname(os.path.realpath(__file__)) )
     if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
@@ -49,14 +49,14 @@ def askpolicyremoving():
        
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -204,8 +204,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -224,7 +224,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -236,10 +236,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 1459d2c88e569b424ea6d5db25fcffff4f04a42f..39ee7a0c0be2296871c0fc32e19e4c840ecac59c 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -37,7 +37,7 @@ def askpolicyremoving():
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
    
-    print (pkg_id)
+    print pkg_id
     print (os.getcwd())
     print (os.path.dirname(os.path.realpath(__file__)) )
     if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
@@ -49,14 +49,14 @@ def askpolicyremoving():
        
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -219,8 +219,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -239,7 +239,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -251,10 +251,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 3bcf73639d0dfee35216b86bc89b730fd63d01fa..93ac8ad714963bd2c8c224982d78ae0ac055b042 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -32,14 +32,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -190,8 +190,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -210,7 +210,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -222,10 +222,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 245e3b7c20561bdb4688cae97ced1a23f82c7dd9..a5295f0ab0fd7b9e820168dabc4ca3e1caee5b9c 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -21,14 +21,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -180,8 +180,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -200,7 +200,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -210,10 +210,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 134a17a077f2a5805b6f59bbf21b4a34654fa59d..d2ee57294ba664b1971288d87dbd7168c38d834f 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 909755af3b4e03918ae3823bc036ddf994a43999..c7f89fd44607b570bbcae5447b935557cf8e590b 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -191,8 +191,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -211,7 +211,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -223,10 +223,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index d46e4924e446633bd01b1939f61bceb215fc42d3..44e57cf176811a997dd4abf590ad6d6c821d1835 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -191,8 +191,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -211,7 +211,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -223,10 +223,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index b30f310f466b83085a7761c6cf6c03fa851ab479..dd614f26548aab1c49ce4a34e3e02b05ef5e4971 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -215,10 +215,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index e8fac2aba54ddd430704bd886fe1e3f0e49e8eda..128023f51874e45e980936a687da1da15114c34b 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -37,7 +37,7 @@ def askpolicyremoving():
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
    
-    print (pkg_id)
+    print pkg_id
     print (os.getcwd())
     print (os.path.dirname(os.path.realpath(__file__)) )
     if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
@@ -49,14 +49,14 @@ def askpolicyremoving():
        
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -201,8 +201,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -221,7 +221,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -233,10 +233,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index c6d1ddce76add1c3e85438e954b6f9a2c9bd1620..dc5e8b8b3b44d332f5bafdfa76849620596a137e 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -189,8 +189,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -209,7 +209,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -221,10 +221,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 3f810e86084f1a58f1b8ed45ab421de189147400..2dd4ce674b3eb0d5cb1c1efafbdd2ca5f564ab2a 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -32,14 +32,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -199,8 +199,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -219,7 +219,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -231,10 +231,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ed803130a5ee1a2be69c5ac932b4fd1d47922361..0ba04d0375ba7c3d95e4a8bc1f610fbaea8f0fbe 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -940,7 +940,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index 997d98f378383bf25adb2e29457b44aa19b30eae..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -7,7 +7,7 @@ import time
 import sys
 import subprocess
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index d40f6c0d4f2c1f81350c3e93335113c8fdf42cb5..802b9e785ce29781f143c66db79cf045dfb6dfe5 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -197,8 +197,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -217,7 +217,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -229,10 +229,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 7e0d91324ea5602917d2efd3ab3125e7f8a7e224..c904d861abee64276be647b0be529bc56e687fe3 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -188,8 +188,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -208,7 +208,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -218,10 +218,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 0f5e3baa11e24ff29fb940d13879654eed5d1ac5..d7b962bfa82776fca71e2303a49cf948e5f9ffac 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -189,8 +189,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -209,7 +209,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -221,10 +221,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index d6e2e20f315d99312b69bd3b2918bfdb7a98bd28..26774c69d423e4113e1cab1157a30aad78a6ac7e 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -189,8 +189,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -209,7 +209,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -221,10 +221,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 0af1496137e4072a03b13551e8c17db100088fc6..22a25cec50e339d38ea70c17c10280b55e4b8a98 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -180,8 +180,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -200,7 +200,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -210,10 +210,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index 997d98f378383bf25adb2e29457b44aa19b30eae..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -7,7 +7,7 @@ import time
 import sys
 import subprocess
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 670f31e952fb5e42f1a9ba0b077946f5c8a3fa7e..93ac8ad714963bd2c8c224982d78ae0ac055b042 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -32,14 +32,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -190,8 +190,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -210,7 +210,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -222,10 +222,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index dccbae7e9daa70697cf0b02269113bd01d963945..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 909755af3b4e03918ae3823bc036ddf994a43999..c7f89fd44607b570bbcae5447b935557cf8e590b 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -191,8 +191,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -211,7 +211,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -223,10 +223,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 92866ab2ed6acacf72d8704056c4c25f4835332a..08d55aafea37b74455bc394308459ede3844bb7c 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ee60af7455c9706b0204efbb11d0a4b4ae4940e3..ca95382d7ab9d7f070462fc69040d7ff22ab55ad 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -195,8 +195,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -215,7 +215,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -227,10 +227,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 3bcf73639d0dfee35216b86bc89b730fd63d01fa..93ac8ad714963bd2c8c224982d78ae0ac055b042 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -32,14 +32,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -190,8 +190,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -210,7 +210,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -222,10 +222,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 6e0726097c3b3cf38821ce5ab9232b33f5fdbf78..ef38eb600f18f1c170e0054cddaf87319822cc58 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -37,7 +37,7 @@ def askpolicyremoving():
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
    
-    print (pkg_id)
+    print pkg_id
     print (os.getcwd())
     print (os.path.dirname(os.path.realpath(__file__)) )
     if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
@@ -49,14 +49,14 @@ def askpolicyremoving():
        
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -205,8 +205,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -225,7 +225,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -237,10 +237,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index d46e4924e446633bd01b1939f61bceb215fc42d3..44e57cf176811a997dd4abf590ad6d6c821d1835 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -191,8 +191,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -211,7 +211,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -223,10 +223,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 8e0d9ef1ac5649b442f894d42aea36e60df8bd95..e32732b340da4841aa7a480e4c2e53dbd8f4b635 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -188,8 +188,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -208,7 +208,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -220,10 +220,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 36be2eb51f034efa9ca66695224cea7fbc508bea..145211488f64c080a91702f338bce3033501800f 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -189,8 +189,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -209,7 +209,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -221,10 +221,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 3c5075e3ec1c0086d2aea1c9b823d74f876ffc99..85b97b93f3df9dcbf5084565c37ed0fbb7f52b1f 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index d442317ad901dd9c07ded27b4de2ff2d47dcba45..9c17c1ad72abe8efd6676db89600e7198bd680af 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -185,8 +185,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -205,7 +205,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -217,10 +217,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index 997d98f378383bf25adb2e29457b44aa19b30eae..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -7,7 +7,7 @@ import time
 import sys
 import subprocess
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 670f31e952fb5e42f1a9ba0b077946f5c8a3fa7e..93ac8ad714963bd2c8c224982d78ae0ac055b042 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -32,14 +32,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -190,8 +190,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -210,7 +210,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -222,10 +222,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index dccbae7e9daa70697cf0b02269113bd01d963945..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index d88ca18903f0223ed2bbc3255a33282eeb86e29e..d4d5dc5df222911d2013bc04ea5ee9a203ff80d9 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -202,8 +202,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -222,7 +222,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -234,10 +234,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 0f5e3baa11e24ff29fb940d13879654eed5d1ac5..d7b962bfa82776fca71e2303a49cf948e5f9ffac 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -189,8 +189,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -209,7 +209,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -221,10 +221,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 9b2adfeddef2d6452874bab916b002c81107f43c..c0c358eccbe00400cf69651e2937542462b771d2 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -166,8 +166,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -186,7 +186,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -196,10 +196,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 3bcf73639d0dfee35216b86bc89b730fd63d01fa..93ac8ad714963bd2c8c224982d78ae0ac055b042 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -32,14 +32,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -190,8 +190,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -210,7 +210,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -222,10 +222,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 3bcf73639d0dfee35216b86bc89b730fd63d01fa..93ac8ad714963bd2c8c224982d78ae0ac055b042 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -32,14 +32,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -190,8 +190,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -210,7 +210,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -222,10 +222,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index a25e5a554fff40ad3140eb80cc6d32be176e9fae..3ef2cf1df3d914a3055c3dd1d504f367d745c51a 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -37,7 +37,7 @@ def askpolicyremoving():
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
    
-    print (pkg_id)
+    print pkg_id
     print (os.getcwd())
     print (os.path.dirname(os.path.realpath(__file__)) )
     if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
@@ -49,14 +49,14 @@ def askpolicyremoving():
        
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -207,8 +207,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -227,7 +227,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -239,10 +239,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 92dd9055d963d424bf45d4c29c8c0c37bb9a6285..f0baddaf54621f642052088f897fa0f893e4e033 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -185,8 +185,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -205,7 +205,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -217,10 +217,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 245e3b7c20561bdb4688cae97ced1a23f82c7dd9..a5295f0ab0fd7b9e820168dabc4ca3e1caee5b9c 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -21,14 +21,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -180,8 +180,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -200,7 +200,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -210,10 +210,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 218f1a4910db8036ba4e80b2530c455682ce416e..7a271b8beb23eb18de52d3f53c2921ac7da931bb 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -32,14 +32,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -189,8 +189,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -209,7 +209,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -221,10 +221,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index c3285e19ca51f2e76d7e47e2a5578991abd9a167..18690763e66ef8bdab827e9de7d7691a83ab6d80 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -192,8 +192,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -212,7 +212,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -224,10 +224,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index 997d98f378383bf25adb2e29457b44aa19b30eae..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -7,7 +7,7 @@ import time
 import sys
 import subprocess
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 6e0726097c3b3cf38821ce5ab9232b33f5fdbf78..ef38eb600f18f1c170e0054cddaf87319822cc58 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -37,7 +37,7 @@ def askpolicyremoving():
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
    
-    print (pkg_id)
+    print pkg_id
     print (os.getcwd())
     print (os.path.dirname(os.path.realpath(__file__)) )
     if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
@@ -49,14 +49,14 @@ def askpolicyremoving():
        
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -205,8 +205,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -225,7 +225,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -237,10 +237,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index dccbae7e9daa70697cf0b02269113bd01d963945..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 82e9260d7cc7599cbab3683f91e1fd3b39bd2420..f0b99779f7728176a19e890891aa33136527334d 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -32,14 +32,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -192,8 +192,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -212,7 +212,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -224,10 +224,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 68c913eef7c6aaa595bae0e18399f532755da591..5b1718da169ebc796a16962b47a209f160af24d9 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -182,8 +182,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -202,7 +202,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -212,10 +212,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index 997d98f378383bf25adb2e29457b44aa19b30eae..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -7,7 +7,7 @@ import time
 import sys
 import subprocess
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 670f31e952fb5e42f1a9ba0b077946f5c8a3fa7e..93ac8ad714963bd2c8c224982d78ae0ac055b042 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -32,14 +32,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -190,8 +190,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -210,7 +210,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -222,10 +222,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index dccbae7e9daa70697cf0b02269113bd01d963945..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index e82b9aae14a57057ef32a0aa589803fe2a819689..f09fdf912e360a2274228ab820d19f5db567f141 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -188,8 +188,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -208,7 +208,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -220,10 +220,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 0f5e3baa11e24ff29fb940d13879654eed5d1ac5..d7b962bfa82776fca71e2303a49cf948e5f9ffac 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -189,8 +189,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -209,7 +209,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -221,10 +221,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 245e3b7c20561bdb4688cae97ced1a23f82c7dd9..a5295f0ab0fd7b9e820168dabc4ca3e1caee5b9c 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -21,14 +21,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -180,8 +180,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -200,7 +200,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -210,10 +210,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 3bcf73639d0dfee35216b86bc89b730fd63d01fa..93ac8ad714963bd2c8c224982d78ae0ac055b042 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -32,14 +32,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -190,8 +190,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -210,7 +210,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -222,10 +222,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index d46e4924e446633bd01b1939f61bceb215fc42d3..44e57cf176811a997dd4abf590ad6d6c821d1835 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -191,8 +191,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -211,7 +211,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -223,10 +223,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 3bcf73639d0dfee35216b86bc89b730fd63d01fa..93ac8ad714963bd2c8c224982d78ae0ac055b042 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -32,14 +32,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -190,8 +190,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -210,7 +210,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -222,10 +222,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 3bcf73639d0dfee35216b86bc89b730fd63d01fa..93ac8ad714963bd2c8c224982d78ae0ac055b042 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -32,14 +32,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -190,8 +190,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -210,7 +210,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -222,10 +222,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 21f138a35ebe698176774458d61e85c165ac281a..8ed577c13fa1502efd2413b1f191aae30c227262 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -189,8 +189,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -209,7 +209,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -221,10 +221,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 54f3b9117daae6814c910a4afc00f2d3c2529624..54b678a516403cca3f8b6f349d1cedbbf38f2410 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -188,8 +188,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -208,7 +208,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -220,10 +220,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 7f4003410bc48a5b9d997bbcea457958f86fc169..1835f7b9996ab516082815d0174785eece0ad4fc 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -21,14 +21,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 36be2eb51f034efa9ca66695224cea7fbc508bea..145211488f64c080a91702f338bce3033501800f 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -189,8 +189,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -209,7 +209,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -221,10 +221,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 245e3b7c20561bdb4688cae97ced1a23f82c7dd9..a5295f0ab0fd7b9e820168dabc4ca3e1caee5b9c 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -21,14 +21,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -180,8 +180,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -200,7 +200,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -210,10 +210,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 36be2eb51f034efa9ca66695224cea7fbc508bea..145211488f64c080a91702f338bce3033501800f 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -189,8 +189,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -209,7 +209,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -221,10 +221,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 0729cd4a6db8984b75683648d59284fe55388994..d9ea2dfa9e744d7f14affdb1a4613b2f669357a7 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -21,14 +21,14 @@ PKG_SRC_DIR = ""
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index bb8ad4b67cadff90c71ae923fe713a3466b8182a..a4eb99140077f64e24452c4e384f641db7050791 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -32,14 +32,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -185,8 +185,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -205,7 +205,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -217,10 +217,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 0729cd4a6db8984b75683648d59284fe55388994..d9ea2dfa9e744d7f14affdb1a4613b2f669357a7 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -21,14 +21,14 @@ PKG_SRC_DIR = ""
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index d4f6ce479557997082e5fbfa6d2efd3647add616..2c16cb57be8f28c6c58319de52d6bd76bb9a875e 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -186,8 +186,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -206,7 +206,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -218,10 +218,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 7f4003410bc48a5b9d997bbcea457958f86fc169..1835f7b9996ab516082815d0174785eece0ad4fc 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -21,14 +21,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 0f5e3baa11e24ff29fb940d13879654eed5d1ac5..d7b962bfa82776fca71e2303a49cf948e5f9ffac 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -189,8 +189,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -209,7 +209,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -221,10 +221,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 3bcf73639d0dfee35216b86bc89b730fd63d01fa..93ac8ad714963bd2c8c224982d78ae0ac055b042 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -32,14 +32,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -190,8 +190,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -210,7 +210,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -222,10 +222,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 1e6b799087b3266ca391beca12866af0e77adb71..aa292c3795e83842b3a33fef0f81bac408e3b979 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -181,8 +181,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -201,7 +201,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -211,10 +211,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 21f138a35ebe698176774458d61e85c165ac281a..8ed577c13fa1502efd2413b1f191aae30c227262 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -189,8 +189,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -209,7 +209,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -221,10 +221,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 0f5e3baa11e24ff29fb940d13879654eed5d1ac5..d7b962bfa82776fca71e2303a49cf948e5f9ffac 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -189,8 +189,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -209,7 +209,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -221,10 +221,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index bac23c006f419589d50787b114cf4fddab470fd1..257e5c264368ad3bc127ce6e6fe6b39b4b3b7e8e 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -182,8 +182,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -202,7 +202,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -214,10 +214,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 9b2adfeddef2d6452874bab916b002c81107f43c..c0c358eccbe00400cf69651e2937542462b771d2 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -166,8 +166,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -186,7 +186,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -196,10 +196,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 92866ab2ed6acacf72d8704056c4c25f4835332a..08d55aafea37b74455bc394308459ede3844bb7c 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 3bcf73639d0dfee35216b86bc89b730fd63d01fa..93ac8ad714963bd2c8c224982d78ae0ac055b042 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -32,14 +32,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -190,8 +190,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -210,7 +210,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -222,10 +222,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index 997d98f378383bf25adb2e29457b44aa19b30eae..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -7,7 +7,7 @@ import time
 import sys
 import subprocess
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index b30f310f466b83085a7761c6cf6c03fa851ab479..dd614f26548aab1c49ce4a34e3e02b05ef5e4971 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -215,10 +215,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index dccbae7e9daa70697cf0b02269113bd01d963945..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 138e838a5df921d1b5e169dfa18d8577dff579b8..46b3b4aa303312c354d008b28b7fe78dd8e5e6af 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -32,14 +32,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -184,8 +184,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -204,7 +204,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -216,10 +216,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 68c913eef7c6aaa595bae0e18399f532755da591..5b1718da169ebc796a16962b47a209f160af24d9 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -182,8 +182,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -202,7 +202,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -212,10 +212,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index d442317ad901dd9c07ded27b4de2ff2d47dcba45..9c17c1ad72abe8efd6676db89600e7198bd680af 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -185,8 +185,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -205,7 +205,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -217,10 +217,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 909755af3b4e03918ae3823bc036ddf994a43999..c7f89fd44607b570bbcae5447b935557cf8e590b 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -191,8 +191,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -211,7 +211,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -223,10 +223,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..d5f9fbb96f7b82ebce4068b79598df34023b9b0f 100755 (executable)
@@ -7,7 +7,7 @@ import time
 import sys
 import subprocess
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 1c685e3578706576a0adeb5b84b7c9326188d06e..31bd49daf1cf07d1034d4ddecdae69a9e93129bf 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -195,8 +195,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -215,7 +215,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -227,10 +227,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..f70351a9bca5ce6c87032da6adacd41a268563bc 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 302423c2a5aa058efa040568a45461c17ffeeb56..9dff63be5ebff1fac5be559af7263d6d0851a2b1 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -187,8 +187,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -207,7 +207,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -219,10 +219,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 296a5a3e709098694d18b54260ece2e59b5d56cd..453aef60bd50a565d5f607281cdfbef751e725f0 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -174,8 +174,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -194,7 +194,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -204,10 +204,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 36be2eb51f034efa9ca66695224cea7fbc508bea..145211488f64c080a91702f338bce3033501800f 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -189,8 +189,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -209,7 +209,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -221,10 +221,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 302423c2a5aa058efa040568a45461c17ffeeb56..9dff63be5ebff1fac5be559af7263d6d0851a2b1 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -187,8 +187,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -207,7 +207,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -219,10 +219,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 296a5a3e709098694d18b54260ece2e59b5d56cd..453aef60bd50a565d5f607281cdfbef751e725f0 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -174,8 +174,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -194,7 +194,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -204,10 +204,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 1c685e3578706576a0adeb5b84b7c9326188d06e..31bd49daf1cf07d1034d4ddecdae69a9e93129bf 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -195,8 +195,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -215,7 +215,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -227,10 +227,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 1e6b799087b3266ca391beca12866af0e77adb71..aa292c3795e83842b3a33fef0f81bac408e3b979 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -181,8 +181,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -201,7 +201,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -211,10 +211,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 138a08bfec319c6a5d5a7b2df65cd16f8e26d5c3..6d00172cdbcff1093f2c9f2469e8b346bf1c4a71 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -188,8 +188,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -208,7 +208,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -220,10 +220,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..d5f9fbb96f7b82ebce4068b79598df34023b9b0f 100755 (executable)
@@ -7,7 +7,7 @@ import time
 import sys
 import subprocess
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 3bcf73639d0dfee35216b86bc89b730fd63d01fa..5e4c9171301b7c5b257d0c1fa5d98bf89659e08c 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -32,14 +32,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -190,8 +190,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -210,7 +210,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -222,10 +222,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..f70351a9bca5ce6c87032da6adacd41a268563bc 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index d725d5685cf0da4f4cceec8dbafeeca89c27ebfc..c20c9326d3ba4ab9cfb6192aa37d5e1bd4208ea4 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -957,7 +957,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 0f5e3baa11e24ff29fb940d13879654eed5d1ac5..d7b962bfa82776fca71e2303a49cf948e5f9ffac 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -189,8 +189,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -209,7 +209,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -221,10 +221,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index b50fcca5d1a9a39a06857b21701111ae84722674..225affe5a3ff4e0d27bbc3695f245a9a795c7df7 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -29,18 +29,18 @@ def userCheck():
         GLOVAL_OPT="--global"
     else:
         GLOVAL_OPT=""
-
+        
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -64,6 +64,8 @@ def getUSERID():
     return doCMD(cmd)
 
 
+
+
 def getPKGID(pkg_name=None):
     if PARAMETERS.mode == "SDB":
         cmd = "sdb -s %s shell %s" % (
@@ -189,8 +191,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -209,7 +211,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -221,10 +223,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 8123675e6b0e0e55dfad30fda156604ceda72722..88104a59d3c1f1a6128534f609c1f0af93269824 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -30,17 +30,16 @@ def userCheck():
     else:
         GLOVAL_OPT=""
 
-
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -64,6 +63,8 @@ def getUSERID():
     return doCMD(cmd)
 
 
+
+
 def getPKGID(pkg_name=None):
     if PARAMETERS.mode == "SDB":
         cmd = "sdb -s %s shell %s" % (
@@ -188,8 +189,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -208,7 +209,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -220,10 +221,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 6e0726097c3b3cf38821ce5ab9232b33f5fdbf78..ef38eb600f18f1c170e0054cddaf87319822cc58 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -37,7 +37,7 @@ def askpolicyremoving():
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
    
-    print (pkg_id)
+    print pkg_id
     print (os.getcwd())
     print (os.path.dirname(os.path.realpath(__file__)) )
     if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
@@ -49,14 +49,14 @@ def askpolicyremoving():
        
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -205,8 +205,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -225,7 +225,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -237,10 +237,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index d636bee034d8504fbfee33e3d6fe297f4e9bee1a..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -6,8 +6,8 @@ import glob
 import time
 import sys
 import subprocess
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 8e0d9ef1ac5649b442f894d42aea36e60df8bd95..e32732b340da4841aa7a480e4c2e53dbd8f4b635 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -188,8 +188,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -208,7 +208,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -220,10 +220,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ace8cbba96610eaf7e44d169716ce4fc3b921873..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -7,8 +7,8 @@ import time
 import sys
 import subprocess
 import string
-from optparse import OptionParser, make_option
-import configparser
+from optparse import OptionParser, make_option\r
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 90541074075dcb33865a92d798b90edc56bdba98..9b50ab82d20e017f7043a81e4c10eeecb0e764ce 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -160,8 +160,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -180,7 +180,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -190,10 +190,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 635947096db8228fb2a0790daa038003fb2c760a..2b58ff6078903e030842bdae469b87ecedcd6028 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -162,8 +162,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -182,7 +182,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -192,10 +192,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 3a6af9945e361faaa2018b7f3cb797d61b20de83..f328736e354a2d31bd40e2665a5d1b9435793fad 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -175,8 +175,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -195,7 +195,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -205,10 +205,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 68a7a7cb45c55eb2ece0852c00fe885ea953d207..7fd56564471e1f106c8d92f058b03641362a8c2b 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -175,8 +175,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -195,7 +195,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -205,10 +205,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ec7da2954d29c87adc8d590d9089b26d77e12eba..24141f7f42e73cf01079f878080f69b84328b4e7 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -177,8 +177,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -197,7 +197,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -207,10 +207,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index fbe31c4928b700901e20e8f9ebfe57cf63475021..ccd694af4d5dfa92b257d1efbd1e7099841482c8 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -177,8 +177,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -197,7 +197,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -207,10 +207,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 59454337abbea467d97b1cb944584e55d201739c..d26375e7166eb9b963be430f4f6129aacd472c6a 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -162,8 +162,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -182,7 +182,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -192,10 +192,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 635947096db8228fb2a0790daa038003fb2c760a..2b58ff6078903e030842bdae469b87ecedcd6028 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -162,8 +162,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -182,7 +182,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -192,10 +192,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 617c1f44c6211eb847c8384a9073bb65cbcc0df4..43f110bcea820de3827a24812eed3f90c4dcd623 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -172,8 +172,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -192,7 +192,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -202,10 +202,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 99d1a488c60d1df9b6ddca590184ccadb4a2ff1b..9cf8713a38d1b777c1c9e78e5d0445804f080a53 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -169,8 +169,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -189,7 +189,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -199,10 +199,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 9604d78981640a8cafc17b1696cf21e575cf8c1a..489c5efc918da7f2b9a096276857816b9fa33fca 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -169,8 +169,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -189,7 +189,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -199,10 +199,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 89d4de707d4721d2fa21d64b35f9d7915dc3b4a2..e4ea5495f8eee09a358794a0298c58b8070746ec 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -177,8 +177,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -197,7 +197,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -207,10 +207,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 109ff4430c872a58a6915663d3ac435f4d3fe183..a7ea7b578c1e04ebd88e0d8d11686bf75c8d4cea 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -172,8 +172,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -192,7 +192,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -202,10 +202,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 617c1f44c6211eb847c8384a9073bb65cbcc0df4..43f110bcea820de3827a24812eed3f90c4dcd623 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -172,8 +172,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -192,7 +192,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -202,10 +202,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 617c1f44c6211eb847c8384a9073bb65cbcc0df4..43f110bcea820de3827a24812eed3f90c4dcd623 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -172,8 +172,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -192,7 +192,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -202,10 +202,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ceefce39d65947361b2a1582de8cbe4327247cb0..58fa04cbf56b3b8b142a5c5922aa70c6f66f1d1b 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -184,8 +184,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -204,7 +204,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -214,10 +214,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 1d56a7d9128fe6f381b89363f38aab42b0024422..24c3069351f76f76b795458ae6e243dc5b5ffd6f 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -184,8 +184,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -204,7 +204,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -214,10 +214,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 3f6a9265ee7534722d782d3139728d1978740a6a..6fce2fba5c8fd341c6be4daac3371a68231a70a8 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -176,8 +176,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -196,7 +196,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -206,10 +206,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 3ec8311ff6d85be2c7faf71d6b8a8cb59309c09a..25ce6831d6c38f408266cd22cc660e3b4b996759 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -176,8 +176,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -196,7 +196,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -206,10 +206,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 617c1f44c6211eb847c8384a9073bb65cbcc0df4..43f110bcea820de3827a24812eed3f90c4dcd623 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -172,8 +172,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -192,7 +192,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -202,10 +202,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 59454337abbea467d97b1cb944584e55d201739c..d26375e7166eb9b963be430f4f6129aacd472c6a 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -162,8 +162,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -182,7 +182,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -192,10 +192,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 635947096db8228fb2a0790daa038003fb2c760a..2b58ff6078903e030842bdae469b87ecedcd6028 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -162,8 +162,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -182,7 +182,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -192,10 +192,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f11e570b789835a138ac679b5af0652f488a034a..c21cdecdaedb5c0a96f8ea95b0857fdc1efa9b93 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -177,8 +177,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -197,7 +197,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -207,10 +207,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index ebb8353d1eedf6800fac4a64c57dcff782232bda..afef62e723d39dd1eb9179236c87fc1c3b1c0c5a 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -180,8 +180,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -200,7 +200,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -210,10 +210,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f2417bdad8da8f51996c6eaaaa75150b36450481..e7aeac9ec9c849f80bdcecb8ded5984a2f9cf01a 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -169,8 +169,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -189,7 +189,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -199,10 +199,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index cadbfcc446bc6f862877ebf4a2f7ffd49d3910e5..8a8ed798d188ff9c8938140dcf001c0bdccaeb00 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -169,8 +169,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -189,7 +189,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -199,10 +199,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 87ca4d61223a0b2292346b32ec1b13e10227ff8f..183d9078e8c022482637e723e940de4ac8fc0582 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -139,8 +139,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -159,7 +159,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -169,10 +169,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 617c1f44c6211eb847c8384a9073bb65cbcc0df4..43f110bcea820de3827a24812eed3f90c4dcd623 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -172,8 +172,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -192,7 +192,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -202,10 +202,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 617c1f44c6211eb847c8384a9073bb65cbcc0df4..43f110bcea820de3827a24812eed3f90c4dcd623 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -172,8 +172,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -192,7 +192,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -202,10 +202,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 617c1f44c6211eb847c8384a9073bb65cbcc0df4..43f110bcea820de3827a24812eed3f90c4dcd623 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -172,8 +172,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -192,7 +192,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -202,10 +202,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5b9572769a2d8415a48c007050e151b1224d45e1..fedb04bebd23ce8e315d2eaad8073377c5275e18 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -170,8 +170,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -190,7 +190,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -200,10 +200,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 60a188baa7d629a6723bc8102794f3f8c5a78509..8e14d7da571773e8a34f2b1d172a3d344c4a5ae5 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -170,8 +170,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -190,7 +190,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -200,10 +200,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 617c1f44c6211eb847c8384a9073bb65cbcc0df4..43f110bcea820de3827a24812eed3f90c4dcd623 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -172,8 +172,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -192,7 +192,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -202,10 +202,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5b9572769a2d8415a48c007050e151b1224d45e1..fedb04bebd23ce8e315d2eaad8073377c5275e18 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -170,8 +170,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -190,7 +190,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -200,10 +200,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 60a188baa7d629a6723bc8102794f3f8c5a78509..8e14d7da571773e8a34f2b1d172a3d344c4a5ae5 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -170,8 +170,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -190,7 +190,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -200,10 +200,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 773707bb2217c7448bb4309b2764c04c57634501..7574ae1d7b8dbaf56f0fea3eb2fed1199c5e5a1b 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -172,8 +172,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -192,7 +192,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -202,10 +202,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 88d4d47ed78756d710f20e61b4345d5b7ca04b5e..6bc5749c3943808886390660f5bd85b27b752feb 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index b7ded08577a191fe7737dffdb586ab186c4a3375..dc5c117506f838e31408c42393cef115ce2c8711 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -172,8 +172,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -192,7 +192,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -202,10 +202,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 8515a88b8b7254a19c263e387c11a4ce27b3ed1d..db5440cb74b5cb5b72d6e9014f235f2343946008 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -177,8 +177,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -197,7 +197,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -207,10 +207,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 929bf5c3fe48cb0eccb6ddcd0cef4dd1b66c124c..eedbf88450cc4dffa05e99a2119b17a95b48ec76 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -177,8 +177,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -197,7 +197,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -207,10 +207,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 5fcedb9d91f24fe5a9a5da8222042cef2d9f323b..a13f660a9139880755ad26f3165b84b1efc8b760 100755 (executable)
@@ -16,14 +16,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -76,8 +76,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -88,11 +88,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 44eca3371ac3a23502ae256c563b99105c27202b..918e9561d42cd2e84992a3e2b6829c13ebb2d682 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -178,8 +178,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -198,7 +198,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -208,10 +208,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 11cdd8e23af8dbb8ce8b028818ce97a39285f3c8..62f961bb9e156b4c452bb601d8cd2804400dbb17 100755 (executable)
@@ -20,14 +20,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -179,8 +179,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -199,7 +199,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -209,10 +209,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 997d98f378383bf25adb2e29457b44aa19b30eae..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -7,7 +7,7 @@ import time
 import sys
 import subprocess
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 6e0726097c3b3cf38821ce5ab9232b33f5fdbf78..ef38eb600f18f1c170e0054cddaf87319822cc58 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -37,7 +37,7 @@ def askpolicyremoving():
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
    
-    print (pkg_id)
+    print pkg_id
     print (os.getcwd())
     print (os.path.dirname(os.path.realpath(__file__)) )
     if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
@@ -49,14 +49,14 @@ def askpolicyremoving():
        
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -205,8 +205,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -225,7 +225,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -237,10 +237,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index dccbae7e9daa70697cf0b02269113bd01d963945..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index 997d98f378383bf25adb2e29457b44aa19b30eae..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -7,7 +7,7 @@ import time
 import sys
 import subprocess
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 8e0d9ef1ac5649b442f894d42aea36e60df8bd95..e32732b340da4841aa7a480e4c2e53dbd8f4b635 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -188,8 +188,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -208,7 +208,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -220,10 +220,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index dccbae7e9daa70697cf0b02269113bd01d963945..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index 22bf5e2a1c4f3f5593f9cc18f1af5ea2c927d073..e48cdc1748839ecd1b864814a8f96db9b166898c 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index 10a22ab09119901cdc3a6fe8d2977d7ccdd2d59f..e10865f470ba1f7cfcafcabfaaf5515f49fa6852 100755 (executable)
@@ -4,7 +4,7 @@
 import os
 import sys
 import re
-import subprocess
+import commands
 import glob
 import fnmatch
 import string
@@ -14,8 +14,8 @@ from optparse import OptionParser
 
 def iterfindfiles (path, fnexp):
     for root, dirs, files in os.walk(path):
-        for filename in fnmatch.filter(files, fnexp):
-            yield os.path.join(root, filename)
+           for filename in fnmatch.filter(files, fnexp):
+                   yield os.path.join(root, filename)
 
 def count_upstream (string = None, str_entry=None ):
     if string.find('/%s/' % str_entry) >= 0:
@@ -94,9 +94,9 @@ def analy_test_file(file_path = None):
                      p3_auto_webdriver += 1*subcase
                  else:
                    p3_manual += 1*subcase
-    except Exception as e:
-         print ("Got error when analy test files: %s" % e)
-         print (file_path)
+    except Exception, e:
+         print "Got error when analy test files: %s" % e
+         print file_path
 
     p0_number = p0_auto + p0_manual
     p1_number = p1_auto + p1_manual
@@ -125,8 +125,8 @@ def get_upstream(file_path):
                     n_upstream += 1
                     if element not in exist_upstream :
                        exist_upstream.append(element)
-    except Exception as e:
-        print (e)
+    except Exception, e:
+        print e
 
     upstream = ""
     for element in exist_upstream:
@@ -151,8 +151,8 @@ def get_case_status(file_path):
         fp.write(content)
         fp.write("\n")
         fp.close()
-    except Exception as e:
-        print ("Got error when get case status: %s" % e)
+    except Exception, e:
+        print "Got error when get case status: %s" % e
 
 def init_result_file():
     title = "Suite_name,Total,Total_auto,Total_auto_webdriver,Total_manual,P0,P0_auto,P0_auto_webdriver,P0_manual,P1,P1_auto,\
@@ -166,8 +166,8 @@ Integrated_Upstream_TCs,Upstream_Resource"
         fp.write(title)
         fp.write("\n")
         fp.close()
-    except Exception as e:
-        print ("Got error when init analy file : %s" % e)
+    except Exception, e:
+        print "Got error when init analy file : %s" % e
 
 def main():
     try:
@@ -184,7 +184,7 @@ def main():
         
         init_result_file()
         if len(sys.argv) == 1:
-            sys.argv.append("-h")
+                   sys.argv.append("-h")
         (PARAMETERS, args) = opts_parser.parse_args()
         if PARAMETERS.suitesdir:
             for filename in iterfindfiles("%s" % PARAMETERS.suitesdir, "tests.full.xml"):
@@ -193,8 +193,8 @@ def main():
         if PARAMETERS.xmlfile:
             get_case_status(PARAMETERS.xmlfile)   
     except Exception as e:
-        print ("Got error: %s, exit" % e)
+        print "Got error: %s, exit" % e
 
 if __name__ == '__main__':
-    main()
+       main()
 
index bdfdb207da941214883b6589d44165ec1c074c58..4447e4d65a1c8aad0bdcd5ad43cef5e355f01198 100755 (executable)
@@ -65,11 +65,11 @@ class ColorFormatter(logging.Formatter):
 
 def csv2full(csv_path, split_sign):
     if not os.path.isfile(csv_path):
-        print ('%s is not a file' % csv_path)
+        print '%s is not a file' % csv_path
         return
     name, ext = os.path.splitext(csv_path)
     if not ext == '.csv':
-        print ('%s is not a csv' % csv_path)
+        print '%s is not a csv' % csv_path
         return
     LOG.info("+Convert csv to xml start ...")
     csv_file = file(csv_path, 'rb')
@@ -139,7 +139,7 @@ def echo_about():
     This function will print the user guide and stop toolkit.
     """
     about = 'csv2xml V1.0\n-c <path>  |  Convert csv file to tests.full.xml and tests.xml\n'
-    print (about)
+    print about
     sys.exit()
 
 def main():
@@ -161,7 +161,7 @@ def main():
     elif sys_name == 'Linux':
         split_sign = '/'
     if len(sys.argv) != 3:
-        print ('Error: No enough argv!')
+        print 'Error: No enough argv!'
         echo_about()
     else:
         {'-c': lambda : csv2full(sys.argv[2], split_sign)}[sys.argv[1]]()
index 5a6d3ba2c28df90f33a7d062a8f3a93db6bcd993..07de9c35a9f99b2a33bb37a7717b195a1a43c866 100755 (executable)
@@ -65,16 +65,16 @@ class ColorFormatter(logging.Formatter):
 
 def xml2csv(xml_path, split_sign):
     if not os.path.isfile(xml_path):
-        print ('%s is not a file' % xml_path)
+        print '%s is not a file' % xml_path
         return
     name, ext = os.path.splitext(xml_path)
 
     if not ext == '.xml':
-        print ('%s is not a xml' % xml_path)
+        print '%s is not a xml' % xml_path
         return
     if not name.split(split_sign)[-1] == 'tests.full':
-        print (name)
-        print ('%s is not tests.full.xml' % xml_path)
+        print name
+        print '%s is not tests.full.xml' % xml_path
         return
     LOG.info("+Convert xml to csv start ...")
     folder = os.path.dirname(xml_path)
@@ -152,7 +152,7 @@ def echo_about():
     This function will print the user guide and stop toolkit.
     """
     about = 'xml2csv V1.0\n-c <path>  |  Convert tests.full.xml to csv file\n'
-    print (about)
+    print about
     sys.exit()
 
 def main():
@@ -174,7 +174,7 @@ def main():
     elif sys_name == 'Linux':
         split_sign = '/'
     if len(sys.argv) != 3:
-        print ('Error: No enough argv!')
+        print 'Error: No enough argv!'
         echo_about()
     else:
         {
index 9794b2c8b1725646a07c9452a38811a926ac327b..4165ec9d6951df855f42197c477363fc8089a2ec 100755 (executable)
@@ -72,7 +72,7 @@ def verify_xml(xml_dir, split_sign):
         else:
             name, ext = os.path.splitext(xml_dir)
             if not ext == '.xml':
-                print ('%s is not a xml' % xml_path)
+                print '%s is not a xml' % xml_path
                 return
             else:
                 verify_path(xml_dir, split_sign)
@@ -143,7 +143,7 @@ def echo_about():
     This function will print the user guide and stop toolkit.
     """
     about = 'xmlverifier V1.0\n-v <path>  |  Verify case path, id, purpose and set type are right\n'
-    print (about)
+    print about
     sys.exit()
 
 def main():
@@ -165,7 +165,7 @@ def main():
     elif sys_name == 'Linux':
         split_sign = '/'
     if len(sys.argv) != 3:
-        print ('Error: No enough argv!')
+        print 'Error: No enough argv!'
         echo_about()
     else:
         {'-v': lambda : verify_xml(sys.argv[2], split_sign)}[sys.argv[1]]()
index 997d98f378383bf25adb2e29457b44aa19b30eae..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -7,7 +7,7 @@ import time
 import sys
 import subprocess
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 6e0726097c3b3cf38821ce5ab9232b33f5fdbf78..ef38eb600f18f1c170e0054cddaf87319822cc58 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -37,7 +37,7 @@ def askpolicyremoving():
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
    
-    print (pkg_id)
+    print pkg_id
     print (os.getcwd())
     print (os.path.dirname(os.path.realpath(__file__)) )
     if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
@@ -49,14 +49,14 @@ def askpolicyremoving():
        
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -205,8 +205,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -225,7 +225,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -237,10 +237,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index dccbae7e9daa70697cf0b02269113bd01d963945..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index 997d98f378383bf25adb2e29457b44aa19b30eae..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -7,7 +7,7 @@ import time
 import sys
 import subprocess
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 8e0d9ef1ac5649b442f894d42aea36e60df8bd95..e32732b340da4841aa7a480e4c2e53dbd8f4b635 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -188,8 +188,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -208,7 +208,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -220,10 +220,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index dccbae7e9daa70697cf0b02269113bd01d963945..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index 997d98f378383bf25adb2e29457b44aa19b30eae..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -7,7 +7,7 @@ import time
 import sys
 import subprocess
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 6e0726097c3b3cf38821ce5ab9232b33f5fdbf78..ef38eb600f18f1c170e0054cddaf87319822cc58 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -37,7 +37,7 @@ def askpolicyremoving():
             if file.endswith(".wgt"):
                 pkg_id = getPKGID(os.path.basename(os.path.splitext(file)[0]))
    
-    print (pkg_id)
+    print pkg_id
     print (os.getcwd())
     print (os.path.dirname(os.path.realpath(__file__)) )
     if not doRemoteCopy("%s/askpolicy.sh" % SCRIPT_DIR, "%s" % (SRC_DIR)):
@@ -49,14 +49,14 @@ def askpolicyremoving():
        
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -205,8 +205,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -225,7 +225,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     userCheck()
@@ -237,10 +237,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index dccbae7e9daa70697cf0b02269113bd01d963945..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir:
index 997d98f378383bf25adb2e29457b44aa19b30eae..31210db162ff0d25d19c69d63e5de2a6f552b4e7 100755 (executable)
@@ -7,7 +7,7 @@ import time
 import sys
 import subprocess
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -17,14 +17,14 @@ ADB_CMD = "adb"
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -77,8 +77,8 @@ def main():
             "-u", dest="buninstpkg", action="store_true", help="Uninstall package")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.device:
@@ -89,11 +89,11 @@ def main():
                 break
 
     if not PARAMETERS.device:
-        print ("No device found")
+        print "No device found"
         sys.exit(1)
 
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index 8e0d9ef1ac5649b442f894d42aea36e60df8bd95..e32732b340da4841aa7a480e4c2e53dbd8f4b635 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -33,14 +33,14 @@ def userCheck():
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -188,8 +188,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -208,7 +208,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
     
     userCheck()
@@ -220,10 +220,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index dccbae7e9daa70697cf0b02269113bd01d963945..211d24c73b20b5b3e5025847a9233ca625463653 100755 (executable)
@@ -8,7 +8,7 @@ import sys
 import subprocess
 import string
 from optparse import OptionParser, make_option\r
-import configparser
+import ConfigParser
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -16,7 +16,7 @@ PKG_NAME = os.path.basename(SCRIPT_DIR)
 PARAMETERS = None
 #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket"
 TCT_CONFIG_FILE = "/opt/tools/TCT_CONFIG"
-tct_parser = configparser.ConfigParser()
+tct_parser = ConfigParser.ConfigParser()
 tct_parser.read(TCT_CONFIG_FILE)
 SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30')
 PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
@@ -24,14 +24,14 @@ PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME)
 
 def doCMD(cmd):
     # Do not need handle timeout in this short script, let tool do it
-    print ("-->> \"%s\"" % cmd)
+    print "-->> \"%s\"" % cmd
     output = []
     cmd_return_code = 1
     cmd_proc = subprocess.Popen(
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         if output_line == '' and cmd_return_code != None:
             break
@@ -183,8 +183,8 @@ def main():
             "-a", dest="user", action="store", help="User name")
         global PARAMETERS
         (PARAMETERS, args) = opts_parser.parse_args()
-    except Exception as e:
-        print ("Got wrong option: %s, exit ..." % e)
+    except Exception, e:
+        print "Got wrong option: %s, exit ..." % e
         sys.exit(1)
 
     if not PARAMETERS.user:
@@ -203,7 +203,7 @@ def main():
         PARAMETERS.mode = "SSH"
 
     if not PARAMETERS.device:
-        print ("No device provided")
+        print "No device provided"
         sys.exit(1)
 
     user_info = getUSERID()
@@ -213,10 +213,10 @@ def main():
         userid = user_info[1][0]
         XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%s/dbus/user_bus_socket"%str(userid)
     else:
-        print ("[Error] cmd commands error : %s" % str(user_info[1]))
+        print "[Error] cmd commands error : %s"%str(user_info[1])
         sys.exit(1)
     if PARAMETERS.binstpkg and PARAMETERS.buninstpkg:
-        print ("-i and -u are conflict")
+        print "-i and -u are conflict"
         sys.exit(1)
 
     if PARAMETERS.buninstpkg:
index f1f0cb470fad677077cced4db9cf44015525827c..e29187a0bae2e2dce107adc8fe9ecb8898559397 100755 (executable)
@@ -40,10 +40,10 @@ import logging
 import zipfile
 import signal
 import subprocess
-import imp
 from optparse import OptionParser
 
-imp.reload(sys)
+reload(sys)
+sys.setdefaultencoding('utf8')
 
 TOOL_VERSION = "v0.1"
 VERSION_FILE = "VERSION"
@@ -363,7 +363,7 @@ def doCMDWithOutput(cmd, time_out=DEFAULT_CMD_TIMEOUT):
         cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     while True:
-        output_line = cmd_proc.stdout.readline().decode("UTF-8").strip("\r\n")
+        output_line = cmd_proc.stdout.readline().strip("\r\n")
         cmd_return_code = cmd_proc.poll()
         elapsed_time = time.time() - pre_time
         if cmd_return_code is None:
@@ -938,7 +938,7 @@ def main():
         sys.exit(1)
 
     if BUILD_PARAMETERS.bversion:
-        LOG.info("Version: %s" % TOOL_VERSION)
+        print "Version: %s" % TOOL_VERSION
         sys.exit(0)
 
     if not BUILD_PARAMETERS.srcdir: