**For example:**
- If user has entered webrtc module then tool will search for its header file media/webrtc.h in tizeniot-9.0-device.core.private.20230823_131527 rootstrap.
- > Header file should be present at path /home/sri/tizen-studio/platforms/tizen-9.0/tizeniot/rootstraps/tizeniot-9.0-device.core.private.20230823_131527/usr/include, otherwise tool will run into error.
+ If user has entered webrtc module then tool will search for its header file media/webrtc.h in tizeniot-8.0-device.core.private.20230823_131527 rootstrap.
+ > Header file should be present at path /home/sri/tizen-studio/platforms/tizen-8.0/tizeniot/rootstraps/tizeniot-8.0-device.core.private.20230823_131527/usr/include, otherwise tool will run into error.
6. API's for which you need to create TCs, those api's declaration need to be present in the header files mentioned in Module_Header_Mapping.csv file
--- /dev/null
+{\r
+ "intents": [\r
+ {\r
+ "tag": "request",\r
+ "patterns": ["Hi, I have an ACR request", "I want you to add new utc"],\r
+ "responses": [\r
+ "새로운 모듈에 대한 요청입니까? 아니면 추가 API 커버리지에 대한 요청입니까?"\r
+ ]\r
+ },\r
+ {\r
+ "tag": "existingmodule",\r
+ "patterns": [\r
+ "Its existing module, need to add new TCs",\r
+ "webrtc module request to add two new TCs"\r
+ ],\r
+ "responses": ["\nModule 이름: \n\n의 형태로 module 이름을 제공하십시오 [ 탐색하려면 'Back'를 입력하십시오]"]\r
+ },\r
+ {\r
+ "tag": "modulename",\r
+ "patterns": ["Module name:", "module name is dlog"],\r
+ "responses": [\r
+ "API 정보를 \nAPI 이름: API_NAME_1 API_NAME_2 \n\n 형식으로 제공하십시오[ 탐색하려면 'Back'를 입력하십시오]"\r
+ ]\r
+ },\r
+ {\r
+ "tag": "apiinfo",\r
+ "patterns": [\r
+ "API names are as follows",\r
+ "API pre-post conditions are as follows"\r
+ ],\r
+ "responses": ["rootstrap에서 찾았습니다 ,감사합니다", "rootstrap에는없습니다"]\r
+ },\r
+ {\r
+ "tag": "prepostinfo",\r
+ "patterns": [\r
+ "Pre-condition API names are as follows",\r
+ "API pre-post conditions are as follows"\r
+ ],\r
+ "responses": ["pre/post API에 대한 세부 정보를 제공해 주셔서 감사합니다.\nSorry, 그러나 내부 오류가 있습니다. 도구를 다시 실행십시오"]\r
+ },\r
+ {\r
+ "tag": "tcwritelocation",\r
+ "patterns": [\r
+ "FILE name: utc-media-webrtc.c",\r
+ "FILE name:"\r
+ ],\r
+ "responses": ["입력을 제공해 주셔서 감사합니다."]\r
+ },\r
+ {\r
+ "tag": "newmodule",\r
+ "patterns": [\r
+ "Its request for new module addition",\r
+ "New module utc needs to be added"\r
+ ],\r
+ "responses": [\r
+ "\nModule 이름: \n\n의 형태로 module 이름을 제공하십시오 [ 탐색하려면 'Back'를 입력하십시오]"\r
+ ]\r
+ },\r
+ {\r
+ "tag": "negativetc",\r
+ "patterns": [\r
+ "Do you want to add negative TCs? \nType Yes or No",\r
+ "Add a negative TC \nType Yes or No"\r
+ ],\r
+ "responses": [\r
+ "입력을 잘못된 것 같습니다. 다시 시도하십시오.감사합니다"\r
+ ]\r
+ },\r
+ {\r
+ "tag": "tizenversion",\r
+ "patterns": ["Tizen 6.0", "Tizen 6.5", "Tizen 7.0", "all"],\r
+ "responses": ["\nModule 이름: \n\n의 형태로 module 이름을 제공하십시오 [ 탐색하려면 'Back'를 입력하십시오]"]\r
+ },\r
+ {\r
+ "tag": "modulenotfound",\r
+ "patterns": ["No"],\r
+ "responses": [\r
+ "module을 찾을 수 없습니다 \n 모듈 이름을 \n모듈 이름 형식으로 다시 입력하십시오",\r
+ "module명 다시 확인하십시오. 입력한 module명이 없습니다.\n 모듈 이름을 \n모듈 이름: \n\n의 형태로 다시 입력해 주세요 [탐색하려면 'Back'를 입력하십시오]"\r
+ ]\r
+ },\r
+ {\r
+ "tag": "buildwrittentc",\r
+ "patterns": ["No"],\r
+ "responses": [\r
+ "감사합니다!!",\r
+ "입력을 제공해 주셔서 감사합니다."\r
+ ]\r
+ },\r
+ {\r
+ "tag": "installwrittentc",\r
+ "patterns": ["No"],\r
+ "responses": [\r
+ "감사합니다!!",\r
+ "입력을 제공해 주셔서 감사합니다."\r
+ ]\r
+ },\r
+ {\r
+ "tag": "buildparameters",\r
+ "patterns": ["ARCH: armv7l, Profile: mobile", "ARCH: x86, Profile: wearable"],\r
+ "responses": [\r
+ "\nARCH: ARCHITECTURE_NAME, PROFILE: PROFILE_NAMEE의 형식으로 TC를 구축하고자 하는 아키텍처 및 프로파일을 제공하십시오."\r
+ ]\r
+ },\r
+ {\r
+ "tag": "launchtctmgr",\r
+ "patterns": ["Yes, I want to execute the TCs"],\r
+ "responses": [\r
+ "tpk 설치중…"\r
+ ]\r
+ },\r
+ {\r
+ "tag": "greetings",\r
+ "patterns": ["Hi", "Hello", "Hey"],\r
+ "responses": [\r
+ "안녕하세요, 이것은 새로운 모듈에 대한 요청입니까 아니면 기존 모듈에 대한 요청입니까?"\r
+ ]\r
+ },\r
+ {\r
+ "tag": "goback",\r
+ "patterns": ["Back"],\r
+ "responses": [\r
+ "Going Back"\r
+ ]\r
+ },\r
+ {\r
+ "tag": "none",\r
+ "patterns": [\r
+ ""\r
+ ],\r
+ "responses": [\r
+ "오류!! \nInvalid Input. 다시 작성을 시도하십시오"\r
+ ]\r
+\r
+ },\r
+ {\r
+ "tag": "featureinfo",\r
+ "patterns": ["feature"],\r
+ "responses": [\r
+ "위 API에 대해 Pre 및 Post 조건 API를 추가하고 싶으신가요?\n (Yes or No)\n\n [탐색하려면 'Back'를 입력하십시오]"\r
+ ]\r
+ },\r
+ {\r
+ "tag": "supportsys",\r
+ "patterns": ["Support", "I want support for issue"],\r
+ "responses": [\r
+ "아래 옵션 중 선택하십시오. \n\na. Build 이슈\nb. Install 이슈\nc. 환경 설정\nd. Rootstrap install\ne. 다른 문제 \n\n[ 탐색하려면 'Back'를 입력하십시오]"\r
+ ]\r
+ },\r
+ {\r
+ "tag": "envsetupsupport",\r
+ "patterns": ["I need help for environment setup", "I want support for setup issue"],\r
+ "responses": [\r
+ "환경설정\n\na. https://developer.tizen.org/development/tizen-studio/download\n에서 TizenStudio (Tizen Studio 3.7) 다운로드 및 install\nb. ITVOC\n을 사용하여 JAVA 8/9 install\nc. TizenStudio 1대 설치, Launch Package Manager\n-In Package Manager 아래 변경 사항 :\n-Package Repository: http://107.110.2.162/packages\n- Distribution: tizen_studio_5.5\n [Linux machine에서 package manager 사용하여 rootstrap을 업데이트/install함에 따라]\nd. 5.5 emulator 출시되고 잘 작동하고 있는지 확인하십시오.\n\n[ 탐색하려면 'Back'를 입력하십시오]"\r
+ ]\r
+ },\r
+ {\r
+ "tag": "rootstrapsupport",\r
+ "patterns": ["I need help for installing rootstrap", "I want support for rootstrap installation issue"],\r
+ "responses": [\r
+ "Rootstrap install 가이드/단계:\n\na. sdk-build repo 코드 다운로드 : \ngit 클론 ssh://[user-id]@review.tizen.org:29418/sdk/tools/sdk-build -b tizen~/sdk-build\ngit checkout tizen\nexport PATH=~/sdk-build:$PATH'\n\nb. 'add-on' install (Tizeniot의 경우에만 이 점 (b)를 모바일, 웨어러블에 참조하지 마세요) \nadd-on 다운로드 경로 : http://10.113.245.23/download/tct/template/tizeniot/\n명령어 : ~/sdk-build/pkg-cli install-file -P <add_on_name> -l~/tizen-studio -force\n\nc. tizeniot rootstrap install : \npath : https://bart.sec.samsung.net/artifactory/download-tizen-generic/snapshots/TIZEN/Tizen/Tizen-Unified/\n명령어 : ~/sdk-build/pkg-cli install-file -P <rootstrap_zip_name> -l~/tizen-studio -force\n\n[ 탐색하려면 'Back'를 입력하십시오]"\r
+ ]\r
+ },\r
+ {\r
+ "tag": "buildsupport",\r
+ "patterns": ["I need help regarding build issue", "I want support for build related issue"],\r
+ "responses": [\r
+ "아래 텍스트 박스에 Build 오류 라인을 입력하여 LOG: BUILD_FAIL_LOGS\n\n의 분석하십시오.\n\n[ 탐색하려면 'Back'를 입력하십시오]"\r
+ ]\r
+ },\r
+ {\r
+ "tag": "buildlogdebug",\r
+ "patterns": ["Build Logs:"],\r
+ "responses": [\r
+ "Build 실패는 암묵적 선언, 키스토어 암호 오류 등 여러 가지 이유 때문일 수 있습니다.\n\n[ 탐색하려면 'Back'를 입력하십시오]"\r
+ ]\r
+ },\r
+ {\r
+ "tag": "installsupport",\r
+ "patterns": ["I need help regarding install isuue"],\r
+ "responses": [\r
+ "Install 실패는 python버전, workspace에 TPK가 존재하지 않는 등 여러 가지 이유 때문일 수 있습니다. 문제를 해결하기 위해 아래 단계를 따르십시오. -\n\n- Python 버전이 3.0보다 큰지 확인하시고 그렇지 않다면 버전을 업그레이드하십시오. \n\n- Workspace 폴더 내부에 TPK가 생성되어 있는지확인하십시오. 생성되지 않으면 빌드를 다시 시도하십시오.\n\n [탐색하려면 'Back'를 입력하십시오]"\r
+ ]\r
+ }\r
+ ]\r
+}\r
--- /dev/null
+key,Val_English,Val_Korean
+translate_1,"Invalid response, please try again!!",잘못된 응답입니다. 다시 시도하십시오!!
+translate_2,"Please enter supported features for the above-mentioned APIs, in the form of \nFeature name:\n\n[ To navigate, please type 'Back' ]","위의 API에 대해 지원하는 feature\nfeature 이름 형식으로 입력하십시오
+Feature 이름: \n\n[ 탐색하려면 'Back'를 입력하십시오]"
+translate_3,"Feature details skipped.\nDo you want to add Pre and Post condition APIs for the above APIs?\n(Yes or No)\n\n[ To navigate, please type 'Back' ]","Feature 세부사항 생략되었습니다.\n위의 API에 대해 Pre 및 Post 조건 API를 추가하시겠습니까?\n(네, 아니오)\n\n[탐색하려면 'Back'를 입력하십시오]"
+translate_4,Please enter Pre and Post condition APIs for API: ,API에 대한 Pre 및 Post 조건 API를 입력하십시오:
+translate_5, in the format of \nPre: API_NAME_1 API_NAME_2 Post: API_NAME_1 API_NAME_2 separated by space\n\n If you don't want to write pre and post APIs for,형식에서: \nPre: API_NAME_1 API_NAME_2 Post: API_NAME_1 API_NAME_2 공백으로 구분됨\n\n Pre 및 Post API를 작성하지 않으려는 경우
+translate_6," please write 'Pre:'\n\n[ To navigate, please type 'Back' ]",Pre:'라고 적어주세요\n\n[탐색하려면 'Back'를 입력하십시오]
+translate_7,"Negative TCs not possible for this API, Only positive TCs will be created. \n\n","이 API에서는 Negative TC가 불가능합니다, 오직 긍정적인 TC생성될 것입니다."
+translate_8,Thank You for providing input. \n,입력을 제공해 주셔서 감사합니다\n.
+translate_9,Thank You for providing input. Only positive TCs will be created \n,입력을 제공해 주셔서 감사합니다. 오직 긍정적인 TC생성될 것입니다\n
+translate_11,All .C TC Code files in the mentioned directory are listed as below \n,언급된 디렉토리의 C TC 코드 file은 다음과 같습니다. \n
+translate_12,"Please provide the file name in which you want to write the TC in the format of \nFILE name: NAME_OF_THE_FILE.c\n\n[ To navigate, please type 'Back' ]",TC를 작성하고 싶으신 file이름을\nFILE 이름 형식으로 제공하십시오: NAME_OF_THE_FILE.c\n\n[탐색하려면 'Back'를 입력하십시오]
+translate_13,Do you want to continue for next module ? (Yes/No),다음 module 계속하시겠습니까? (네/아니오)
+translate_14,"Module name already exists. Please write module name apart from existing one.\nPlease provide module name in the form of \nModule name:\n\n[ To navigate, please type 'Back' ]",이미 존재하는 module 이름입니다. 기존 module 이름과 다른 module 이름을 작성해주십시오.\n다음과 같은 양식으로 module 이름을 제공해주세요:\nModule name: \n\n[ 탐색을 원하시면 'Back'을 입력하세요 ]
+translate_15,"No Module name details entered!! \n\n Please provide Module name in the format of \n Module name:\n\n [ To navigate, please type 'Back' ]",Module 이름에 대한 세부 정보가 입력되지 않았습니다!! \n\nModule 이름 형식로 Module 이름을 제공하십시오: \n\n[탐색하려면 'Back'를 입력하십시오]
+translate_16,"Please enter Header file details in the format of \nHeader File: HEADER_FILE_1 HEADER_FILE_2\n\n[ To navigate, please type 'Back' ]",Header File 세부 정보를 의 형식으로 입력하십시오\nHeader file: HEADER_FILE_1 HEADER_FILE_2\n\n[ 탐색하려면 'Back'를 입력하십시오]
+translate_17,Module name not found[Please check mapping file: Module_Header_Mapping.csv]\n\nDid you mean ?\n,Module이름을 찾을 수 없습니다[Mapping file을 확인해주시기 바랍니다: module_header_Mapping.csv]\n\n 무슨 뜻입니까?
+translate_18,"Type Yes to continue otherwise type No\n\n[ To navigate, please type 'Back' ]", 계속 진행하려면 Yes를 그렇지 않으면 No를 입력하세요\n\n[탐색하려면 'Back'를 입력하십시오]
+translate_19,"Module name not found[Please check mapping file: Module_Header_Mapping.csv], \n\nPlease type the module name again in the form of \nModule name:\n\n[ To navigate, please type 'Back' ]","Module이름을 찾을 수 없습니다 [Mapping file 확인하십시오: Module_Header_Mapping.csv], \n\n형식으로 module 이름을 다시 입력하십시오.
+Module이름:\n\n[탐색하려면 'Back'를 입력하십시오]"
+translate_20,"Header file not found in rootstrap! So, Module not created.Please enter the correct header file details in the form of form of \nHeader File:\n\n[ To navigate, please type 'Back' ]",Rootstrap에서 header file 찾을 수 없습니다! 따라서 module 생성되지 앟습니다.\n 올바른 header file 세부 정보를 \nheader file:\n\n[ 탐색하려면 'Back'를 입력하십시오]의 형태로 입력하십시오.
+translate_21,"Please provide API information in the format of \nAPI names: API_NAME_1 API_NAME_2 \n\n[ To navigate, please type 'Back' ]",API 정보를 \nAPI 이름 형식으로 제공해주시기 바랍니다.API 이름 : API_NAME_1 API_NAME_2\n\n[탐색하려면 'Back'를 입력하십시오]
+translate_22,"No Header File details entered!! \n\n Please provide Header File details in the format of \n Header File :\n\n [ To navigate, please type 'Back' ] ",Header file 대한 세부 정보를 입력하지 않았습니다!\n\nHeader file 형식을 제공해주시기 바랍니다.Header File:\n\n [탐색하려면 'Back'를 입력하십시오]
+translate_23,ThankYou for providing input.\nTC already exists for API:,제공해주셔서 입력 대해 감사합니다.\nAPI에 대해 이미 TC 존재합니다
+translate_24,"Please try writing again.\n\n[ To navigate, please type 'Back' ]",다시 작성해보시기 바랍니다\n\n[탐색하려면 'Back'를 입력하십시오]
+translate_25,"Thankyou, APIs found in rootstrap.\nDo you want to add Feature for above APIs?\n(Yes or No)\n\n[ To navigate, please type 'Back' ]","감사합니다. Rootstrap에서 발견된 API입니다.\n위의 API에 feature을 추가하시겠습니까??\n(예, 아니오)\n\n[탐색하려면'Back'를입력하십시오]"
+translate_26,APIs not present in rootstraps. Please try writing again.\n\nAll the APIs present in the header file are mentioned below for your reference:,Rootstrap에는 해당 API가 없습니다. 다시 한번 작성해보세요.\n\nheader file 있는 모든 API는 아래에 나열되어 있으니 참고하시기 바랍니다.
+translate_27,Header File Name: ,Header File 이름 :
+translate_28,\n\n\nPlease provide API information in the format of \nAPI names:,\n\n\n\nAPI 이름으로 형식에 맞는 API 정보를 제공해 주세요
+translate_29,"Header File not found in rootstrap, Please check Module_Header_Mapping.csv", Header File이 rootstrap에 없는 경우 Module_Header_Mapping.csv 확인 부탁드립니다
+translate_30,"No API details entered !!\n\nPlease provide API information in the format of \nAPI names:\n\n[ To navigate, please type 'Back' ]","API 세부 정보가 입력되지 않았습니다!!\n\n API 정보를 \n 형식으로 제공해주세요
+API 이름: \n\n[ 탐색하려면 'Back'를 입력하십시오]
+"
+translate_31,"Do you want to add Pre and Post condition APIs for the above APIs?\n(Yes or No)\n\n[ To navigate, please type 'Back' ]","위 API에 대한 Pre 및 Post 조건 API를 추가하시겠습니까?\n(네, 아니오)\n\n[탐색하려면 'Back'를 입력하십시오]
+"
+translate_32,"No Feature details entered!!\n\nPlease enter supported features for the above-mentioned APIs, in the form of \nFeature name:\n\n[ To navigate, please type 'Back' ]",Feature 세부 사항이 입력되지 않았습니다!!\n\n위에서 언급한 API에서 지원하는 feature을 다음 형식으로 입력하십시오.feature 이름:\n\n과 같은 형식으로 작성해 주세요\n\n[탐색하려면 'Back'를 입력하십시오]
+translate_33,"Thankyou, for providing details for pre/post APIs for",\nAPI에 대한 pre/post API에 대한 세부 정보를 제공해 주셔서 감사합니다:
+translate_34,\nPlease Enter pre/post APIs for API:,\nAPI용 pre/post API를 입력해주세요:
+translate_35,\n\n If you don't want to write pre and post APIs for API:,\n\n API에 대한 사전/사후 API를 작성하고 싶지 않다면
+translate_36," please write 'Pre:'\n\n[ To navigate, please type 'Back' ]",Pre: 를 작성하십시오\n\n[탐색하려면 'Back'를 입력하십시오]
+translate_37,"Thankyou, for providing details for pre/post APIs for ",APIs pre/post 대한 세부 정보를 제공해 주셔서 감사합니다
+translate_38,Pre and Post condition skipped.\n\n,pre 및 post 조건이 생략되었습니다.\n\n.
+translate_39,Thank You for providing pre/post condition APIs. \n\n,pre/post 조건 API를 제공해 주셔서 감사합니다.\n\n
+translate_40,"Do you want to add negative TCs also?\n(Yes or No)\n\n[ To navigate, please type 'Back' ]","Negative TC 추가하길 원하시나요?\n(네, 아니오)\n\n[탐색하려면 'Back'를 입력하십시오]"
+translate_41,Pre/Post condition APIs provided by you does not exists.\n\n[ Please type 'Back' and provide all Pre/Post APIs data again. ],제공하는 Pre/Post 조건 API는 존재하지 않습니다.\n\n[ 'Back'를 입력하고 모든 Pre/Post API 데이터를 다시 제공하십시오.]
+translate_42,TC is created successfully at path : ,경로에 TC가 성공적으로 생성되었습니다.
+translate_43,Do you want to build ?\n(Yes or No),Build 싶습니까?\n(예 또는 아니오
+translate_44,"Thankyou, for providing file name.\nTC is created successfully at path : ",File 이름 제공해 주셔서 감사합니다.\nTC는 경로에서 성공적으로 생성됩니다.
+translate_45,Do you want to build ?\n(Yes or No),Build 싶습니까?\n(예 또는 아니오
+translate_46,"Thankyou, for providing file name.A new file will be created at path : ",File 이름 제공해 주셔서 감사합니다.경로에서 새로운 file이 생성됩니다:
+translate_47,Do you want to build ?\n(Yes or No),Build 싶습니까?\n(예 또는 아니오
+translate_48,"File name details not entered!! \n\n Please provide file name in the format of \nFile name:\n\n [ To navigate, please type 'Back' ]","File이름 세부 정보가 입력되지 않았습니다!!\n\n file이름을 \n형식으로 제공하십시요
+File이름:\n\n[ 탐색하려면 'Back'를 입력하십시오]"
+translate_49,Build Started !! Please wait...,Build 시작되었습니다!! 잠시만 기다려주세요...
+translate_50,CREATION SUCCESSFUL,생성 성공
+translate_51,Build completed successfully\n\nDo you want to execute TCs?\n(Yes or No),"Build가 성공적으로 완료되었습니다\n\nTC를 실행하시겠습니까?\n(네, 아니오)"
+translate_52,"Build Failed, Please check the TC file and try again.",Build 실패했습니다. TC file을 확인하고 다시 시도하십시오.
+translate_53,Build parameters values are not correct\nPlease try again..,Build 매개 변수 값이 올바르지 않습니다.\n다시 시도하십시오
+translate_54,Installing the package...Make sure the target is connected\nLaunching TCT-MGR tool\n\nDo you want to continue for another module?,Package 설치 대상이 연결되어 있는지 확인\nLaunching TCT-MGR tool\n\n다른 module 위해 계속하시겠습니까?
+translate_55,"\n\n [ To navigate, please type 'Back' ]",\n\n[탐색하려면 'Back'를 입력하십시오]
+translate_56,You can't go back at this stage. Please write the appropriate inputs,이 단계에서는 뒤로 갈 수 없습니다. 적절한 입력을 작성하세요
+translate_57,Please select numbers for the corresponding stage you want to go to:\n,다음 단계로 이동할 해당 단계를 선택하십시오:\n
+translate_58,"If you wish to EXIT, Please type Exit","만약 종료하고 싶으시다면, 'Exit'라고 입력해주세요"
+translate_59,Invalid Input. Please try writing again,잘못된 입력입니다. 다시 작성해보세요
--- /dev/null
+# from read_csv_ko import *
+from Ko_Lang_Support.read_csv_ko import *
+
+def get_en_or_ko_replies(key, radio_btn_val):
+ if radio_btn_val == 1:
+ lang_idx = 0
+ elif radio_btn_val == 2:
+ lang_idx = 1
+ val_en_ko = translation_dict_ko(key, lang_idx)
+ # print(val_en_ko)
+ return val_en_ko
+
--- /dev/null
+import csv
+
+
+def translation_dict_ko(key, lang_idx):
+ mydict = {}
+
+ #Open the file in read mode
+ with open('Ko_Lang_Support/eng_ko_replies.csv', mode='r') as infile:
+ reader = csv.reader(infile, skipinitialspace=True)
+ for row in reader:
+ temp = row[1:]
+ temp1 = []
+ for val in temp:
+ if not val:
+ continue
+ temp1.append(val)
+ mydict[row[0]] = temp1
+ return mydict[key][lang_idx].replace('\\n', '\n')
--- /dev/null
+# from translate import Translator
+from deep_translator import GoogleTranslator
+
+
+def translate_to_ko(to_translate):
+ translated = GoogleTranslator(source='auto', target='ko').translate(to_translate)
+ return translated
+
+
+def translate_to_en(to_translate):
+ translated = GoogleTranslator(source='auto', target='en').translate(to_translate)
+ return translated
+
wifi-direct,wifi-direct/wifi-direct.h,,,,,,,,,,,,,,,,,,,,,
wifi-manager,network/wifi-manager.h,,,,,,,,,,,,,,,,,,,,,
yaca,linux/stddef.h,yaca/yaca_crypto.h,yaca/yaca_error.h,yaca/yaca_key.h,yaca/yaca_sign.h,yaca/yaca_encrypt.h,yaca/yaca_digest.h,yaca/yaca_simple.h,yaca/yaca_types.h,yaca/yaca_rsa.h,yaca/yaca_seal.h,yaca/yaca_sign.h,yaca/yaca_simple.h,,,,,,,,,
-tempthree,location/locations.h\r
+lang2,location/locations.h\r
+lang3,location/locations.h\r
+testone,location/locations.h\r
+testtwo,location/locations.h\r
+testhree,location/locations.h\r
+testfour,location/locations.h\r
+qwerty1,location/locations.h\r
+qwerty2,location/locations.h\r
+qwerty6,location/locations.h\r
+qwerty7,media/media_streamer.h\r
+newmodule,location/locations.h\r
+newmodule1,location/locations.h\r
+newmodule3,location/locations.h\r
+newmodule5,location/locations.h\r
+alarm_new,appfw/app_alarm.h\r
+media_new,media/media_streamer.h\r
+media_new,media/media_streamer.h\r
+media_new2,media/media_streamer.h\r
+test_new,location/locations.h\r
**For example:**
- If user has entered webrtc module then tool will search for its header file media/webrtc.h in tizeniot-9.0-device.core.private.20230823_131527 rootstrap.
- > Header file should be present at path /home/sri/tizen-studio/platforms/tizen-9.0/tizeniot/rootstraps/tizeniot-9.0-device.core.private.20230823_131527/usr/include, otherwise tool will run into error.
+ If user has entered webrtc module then tool will search for its header file media/webrtc.h in tizen-9.0-device.core.private.20230823_131527 rootstrap.
+ > Header file should be present at path /home/sri/tizen-studio/platforms/tizen-9.0/tizen/rootstraps/tizen-9.0-device.core.private.20230823_131527/usr/include, otherwise tool will run into error.
6. API's for which you need to create TCs, those api's declaration need to be present in the header files mentioned in Module_Header_Mapping.csv file
"responses": [\r
"Install fail may be due to many reasons like python version, TPK not present in workspace etc. Kindly follow the below steps to solve the issue :-\n\n- Check if python version is greater than 3.0, if not upgrade the version\n\n- Check if TPK is created inside workspace folder, if not try build again\n\n[ To navigate, please type 'Back' ]"\r
]\r
+ },\r
+ {\r
+ "tag": "removeapi",\r
+ "patterns": ["Remove Deprecated APIs"],\r
+ "responses": [\r
+ "Please enter the list of deprecated APIs which you want to be removed in the format of DELETE: API_NAME_1, API_NAME_2, API_NAME_3, etc.\n\n[ To navigate, please type 'Back' ]"\r
+ ]\r
+ },\r
+ {\r
+ "tag": "inputremovalapi",\r
+ "patterns": ["DELETE: API_NAME_1, API_NAME_2"],\r
+ "responses": [\r
+ "Above mentioned APIs will be removed. Please find TCs detail for these APIs as below \n\n[ To navigate, please type 'Back' ]"\r
+ ]\r
+ },\r
+ {\r
+ "tag": "donotremove",\r
+ "patterns": ["EXCLUDE: 1, 2, 3, 4"],\r
+ "responses": [\r
+ "APIs removed successfully. Type 'Exit' to close the tool."\r
+ ]\r
}\r
]\r
}\r
ele = ele.replace('*', '')
desc = desc + ele
if flag == True and "@since" in ele or "@detail" in ele or "@details" in ele:
- break
+ break
desc = desc.replace('\r', '').replace('\n', '')
min_len = 100\r
for ele in rootstrap_latest_folder_names:\r
if len(ele) < min_len:\r
- min_len = len(ele) \r
+ min_len = len(ele)\r
res = ele\r
find_latest = ROOTSTRAP_DIR + "//" + res\r
return find_latest\r
return '\n'.join(lst)
+# Function uses ls command to list all the available files in the module and display it to the user in form of list.
+def get_all_files_of_module_list(TC_WRITE_DIR, module_name):
+ lst = []
+ TC_WRITE_DIR = TC_WRITE_DIR + '/' + module_name
+ command = f"ls {TC_WRITE_DIR}"
+ process = subprocess.Popen(command,stdout=subprocess.PIPE, shell=True)
+ proc_stdout = process.communicate()[0].strip()
+ for line in proc_stdout.decode().split('\n'):
+ if line[-2:] == ".c" and line[:3] != "tct":
+ lst.append(line)
+ return lst
+
+
+# Function uses ls command to list all the available files in the module and display it to the user in form of list.
+def get_all_c_files_of_module_list(TC_WRITE_DIR, module_name):
+ lst = []
+ TC_WRITE_DIR = TC_WRITE_DIR + '/' + module_name
+ command = f"ls {TC_WRITE_DIR}"
+ process = subprocess.Popen(command,stdout=subprocess.PIPE, shell=True)
+ proc_stdout = process.communicate()[0].strip()
+ for line in proc_stdout.decode().split('\n'):
+ if line[-2:] == ".c" and 'utc' in line:
+ lst.append(line)
+ return lst
+
+
# Function uses ls command to list all the available header files in the module
def get_all_header_files_of_module(TC_WRITE_DIR, module_name):
+++ /dev/null
-,Text,label
-0,add utc for webrtc apis,existingmodule
-1,The module is already existing,existingmodule
-2,REQUEST TO CREATE UTC OF NEW MODULE,newmodule
-3,tizen version 6.5,tizenversion
-4,Request is for Tizen version 6.0,tizenversion
-5,REQUEST TO COVER NEW APIS,request
-6,MODULE NAME: BLUETOOTH,modulename
-7,MODULE NAME:,modulename
-8,request to prepare utc,request
-9,file name: utc_media_webrtc.c,tcwritelocation
-10,THIS IS REQUEST TO COVER NEW MODULE APIS,newmodule
-11,FILE NAME: UTC_MEDIA_WEBRTC.C,tcwritelocation
-12,POST:,prepostinfo
-13,HI,greetings
-14,Add utc for webrtc APIs,existingmodule
-15,file name:,tcwritelocation
-16,pre: attach_panel_create,prepostinfo
-17,"its existing module, need to add new tcs",existingmodule
-18,"Its existing module, need to add new TCs",existingmodule
-19,TIZEN VERSION 6.5,tizenversion
-20,hello,greetings
-21,Tizen 6.5,tizenversion
-22,Tizen 7.0,tizenversion
-23,Pre: attach_panel_show Post: attach_panel_destroy,prepostinfo
-24,Request to create UTC of new module,newmodule
-25,"ITS EXISTING MODULE, NEED TO ADD NEW TCS",existingmodule
-26,Tizen version 6.5,tizenversion
-27,the module is already existing,existingmodule
-28,Request is for Tizen version 7.0,tizenversion
-29,FILE NAME:,tcwritelocation
-30,request is for tizen version 6.0,tizenversion
-31,Tizen version 7.0,tizenversion
-32,PRE:,prepostinfo
-33,REQUEST IS FOR TIZEN VERSION 7.0,tizenversion
-34,API names: attach_panel_create attach_panel_destroy,apiinfo
-35,Tizen 6.0,tizenversion
-36,module name:,modulename
-37,request is for tizen version 6.5,tizenversion
-38,tizen version 6.0,tizenversion
-39,Post:,prepostinfo
-40,tizen 6.0,tizenversion
-41,module name: bluetooth,modulename
-42,api names:,apiinfo
-43,NEED TO ADD NEW APIS IN BLUETOOTH MODULE,existingmodule
-44,API names:,apiinfo
-45,Module name: bluetooth,modulename
-46,Module name:,modulename
-47,This is an ACR request,request
-48,This is request to cover new module APIs,newmodule
-49,file name: utc-messaging-email.c,tcwritelocation
-50,REQUEST TO PREPARE UTC,request
-51,pre: attach_panel_show post: attach_panel_destroy,prepostinfo
-52,TIZEN 7.0,tizenversion
-53,Tizen version 6.0,tizenversion
-54,HELLO,greetings
-55,tizen 7.0,tizenversion
-56,TIZEN VERSION 7.0,tizenversion
-57,THIS IS AN ACR REQUEST,request
-58,FILE name: utc-messaging-email.c,tcwritelocation
-59,post: attach_panel_destroy,prepostinfo
-60,Pre: attach_panel_create,prepostinfo
-61,PRE: ATTACH_PANEL_SHOW POST: ATTACH_PANEL_DESTROY,prepostinfo
-62,REQUEST IS FOR TIZEN VERSION 6.5,tizenversion
-63,API NAMES:,apiinfo
-64,REQUEST IS FOR TIZEN VERSION 6.0,tizenversion
-65,Request is for Tizen version 6.5,tizenversion
-66,request to cover new apis,request
-67,TIZEN 6.0,tizenversion
-68,FILE name:,tcwritelocation
-69,TIZEN 6.5,tizenversion
-70,API NAMES: ATTACH_PANEL_CREATE ATTACH_PANEL_DESTROY,apiinfo
-71,POST: ATTACH_PANEL_DESTROY,prepostinfo
-72,tizen version 7.0,tizenversion
-73,Request to cover new APIS,request
-74,hi,greetings
-75,hello,greetings
-76,THE MODULE IS ALREADY EXISTING,existingmodule
-77,request is for tizen version 7.0,tizenversion
-78,Need to add new APIs in bluetooth module,existingmodule
-79,post:,prepostinfo
-80,FILE name: utc_media_webrtc.c,tcwritelocation
-81,Request to prepare UTC,request
-82,FILE NAME: UTC-MESSAGING-EMAIL.C,tcwritelocation
-83,request to create utc of new module,newmodule
-84,ARCH: PROFILE: ,executetc
-85,need to add new apis in bluetooth module,existingmodule
-86,this is request to cover new module apis,newmodule
-87,Pre:,prepostinfo
-88,hi,greetings
-89,Post: attach_panel_destroy,prepostinfo
-90,PRE: ATTACH_PANEL_CREATE,prepostinfo
-91,ARCH: armv7l PROFILE: wearable,executetc
-92,this is an acr request,request
-93,pre:,prepostinfo
-94,ARCH: armv7l PROFILE: tizeniot,executetc
-95,TIZEN VERSION 6.0,tizenversion
-96,ARCH: armv7l PROFILE: mobile,executetc
-97,ADD UTC FOR WEBRTC APIS,existingmodule
-98,api names: attach_panel_create attach_panel_destroy,apiinfo
-99,ARCH: armv7l PROFILE: tv,executetc
-100,tizen 6.5,tizenversion
-101,header info:,headerinfo
-102,Do you want to add negative TCs?,negativetc
-103,Add a negative TC,negativetc
-104,negative TC,negativetc
-105,Header File:dns-sd.h,headerinfo
-106,Back,goback
-107,I want to go back,goback
-108,Feature name:,featureinfo
-109,feature:,featureinfo
-110,New module:,newmodule
-111,newmodule:,newmodule
-112,Header File:,headerinfo
-113,headerfile:,headerinfo
-114,existing,existingmodule
-115,I want to add negative tc,negativetc
-116,NEW MODULE:webrtc,newmodule
-117,pre:yaca_key_generate,prepostinfo
-118,pre:yaca,prepostinfo
-119,Pre:yaca,prepostinfo
-120,PRE:yaca,prepostinfo
-121,Module name:yaca,modulename
-122,Support,supportsys
-123,I want support for issue,supportsys
-124,Environment Setup,envsetupsupport
-125,Need help for environment setup,envsetupsupport
-126,Installing rootstrap,rootstrapsupport
-127,Need help for installing rootstrap,rootstrapsupport
-128,Build Issue,buildsupport
-129,I want support for build related issue,buildsupport
-130,Logs:,buildlogdebug
-131,log:,buildlogdebug
-132,Install issue,installsupport
-133,I want help regarding install issue,installsupport
-134,Need support,supportsys
-135,Support Assistant,supportsys
-136,i need to add a new module,newmodule
--- /dev/null
+from list_module_files import *
+
+def delete_tc_from_all_c_files(REMOVE_TC_LIST, MODULE_NAME, CURR_C_FILE, TC_DIR_PATH):
+ TC_DIR_PATH_FINAL = f"{TC_DIR_PATH}/{MODULE_NAME}/{CURR_C_FILE}"
+ global start_line_no
+ global end_line_no
+ for tc_name in REMOVE_TC_LIST:
+ flag = 0
+ with open(TC_DIR_PATH_FINAL, 'r') as file:
+ for i, line in enumerate(file, start=1):
+ if tc_name in line and "@testcase" in line:
+ start_line_no = i - 1
+ flag = 1
+ if flag == 1 and "/**" in line:
+ end_line_no = i - 1
+ flag = 0
+ break
+ with open(TC_DIR_PATH_FINAL, 'r') as file:
+ all_lines = file.readlines()
+ with open(TC_DIR_PATH_FINAL, 'w') as file:
+ for i, line in enumerate(all_lines, start=1):
+ if start_line_no <= i <= end_line_no:
+ continue
+ file.write(line)
+
+
+def check_if_deprecated_tc_exists_in_header_files(TC_DIR_PATH, MODULE_NAME, REMOVE_API_NAMES, ALL_HEADER_FILES_IN_MODULE, REMOVE_TC_LIST, NOT_FOUND_API_LIST):
+
+ for header_file in ALL_HEADER_FILES_IN_MODULE:
+ for api_name_deprecated in REMOVE_API_NAMES:
+ command = f"grep {api_name_deprecated} {TC_DIR_PATH}/{MODULE_NAME}/{header_file}&"
+ process = subprocess.Popen(command,stdout=subprocess.PIPE, shell=True)
+ proc_stdout = process.communicate()[0].strip()
+ for line in proc_stdout.decode().split('\n'):
+ if api_name_deprecated in line and 'extern' in line:
+ split_list = line.split()
+ REMOVE_TC_LIST.append(split_list[2][:split_list[2].index('(')])
+ REMOVE_TC_LIST = list(set(REMOVE_TC_LIST))
+
+ flag = False
+ for ele in REMOVE_API_NAMES:
+ for tc_name in REMOVE_TC_LIST:
+ if ele in tc_name:
+ flag = True
+ if flag == False:
+ NOT_FOUND_API_LIST.append(ele)
+ flag = False
+
+
+def deprecated_api_removal(MODULE_NAME, remove_api_names, TC_DIR_PATH):
+ global REMOVE_TC_LIST
+ global NOT_FOUND_API_LIST
+ REMOVE_TC_LIST = []
+ NOT_FOUND_API_LIST = []
+ is_semicolon_present = remove_api_names.find(',')
+ if(is_semicolon_present != -1):
+ REMOVE_API_NAMES = list(map(str, remove_api_names.split(',')))
+ else:
+ REMOVE_API_NAMES = list(map(str, remove_api_names.split()))
+ for ele in range(len(REMOVE_API_NAMES)):
+ REMOVE_API_NAMES[ele] = REMOVE_API_NAMES[ele].strip()
+
+ ALL_FILES_IN_MODULE = get_all_files_of_module_list(TC_DIR_PATH, MODULE_NAME)
+ ALL_HEADER_FILES_IN_MODULE = get_all_header_files_of_module(TC_DIR_PATH, MODULE_NAME)
+
+ check_if_deprecated_tc_exists_in_header_files(TC_DIR_PATH, MODULE_NAME, REMOVE_API_NAMES, ALL_HEADER_FILES_IN_MODULE, REMOVE_TC_LIST, NOT_FOUND_API_LIST)
+ return REMOVE_TC_LIST, NOT_FOUND_API_LIST
+
+
+def delete_apis_from_header_files(MODULE_NAME, exclude_api_names, TC_DIR_PATH, REMOVE_TC_LIST):
+ is_semicolon_present = exclude_api_names.find(',')
+ if(is_semicolon_present != -1):
+ REMOVE_API_NAMES = list(map(str, exclude_api_names.split(',')))
+ else:
+ REMOVE_API_NAMES = list(map(str, exclude_api_names.split()))
+ for ele in range(len(REMOVE_API_NAMES)):
+ REMOVE_API_NAMES[ele] = int(REMOVE_API_NAMES[ele].strip())
+
+ REMOVE_API_NAMES.sort(reverse=True)
+ for tc_no in REMOVE_API_NAMES:
+ REMOVE_TC_LIST.pop(tc_no-1)
+
+
+ ALL_HEADER_FILES_IN_MODULE = get_all_header_files_of_module(TC_DIR_PATH, MODULE_NAME)
+ #delete tc occurence in all the header files
+ for header_file in ALL_HEADER_FILES_IN_MODULE:
+ for api_name_deprecated in REMOVE_TC_LIST:
+ command = f"sed -i '/{api_name_deprecated}/d' {TC_DIR_PATH}/{MODULE_NAME}/{header_file}&"
+ process = subprocess.Popen(command,stdout=subprocess.PIPE, shell=True)
+
+ ALL_C_FILES_IN_MODULE = get_all_c_files_of_module_list(TC_DIR_PATH, MODULE_NAME)
+ for files in ALL_C_FILES_IN_MODULE:
+ delete_tc_from_all_c_files(REMOVE_TC_LIST, MODULE_NAME, files, TC_DIR_PATH)
+
from new_module_addition import *\r
from header_file_location import *\r
from log_debugger import *\r
+from Ko_Lang_Support.translate_lang import *\r
+from Ko_Lang_Support.read_csv_ko import *\r
+from Ko_Lang_Support.get_eng_or_ko import *\r
+from remove_deprecated_api import *\r
import numpy as np\r
import pandas as pd\r
import re\r
\r
# We have prepared a dataset with 7 labels\r
try:\r
- df = pd.read_csv('newdata.csv', encoding='ISO-8859-1')\r
+ df = pd.read_csv('tool_dataset.csv', encoding='ISO-8859-1')\r
df.head()\r
except:\r
log_create(logger, "Error occurred while reading dataset file!")\r
time.sleep(.5)\r
progress['value'] = 100\r
\r
-# Load intents from json file\r
-log_info_save_processing(logger, "Importing data_TCT.json file")\r
\r
-try:\r
- f = open("data_TCT.json")\r
- data = json.load(f)\r
-\r
-except:\r
- log_create(logger, "Error occurred while importing the json file")\r
\r
\r
\r
callback_duplicate_check = []\r
\r
def get_response(message):\r
+ if radio_var.get() == 2:\r
+ message = translate_to_en(message)\r
try:\r
global result\r
global module_name\r
global flag_check_negative\r
global isExist\r
global callback_duplicate_check\r
+ global REMOVE_TC_LIST\r
+ global NOT_FOUND_API_LIST\r
\r
except:\r
log_create(logger, "Variable name error occured")\r
\r
+\r
+ # Load intents from json file\r
+ log_info_save_processing(logger, "Importing data_TCT.json file")\r
+\r
+ try:\r
+ # f = open("data_TCT.json")\r
+ # data = json.load(f)\r
+ if radio_var.get() == 2:\r
+ f = open("Ko_Lang_Support/data_TCT_KOR.json")\r
+ else:\r
+ f = open("data_TCT.json")\r
+ data = json.load(f)\r
+\r
+\r
+ except:\r
+ log_create(logger, "Error occurred while importing the json file")\r
+\r
try:\r
if "pre:" in message.lower() and "yaca" in message.lower():\r
intent="prepostinfo"\r
else:\r
intent = get_prediction(message)\r
- # print("message ", message)\r
- # print("intent ", intent)\r
+ print("message ", message)\r
+ print("intent ", intent)\r
+ print("previous intent", previous_intent)\r
log_info_save(logger, "Intent", intent)\r
except:\r
log_create(logger, "Error occurred in get_prediction function")\r
if intent == "existingmodule" and probs[intent]<0.85:\r
intent = "none"\r
if intent == "greetings" and previous_intent != "entry" and previous_intent != 'goback' and previous_intent != 'after_launch':\r
- result = "invalid response, please try again!!"\r
+ result = get_en_or_ko_replies('translate_1', radio_var.get())\r
else:\r
for i in data['intents']:\r
if i["tag"] == intent:\r
return "exit"\r
get_response(msg)\r
\r
- elif previous_intent == "supportsys" and (message == "back" or message == "Back"):\r
+ elif previous_intent == "supportsys" and (message == "back" or message == "Back" or message == "in the back"):\r
msg = "support"\r
previous_intent = "goback"\r
get_response(msg)\r
\r
+ elif previous_intent == "modulename" and (message == "back" or message == "Back" or message == "in the back"):\r
+ msg = "remove api"\r
+ previous_intent = "goback"\r
+ get_response(msg)\r
+\r
+ elif previous_intent == "inputremovalapi" and (message == "back" or message == "Back" or message == "in the back"):\r
+ msg = "Module Name: "+ module_name\r
+ previous_intent = "removeapi"\r
+ get_response(msg)\r
+\r
elif message == 'a' or message == 'b' or message == 'c' or message == 'd' or message == 'e' or message == '' or message == "exit" or message == "EXIT" or message == "Exit":\r
# if previous_intent == "entry":\r
previous_intent = "supportsys"\r
return "exit"\r
get_response(msg)\r
\r
-\r
elif message.lower() == 'yes' or message.lower() =='no':\r
#in case when module name typed wrong and suggestion is provided\r
if previous_intent == 'modulename':\r
\r
elif previous_intent == 'apiinfo':\r
if message.lower() == 'yes':\r
- result = "Please enter supported features for the above-mentioned APIs, in the form of \nFeature name:" \\r
- + "\n\n[ To navigate, please type 'Back' ]"\r
+ result = get_en_or_ko_replies('translate_2', radio_var.get())\r
elif message.lower() == 'no':\r
last_stage_index = 3\r
previous_intent = 'featureinfo'\r
feature_name = ''\r
- result = "Feature details skipped.\n" \\r
- + "Do you want to add Pre and Post condition APIs for the above APIs?" + "\n" \\r
- + "(Yes or No)" \\r
- + "\n\n[ To navigate, please type 'Back' ]"\r
+ result = get_en_or_ko_replies('translate_3', radio_var.get())\r
\r
elif previous_intent =='featureinfo':\r
if message.lower() == 'yes':\r
all_pre_post_api_skip = False\r
- result = "Please enter Pre and Post condition APIs for API: " + f"{API_NAMES[0]}" +" in the format of \nPre: API_NAME_1 API_NAME_2 Post: API_NAME_1 API_NAME_2 separated by space" \\r
- +"\n\n If you don't want to write pre and post APIs for " + f"{API_NAMES[0]}" + " please write 'Pre:'" \\r
- +"\n\n[ To navigate, please type 'Back' ]"\r
+ result = get_en_or_ko_replies('translate_4', radio_var.get()) + f"{API_NAMES[0]}" +get_en_or_ko_replies('translate_5', radio_var.get()) + f"{API_NAMES[0]}" + get_en_or_ko_replies('translate_6', radio_var.get())\r
elif message.lower() == 'no':\r
all_pre_post_api_skip = True\r
get_response('Pre:')\r
if message.lower() == "yes":\r
if not flag_check_negative:\r
WRITE_NEGATIVE_TC_USER_INPUT = False\r
- result = "Negative TCs not possible for this API, Only positive TCs will be created. \n\n"\r
+ result = get_en_or_ko_replies('translate_7', radio_var.get())\r
else:\r
WRITE_NEGATIVE_TC_USER_INPUT = True\r
- result = "Thank You for providing input. \n"\r
+ result = get_en_or_ko_replies('translate_8', radio_var.get())\r
elif message.lower() == "no":\r
WRITE_NEGATIVE_TC_USER_INPUT = False\r
- result = "Thank You for providing input. Only positive TCs will be created \n"\r
+ result = get_en_or_ko_replies('translate_9', radio_var.get())\r
\r
if new_module == False:\r
- result = result + "All .C TC Code files in the mentioned directory are listed as below \n" \\r
+ result = result + get_en_or_ko_replies('translate_11', radio_var.get()) \\r
+ f"{TC_WRITE_DIR}" + "/" + f"{MODULE_NAME}" + "\n\n" \\r
+ get_all_files_of_module(TC_WRITE_DIR, MODULE_NAME) + "\n\n" \\r
- + "Please provide the file name in which you want to write the TC in the format of \nFILE name: NAME_OF_THE_FILE.c" \\r
- + "\n\n[ To navigate, please type 'Back' ]"\r
+ + get_en_or_ko_replies('translate_12', radio_var.get())\r
else:\r
msg = "FILE name: utc-" + MODULE_NAME + ".c"\r
get_response(msg)\r
if i["tag"] == intent:\r
result = random.choice(i["responses"])\r
elif message.lower() == "no":\r
- result = 'Do you want to continue for next module ? (Yes/No)'\r
+ result = get_en_or_ko_replies('translate_13', radio_var.get())\r
previous_intent = 'after_launch'\r
\r
\r
+ elif previous_intent == "inputremovalapi":\r
+ if message.lower() == "yes":\r
+ # MODULE_NAME = module_name.lower()\r
+ CURRENT_PATH = get_current_dir_path()\r
+ TC_DIR_PATH = CURRENT_PATH + r'src/utc/'\r
+ # REMOVE_TC_LIST, NOT_FOUND_API_LIST = deprecated_api_removal(MODULE_NAME, remove_api_names, TC_DIR_PATH)\r
+ delete_apis_from_header_files(MODULE_NAME, '', TC_DIR_PATH, REMOVE_TC_LIST)\r
+ result = "Above mentioned TCs have been removed successfully. Type 'EXIT' to close the tool."\r
+ elif message.lower() == "no":\r
+ result = "Please enter the serial no. of TC which is not to be removed in the form of EXCLUDE: 1\n\n* If more than one TCs not to remove then mention the serial no as comma separated in the form of EXCLUDE: 1,2,3\n\n[ To exit the tool, please type 'Exit' ]"\r
\r
#ask a question to execute or not\r
elif previous_intent == 'executetc':\r
+ print("inside elif executetc ", message.lower())\r
if message.lower() == 'yes':\r
+ print("inside elif executetc yes")\r
intent = 'launchtctmgr'\r
elif message.lower() == "no":\r
- result = 'Do you want to continue for next module ? (Yes/No)'\r
+ result = get_en_or_ko_replies('translate_13', radio_var.get())\r
previous_intent = 'after_launch'\r
\r
\r
last_stage_index = 1\r
module_check = module_autocorrect(module_name)\r
if module_check == True:\r
- result = "Module name already exists. Please write module name apart from existing one.\n" + "Please provide module name in the form of \nModule name:" + "\n\n[ To navigate, please type 'Back' ]"\r
+ result = get_en_or_ko_replies('translate_14', radio_var.get())\r
previous_intent = 'modulename'\r
elif module_name=='':\r
- result = "No Module name details entered!! \n\n Please provide Module name in the format of \n Module name:\n\n [ To navigate, please type 'Back' ] "\r
+ result = get_en_or_ko_replies('translate_15', radio_var.get())\r
elif module_check != True and previous_intent!="goback":\r
- result = "Please enter Header file details in the format of \nHeader File: HEADER_FILE_1 HEADER_FILE_2" + "\n\n[ To navigate, please type 'Back' ]"\r
+ result = get_en_or_ko_replies('translate_16', radio_var.get())\r
previous_intent = 'modulename'\r
elif module_check != True and previous_intent == "goback":\r
- result = "Please enter Header file details in the format of \nHeader File: HEADER_FILE_1 HEADER_FILE_2" + "\n\n[ To navigate, please type 'Back' ]"\r
+ result = get_en_or_ko_replies('translate_16', radio_var.get())\r
previous_intent = 'modulename'\r
else:\r
- previous_intent = 'modulename'\r
+ # previous_intent = 'modulename'\r
module_name_suggested = module_autocorrect(module_name)\r
if module_name_suggested == True:\r
last_stage_index = 1\r
- result = "Module name found" + "\n" + result\r
+ if previous_intent == "removeapi":\r
+ result = "Module name found" + "\n" + "Please enter the list of deprecated APIs which you want to be removed in the format of DELETE: API_NAME_1, API_NAME_2, API_NAME_3, etc.\n\n[ To navigate, please type 'Back' ]"\r
+ previous_intent = 'modulename'\r
+ else:\r
+ result = "Module name found" + "\n" + result\r
+ previous_intent = 'modulename'\r
elif module_name_suggested != '':\r
- result = "Module name not found[Please check mapping file: Module_Header_Mapping.csv]" + "\n" + "\n" + "Did you mean ? " + module_name_suggested[0] + "\n" + "Type Yes to continue otherwise type No" \\r
- + "\n\n[ To navigate, please type 'Back' ]"\r
+ result = get_en_or_ko_replies('translate_17', radio_var.get()) + module_name_suggested[0] + "\n" + get_en_or_ko_replies('translate_18', radio_var.get())\r
module_name = module_name_suggested[0]\r
+ previous_intent = 'modulename'\r
else:\r
- result = "Module name not found[Please check mapping file: Module_Header_Mapping.csv], \n\nPlease type the module name again in the form of \nModule name:" \\r
- + "\n\n[ To navigate, please type 'Back' ]"\r
+ result = get_en_or_ko_replies('translate_19', radio_var.get())\r
+ previous_intent = 'modulename'\r
\r
elif intent == 'headerinfo':\r
new_module = True\r
\r
\r
if HEADER_FILE_LOCATION == "":\r
- result = "Header file not found in rootstrap! So, Module not created.\nPlease enter the correct header file details in the form of form of \nHeader File:" + "\n\n[ To navigate, please type 'Back' ]"\r
+ result = get_en_or_ko_replies('translate_20', radio_var.get())\r
else:\r
#add a new module\r
type_of_tc = "utc"\r
clean_existing_code(TC_WRITE_DIR, module_name)\r
add_header_line(TC_WRITE_DIR, module_name, HEADER_FILES_NAMES_TO_UPDATE)\r
update_module_mapper_file(HEADER_FILE_VALUE, module_name)\r
- result = "Please provide API information in the format of \nAPI names: API_NAME_1 API_NAME_2 \n\n[ To navigate, please type 'Back' ]"\r
+ result = get_en_or_ko_replies('translate_21', radio_var.get())\r
else:\r
- result= "No Header File details entered!! \n\n Please provide Header File details in the format of \n Header File :\n\n [ To navigate, please type 'Back' ] "\r
+ result= get_en_or_ko_replies('translate_22', radio_var.get())\r
\r
\r
\r
for API_SEARCH in API_NAMES:\r
if check_if_api_exists_grep(MODULE_NAME, API_SEARCH, TC_WRITE_DIR):\r
clear_api_list()\r
- return "ThankYou for providing input." + "\n" + "TC already exists for API: " + API_SEARCH + "\n" + "Please try writing again." + "\n\n[ To navigate, please type 'Back' ]"\r
+ result_next = get_en_or_ko_replies('translate_23', radio_var.get()) + API_SEARCH + "\n" + get_en_or_ko_replies('translate_24', radio_var.get())\r
+ if radio_var.get() == 2:\r
+ result_next = translate_to_ko(result_next)\r
+ return result_next\r
\r
api_return_values = get_api_return_values()\r
# print("api_return_values", api_return_values)\r
\r
last_stage_index = 2\r
previous_intent = 'apiinfo'\r
- result = "Thankyou, APIs found in rootstrap.\n" \\r
- + "Do you want to add Feature for above APIs?" + "\n" \\r
- + "(Yes or No)" \\r
- + "\n\n[ To navigate, please type 'Back' ]"\r
+ result = get_en_or_ko_replies('translate_25', radio_var.get())\r
\r
else:\r
if isExist:\r
- top_msg_display = "APIs not present in rootstraps. Please try writing again." + "\n\n" + "All the APIs present in the header file are mentioned below for your reference:"\r
+ top_msg_display = get_en_or_ko_replies('translate_26', radio_var.get())\r
result = ""\r
for HEADER_FILE_NAME in header_files_dict:\r
if "/" in HEADER_FILE_NAME:\r
POS_OF_SLASH = HEADER_FILE_NAME.index("/")\r
HEADER_FILE_NAME_WITHOUT_SLASH = HEADER_FILE_NAME[POS_OF_SLASH+1:]\r
- temp = "\n\n" + "Header File Name: " + HEADER_FILE_NAME_WITHOUT_SLASH + "\n\n" +get_all_api_names(MODULE_NAME, HEADER_FILE_NAME)\r
+ temp = "\n\n" + get_en_or_ko_replies('translate_27', radio_var.get()) + HEADER_FILE_NAME_WITHOUT_SLASH + "\n\n" +get_all_api_names(MODULE_NAME, HEADER_FILE_NAME)\r
result = result + temp\r
else:\r
- temp = "\n\n" + "Header File Name: " + HEADER_FILE_NAME + "\n\n" +get_all_api_names(MODULE_NAME, HEADER_FILE_NAME)\r
+ temp = "\n\n" + get_en_or_ko_replies('translate_27', radio_var.get()) + HEADER_FILE_NAME + "\n\n" +get_all_api_names(MODULE_NAME, HEADER_FILE_NAME)\r
result = result + temp\r
- result = top_msg_display + result + "\n\n\nPlease provide API information in the format of \nAPI names:" + "\n\n[ To navigate, please type 'Back' ]"\r
+ result = top_msg_display + result + get_en_or_ko_replies('translate_28', radio_var.get()) + get_en_or_ko_replies('translate_55', radio_var.get())\r
clear_api_list()\r
else:\r
- result="Header File not found in rootstrap, Please check Module_Header_Mapping.csv"\r
+ result=get_en_or_ko_replies('translate_29', radio_var.get())\r
\r
\r
else:\r
- result = "No API details entered !!" + "\n\nPlease provide API information in the format of \nAPI names:" + "\n\n[ To navigate, please type 'Back' ]"\r
+ result = get_en_or_ko_replies('translate_30', radio_var.get())\r
\r
elif intent == 'featureinfo':\r
last_stage_index = 3\r
feature_name = feature_name.strip()\r
\r
\r
- result = "Do you want to add Pre and Post condition APIs for the above APIs?" + "\n" \\r
- + "(Yes or No)" \\r
- + "\n\n[ To navigate, please type 'Back' ]"\r
+ result = get_en_or_ko_replies('translate_31', radio_var.get())\r
\r
elif feature_name == "" and previous_intent == 'goback':\r
previous_intent = 'featureinfo'\r
feature_name = feature_name.strip()\r
\r
\r
- result = "Do you want to add Pre and Post condition APIs for the above APIs?" + "\n" \\r
- + "(Yes or No)" \\r
- + "\n\n[ To navigate, please type 'Back' ]"\r
+ result = get_en_or_ko_replies('translate_31', radio_var.get())\r
\r
else:\r
- result = "No Feature details entered!!\n\nPlease enter supported features for the above-mentioned APIs, in the form of \nFeature name:" \\r
- + "\n\n[ To navigate, please type 'Back' ]"\r
+ result = get_en_or_ko_replies('translate_32', radio_var.get())\r
\r
\r
elif intent == 'prepostinfo':\r
NEGATIVE_TC_COUNT = 10\r
last_stage_index = 4\r
\r
- # get_pre_post_api_list_info(API_NAMES, MODULE_NAME, pre_post_api_names)\r
- #CURR_API_IND = 0\r
- ## print("api length", API_NAMES)\r
- ## print("curr_api_ind", CURR_API_IND)\r
if CURR_API_IND < len(API_NAMES):\r
- ## print("curr_api_index", CURR_API_IND)\r
- ### print("Current value of current index")\r
- ### print(CURR_API_IND)\r
get_pre_post_api_list = get_pre_post_api_list_info(API_NAMES[CURR_API_IND], MODULE_NAME, CURR_API_IND , pre_post_api_names)\r
- # print("looooooogsssssss",get_pre_post_api_list)\r
check_if_pre_post_api_exist &= (validate_api(get_pre_post_api_list[API_NAMES[CURR_API_IND]]['Pre'], MODULE_NAME) and validate_api(get_pre_post_api_list[API_NAMES[CURR_API_IND]]['Post'], MODULE_NAME))\r
- # print("check_if_pre_post_api_exist",check_if_pre_post_api_exist)\r
- #pre_post_enum = enum_finder_for_pre_post(get_pre_post_api_list, ROOTSTRAPS_DIR, header_files_dict, api_params)\r
- ## print('afasdfgdsafsdaf',get_pre_post_api_list[API_NAMES[CURR_API_IND]]['Pre'])\r
API_NAMES_LIST += get_pre_post_api_list[API_NAMES[CURR_API_IND]]['Pre'] + get_pre_post_api_list[API_NAMES[CURR_API_IND]]['Post']\r
- # print(API_NAMES_LIST)\r
- ## print("CURR_API_IND",CURR_API_IND)\r
- ## print("length",len(API_NAMES))\r
if CURR_API_IND < len(API_NAMES):\r
#for case when pre and post are not to be entered by user. User has selected no\r
if all_pre_post_api_skip == True:\r
CURR_API_IND = CURR_API_IND + 1\r
- # print("inside CURR_API_IND + 1 < len(API_NAMES) and get_response called again",CURR_API_IND)\r
- ## print("API_NAMES[CURR_API_IND]",API_NAMES[CURR_API_IND-1])\r
- ## print("API_NAMES[CURR_API_IND+1]",API_NAMES[CURR_API_IND])\r
CURR_API_IND = len(API_NAMES)\r
for API_IDX in range(1, len(API_NAMES)):\r
get_pre_post_api_list = get_pre_post_api_list_info(API_NAMES[API_IDX], MODULE_NAME, API_IDX , pre_post_api_names)\r
- # print("get_pre_post_api_list",get_pre_post_api_list)\r
API_NAMES_LIST += get_pre_post_api_list[API_NAMES[API_IDX]]['Pre'] + get_pre_post_api_list[API_NAMES[API_IDX]]['Post']\r
# print("API_NAMES_LIST",API_NAMES_LIST)\r
# get_response('Pre:')\r
\r
else:\r
if (CURR_API_IND+1)<len(API_NAMES):\r
- result = "Thankyou, for providing details for pre/post APIs for " + f"{API_NAMES[CURR_API_IND]}" + "\nPlease Enter pre/post APIs for API:" + f"{API_NAMES[CURR_API_IND+1]}" \\r
- + "\n\n If you don't want to write pre and post APIs for API:" + f"{API_NAMES[CURR_API_IND+1]}" + " please write 'Pre:'"\\r
- + "\n\n[ To navigate, please type 'Back' ]"\r
+ result = get_en_or_ko_replies('translate_33', radio_var.get()) + f"{API_NAMES[CURR_API_IND]}" + get_en_or_ko_replies('translate_34', radio_var.get()) + f"{API_NAMES[CURR_API_IND+1]}" \\r
+ + get_en_or_ko_replies('translate_35', radio_var.get()) + f"{API_NAMES[CURR_API_IND+1]}" + get_en_or_ko_replies('translate_36', radio_var.get())\r
else:\r
- result = "Thankyou, for providing details for pre/post APIs for " + f"{API_NAMES[CURR_API_IND]}"\r
+ result = get_en_or_ko_replies('translate_37', radio_var.get()) + f"{API_NAMES[CURR_API_IND]}"\r
#if CURR_API_IND + 1 < len(API_NAMES):\r
\r
if all_pre_post_api_skip == True:\r
CURR_API_IND = len(API_NAMES)\r
else:\r
CURR_API_IND = CURR_API_IND + 1\r
- ## print("After_CURR_API_IND", CURR_API_IND)\r
appended_code = ""\r
appended_negative_tc_code = ""\r
WRITE_NEGATIVE_TC_USER_INPUT = False\r
if CURR_API_IND == len(API_NAMES):\r
- ## print(check_if_pre_post_api_exist)\r
if check_if_pre_post_api_exist:\r
- ## print('Pre and Post APIS are valid')\r
- ### print("Entered Loop")\r
get_all_api_list = get_api_return_values()\r
# get_all_agrs_list = get_api_parameters(API_NAMES + get_pre_post_api_list[API_NAMES[CURR_API_IND]]['Pre'] + get_pre_post_api_list[API_NAMES[CURR_API_IND]]['Post'])\r
get_all_agrs_list = get_api_parameters(API_NAMES + API_NAMES_LIST)\r
- # print("checking for ags", get_all_agrs_list)\r
PRE_POST_API_ARGS_LIST = get_all_agrs_list\r
ROOTSTRAPS_DIR = get_latest_rootstrap()\r
ROOTSTRAPS_DIR = ROOTSTRAPS_DIR + "//"\r
if pos > 0:\r
HEADER_FILE_NAME = HEADER_FILE_NAME[pos+1:]\r
for API_IDX in range(len(API_NAMES)):\r
- # print("details of each API", API_IDX)\r
- # print("for api ---", API_NAMES[API_IDX])\r
- # print("looooooogsssssss",get_pre_post_api_list)\r
PRE_POST_API_LIST = get_pre_post_api_list[API_NAMES[API_IDX]]\r
- # print("cjeclomg dlfm", PRE_POST_API_LIST)\r
\r
pre_apis = PRE_POST_API_LIST['Pre']\r
- ## print("pre_apis",pre_apis)\r
post_apis = PRE_POST_API_LIST['Post']\r
\r
\r
if len(pre_apis) != 0:\r
for pre_api in pre_apis:\r
api_params_pre = PRE_POST_API_ARGS_LIST[pre_api]\r
- ## print("api_params",api_params_pre)\r
enum = enum_finder(pre_api, ROOTSTRAPS_DIR, header_files_dict, api_params_pre)\r
if enum != {}:\r
- ## print("enum found")\r
enum_dict_pre_post[pre_api] = enum\r
else:\r
- ## print("enum not found for pre API!")\r
enum_dict_pre_post[pre_api] = {}\r
if len(post_apis) != 0:\r
for post_api in post_apis:\r
api_params_post = PRE_POST_API_ARGS_LIST[post_api]\r
- ## print("api_params_post", api_params_post)\r
enum = enum_finder(post_api, ROOTSTRAPS_DIR, header_files_dict, api_params_post)\r
- ## print("post_api_detail ->", post_api)\r
- #post_key = "Pre-" + API_NAMES[API_IDX] + "- " + post_api\r
if enum != {}:\r
- # print("enum found")\r
enum_dict_pre_post[post_api] = enum\r
else:\r
- # print("enum not found for pre API!")\r
enum_dict_pre_post[post_api] = {}\r
\r
\r
- ## print("enum pre post dict for API - ", enum_dict_pre_post)\r
-\r
- ## print("Header file name checking", HEADER_FILE_NAME)\r
HEADER_FILE_CONTAINED_FOLDER = get_api_header_file_contained_folder_name(ROOTSTRAPS_DIR, HEADER_FILE_NAME)\r
HEADER_FILE_CONTAINED_FOLDER = HEADER_FILE_CONTAINED_FOLDER.replace('-','_')\r
- ## print("Header file contained folder", HEADER_FILE_CONTAINED_FOLDER)\r
- ## print("API_NAMES[API_IDX]",API_NAMES[API_IDX])\r
- ## print("PRE_POST_API_LIST", PRE_POST_API_LIST)\r
- ## print("PRE_POST_API_ARGS_LIST",PRE_POST_API_ARGS_LIST)\r
- ## print("FUNC_API_ALL_ARGS[API_IDX]",FUNC_API_ALL_ARGS[API_IDX])\r
- ## print("HEADER_FILE_CONTAINED_FOLDER",HEADER_FILE_CONTAINED_FOLDER)\r
- ## print("enum_dict",enum_dict)\r
- ## print("enum_dict_pre_post",enum_dict_pre_post)\r
- ## print("feature_name",feature_name)\r
- # print("RET_TYPE ", RET_TYPE)\r
+\r
get_tc_template_code = tc_code_write1(get_all_api_list, MODULE_NAME, API_NAMES[API_IDX], PRE_POST_API_LIST, PRE_POST_API_ARGS_LIST, FUNC_API_ALL_ARGS[API_IDX], HEADER_FILE_CONTAINED_FOLDER, enum_dict, enum_dict_pre_post, feature_name, callback_duplicate_check)\r
## print("get_tc_template_code",get_tc_template_code)\r
appended_code = appended_code + "\n" + get_tc_template_code\r
- ## print("tc_code from tct_assistance ")\r
- # print(appended_code)\r
- # code, NO_OF_NEGATIVE_TC = all_negative_tc_combined(RET_TYPE, MODULE_NAME, API_NAMES[API_IDX], PRE_POST_API_LIST, PRE_POST_API_ARGS_LIST, FUNC_API_ALL_ARGS[API_IDX], HEADER_FILE_CONTAINED_FOLDER, NEGATIVE_TC_COUNT)\r
- #appended_negative_tc_code = appended_negative_tc_code + appended_code\r
- # print("TARGET_API_INPUT_PARAMS_LIST",TARGET_API_INPUT_PARAMS_LIST)\r
+\r
if len(TARGET_API_INPUT_PARAMS_LIST) > 0:\r
appended_negative_tc_code = appended_negative_tc_code + get_tc_template_code + "\n" + all_negative_tc_combined(get_all_api_list, MODULE_NAME, API_NAMES[API_IDX], PRE_POST_API_LIST, PRE_POST_API_ARGS_LIST, FUNC_API_ALL_ARGS[API_IDX], HEADER_FILE_CONTAINED_FOLDER, 10, feature_name, enum_dict, enum_dict_pre_post) + "\n"\r
flag_check_negative = True\r
input_params.append(len(TARGET_API_INPUT_PARAMS_LIST))\r
TARGET_API_INPUT_PARAMS_LIST.clear()\r
- # print("inputdsfsadfds_params",input_params)\r
elif len(TARGET_API_INPUT_PARAMS_LIST) == 0:\r
input_params.append(0)\r
appended_negative_tc_code = appended_negative_tc_code + get_tc_template_code\r
previous_intent = 'prepostinfo'\r
last_stage_index = 4\r
if all_pre_post_api_skip == True:\r
- result = "Pre and Post condition skipped.\n\n"\r
+ result = get_en_or_ko_replies('translate_38', radio_var.get())\r
else:\r
- result = "Thank You for providing pre/post condition APIs. \n\n"\r
- result = result + "Do you want to add negative TCs also?" + "\n" \\r
- + "(Yes or No)" \\r
- + "\n\n[ To navigate, please type 'Back' ]"\r
+ result = get_en_or_ko_replies('translate_39', radio_var.get())\r
+ result = result + get_en_or_ko_replies('translate_40', radio_var.get())\r
\r
elif check_if_pre_post_api_exist == False:\r
CURR_API_IND = CURR_API_IND - 1\r
API_NAMES_LIST.remove(i)\r
break\r
\r
- result = "Pre/Post condition APIs provided by you does not exists." \\r
- + "\n\n[ Please type 'Back' and provide all Pre/Post APIs data again. ]"\r
+ result = get_en_or_ko_replies('translate_41', radio_var.get())\r
\r
elif intent == 'tcwritelocation':\r
#write tc in the mentioned file name collected from the user\r
#inp_params=ret_input_params()\r
with open(TC_WRITE_DIR + "/" + MODULE_NAME + "/" + f"{file_name}", "a") as myfile:\r
if WRITE_NEGATIVE_TC_USER_INPUT:\r
- # print("writing neg and pos tc")\r
- ## print("get_negative_tc_template_code",get_negative_tc_template_code)\r
- ## print(get_negative_tc_template_code)\r
myfile.write(get_negative_tc_template_code)\r
else:\r
- # print("printing pos tc")\r
- ## print(get_tc_template_code)\r
myfile.write(get_tc_template_code)\r
\r
# code for making entry of new tc in header files if a new file is created\r
for API_IDX in range(len(API_NAMES)):\r
- # print("API_NAMES",API_NAMES)\r
- # print("TC_WRITE_DIR",TC_WRITE_DIR,"MODULE_NAME",MODULE_NAME,"HEADER_FILE_CONTAINED_FOLDER",HEADER_FILE_CONTAINED_FOLDER,"filename",file_name)\r
update_all_header_files(TC_WRITE_DIR, MODULE_NAME, HEADER_FILE_CONTAINED_FOLDER, API_NAMES[API_IDX], file_name, True)\r
# if user type yes when asked for negative TCs then update negative tc in header files\r
if WRITE_NEGATIVE_TC_USER_INPUT:\r
inp_params = ret_input_params()\r
- # print("API_IDX",API_IDX)\r
- # print("inp_params",inp_params)\r
if inp_params!=[]:\r
for idx in range(1, inp_params[API_IDX]+1):\r
update_all_header_files_for_negative_tc(TC_WRITE_DIR, MODULE_NAME, HEADER_FILE_CONTAINED_FOLDER, API_NAMES[API_IDX], idx, API_IDX,file_name)\r
\r
if new_module == True:\r
- result = result + "TC is created successfully at path : " + f"{TC_WRITE_DIR}" + "/" + f"{MODULE_NAME}" + "/" + f"{file_name}" + "\n\n" + "Do you want to build ?\n(Yes or No)"\r
+ result = result + get_en_or_ko_replies('translate_42', radio_var.get()) + f"{TC_WRITE_DIR}" + "/" + f"{MODULE_NAME}" + "/" + f"{file_name}" + "\n\n" + get_en_or_ko_replies('translate_43', radio_var.get())\r
else:\r
- result = "Thankyou, for providing file name.\n" + "TC is created successfully at path : " + f"{TC_WRITE_DIR}" + "/" + f"{MODULE_NAME}" + "/" + f"{file_name}" + "\n\n" + "Do you want to build ?\n(Yes or No)"\r
+ result = get_en_or_ko_replies('translate_44', radio_var.get()) + f"{TC_WRITE_DIR}" + "/" + f"{MODULE_NAME}" + "/" + f"{file_name}" + "\n\n" + get_en_or_ko_replies('translate_45', radio_var.get())\r
else:\r
- # print("MODULE_NAME,file_name,header_files_dict",MODULE_NAME,file_name,header_files_dict)\r
get_tc_init_code = tc_code_init(MODULE_NAME,file_name,header_files_dict)\r
- # print("filename----",file_name)\r
with open(TC_WRITE_DIR + "/" + MODULE_NAME + "/" + f"{file_name}", "a+") as myfile:\r
myfile.write(get_tc_init_code)\r
if WRITE_NEGATIVE_TC_USER_INPUT:\r
- # print("writing neg and pos tc for new file")\r
- # print(get_negative_tc_template_code)\r
myfile.write(get_negative_tc_template_code)\r
else:\r
- # print("writing only pos tc for a new file")\r
- # print(get_tc_template_code)\r
myfile.write(get_tc_template_code)\r
\r
# code for making entry of new tc in header files if a new file is created\r
for API_IDX in range(len(API_NAMES)):\r
- ### print("reprint 1")\r
inp_params=[]\r
update_all_header_files(TC_WRITE_DIR, MODULE_NAME, HEADER_FILE_CONTAINED_FOLDER, API_NAMES[API_IDX], file_name, False)\r
# if user type yes when asked for negative TCs then update negative tc in header files\r
if WRITE_NEGATIVE_TC_USER_INPUT:\r
- ## print("API INDEX", API_IDX)\r
inp_params = ret_input_params()\r
- # print("input params", inp_params)\r
if inp_params!=[] and API_IDX <= (len(inp_params) -1):\r
for idx in range(1, inp_params[API_IDX]+1):\r
- # print("idx", idx)\r
- # print("API NAMES", API_NAMES)\r
- # print("\n API names of index is ", API_NAMES[API_IDX])\r
update_all_header_files_for_negative_tc(TC_WRITE_DIR, MODULE_NAME, HEADER_FILE_CONTAINED_FOLDER, API_NAMES[API_IDX], idx, API_IDX,file_name)\r
- # print("updating CMakelist file for new tc file created")\r
- # print(TC_WRITE_DIR)\r
- # print(file_name)\r
+\r
updateCMakeFile(TC_WRITE_DIR, MODULE_NAME, file_name)\r
\r
- result = "Thankyou, for providing file name." + "A new file will be created at path : " + f"{TC_WRITE_DIR}" + "/" + f"{MODULE_NAME}" + "/" + f"{file_name}" + "\n\n" + "Do you want to build ?\n(Yes or No)"\r
+ result = get_en_or_ko_replies('translate_46', radio_var.get()) + f"{TC_WRITE_DIR}" + "/" + f"{MODULE_NAME}" + "/" + f"{file_name}" + "\n\n" + get_en_or_ko_replies('translate_47', radio_var.get())\r
+\r
+ else:\r
+ result=get_en_or_ko_replies('translate_48', radio_var.get())\r
+\r
+ elif intent == 'removeapi':\r
+ previous_intent = 'removeapi'\r
+ result = "Please provide module name for which you want to remove TCs in the form of \nModule name: NAME_OF_THE_MAIL\n\n[ To navigate, please type 'Back' ]"\r
\r
+ elif intent == 'inputremovalapi':\r
+ previous_intent = 'inputremovalapi'\r
+ pos_of_semicolon = [_.start() for _ in re.finditer(":", message)]\r
+ remove_api_names = message[pos_of_semicolon[0]+1:]\r
+ MODULE_NAME = module_name.lower()\r
+ CURRENT_PATH = get_current_dir_path()\r
+ TC_DIR_PATH = CURRENT_PATH + r'src/utc/'\r
+ # print("Above mentioned APIs will be removed" + "\n\n" + deprecated_api_removal(MODULE_NAME, remove_api_names))\r
+ REMOVE_TC_LIST, NOT_FOUND_API_LIST = deprecated_api_removal(MODULE_NAME, remove_api_names, TC_DIR_PATH)\r
+ REMOVE_TC_LIST_NUMBERED = ""\r
+ NOT_FOUND_API_LIST_NUMBERED = ""\r
+ for i, item in enumerate(REMOVE_TC_LIST, start=1):\r
+ REMOVE_TC_LIST_NUMBERED += f"{i}. {item}" + "\n"\r
+ for i, item in enumerate(NOT_FOUND_API_LIST, start=1):\r
+ NOT_FOUND_API_LIST_NUMBERED += f"{i}. {item}" + "\n"\r
+\r
+ if len(REMOVE_TC_LIST) == 0:\r
+ result = "TCs not found for the below APIs (Please remove these not found TCs manually)\n\n" + f"{NOT_FOUND_API_LIST_NUMBERED}" + "\n\n[ To navigate, please type 'Back' ]"\r
+ elif len(REMOVE_TC_LIST) > 0 and len(NOT_FOUND_API_LIST) == 0:\r
+ result = "Above mentioned TCs will be removed. Please find TCs detail for these APIs as below:\n\n" + f"{REMOVE_TC_LIST_NUMBERED}" + "\n\nIf above TCs information is correct then type 'YES' to remove them otherwise 'NO'" + "\n\n[ To navigate, please type 'Back' ]"\r
+ elif len(REMOVE_TC_LIST) > 0 and len(NOT_FOUND_API_LIST) > 0:\r
+ result = "Above mentioned TCs will be removed. Please find TCs detail for these APIs as below:\n\n" + f"{REMOVE_TC_LIST_NUMBERED}" + "\n\nTCs not found for the below APIs (Please remove these not found TCs manually)\n\n" + f"{NOT_FOUND_API_LIST_NUMBERED}" + "\n\nIf above TCs information is correct then type 'YES' to remove them otherwise 'NO'" + "\n\n[ To navigate, please type 'Back' ]"\r
else:\r
- result="File name details not entered!! \n\n Please provide file name in the format of \nFile name:\n\n [ To navigate, please type 'Back' ]"\r
+ result = "Above mentioned TCs will be removed. Please find TCs detail for these APIs as below:\n\n" + f"{REMOVE_TC_LIST_NUMBERED}" + "\n\nTCs not found for the below APIs (Please remove these not found TCs manually)\n\n" + f"{NOT_FOUND_API_LIST_NUMBERED}" + "\n\nIf above TCs information is correct then type 'YES' to remove them otherwise 'NO'" + "\n\n[ To navigate, please type 'Back' ]"\r
+\r
\r
+ elif intent == 'donotremove':\r
+ previous_intent = 'donotremove'\r
+ pos_of_semicolon = [_.start() for _ in re.finditer(":", message)]\r
+ exclude_api_names = message[pos_of_semicolon[0]+1:]\r
+ MODULE_NAME = module_name.lower()\r
+ CURRENT_PATH = get_current_dir_path()\r
+ TC_DIR_PATH = CURRENT_PATH + r'src/utc/'\r
+ delete_apis_from_header_files(MODULE_NAME, exclude_api_names, TC_DIR_PATH, REMOVE_TC_LIST)\r
+ result = "APIs removed successfully. Type 'Exit' to close the tool."\r
\r
elif intent == 'executetc':\r
MODULE_NAME = module_name\r
previous_intent = "executetc"\r
execute_tc_params_text = message\r
- # print("execute_tc_params_text", execute_tc_params_text)\r
build_params = get_build_parameters(message)\r
- # print("params", build_params)\r
arch_value = build_params[0].lower()\r
- # print(arch_value)\r
profile_value = build_params[1].lower()\r
- # print(profile_value)\r
\r
if (arch_value == "armv7l" or arch_value == "x86" or arch_value == "x64" or arch_value == "aarch64") and (profile_value == "tv" or profile_value == "tizeniot"):\r
- # print("build params are correct")\r
- bar("Build Started !! Please wait...")\r
+ bar(get_en_or_ko_replies('translate_49', radio_var.get()))\r
output_build = tpk_build_install("build", "utc", MODULE_NAME, build_params[1], build_params[0])\r
# time.sleep(3)\r
if output_build.find("CREATION SUCCESSFUL") != -1:\r
if previous_intent == 'executetc':\r
style.configure("text.Horizontal.TProgressbar", text="",background="lightgray",foreground="lightgray", font=("Malgun Gothic", 10, 'bold'))\r
base.update()\r
- result = "Build completed successfully" + "\n\n" + "Do you want to execute TCs?" + "\n" + "(Yes or No)"\r
+ result = get_en_or_ko_replies('translate_51', radio_var.get())\r
else:\r
- result = "Build Failed, Please check the TC file and try again."\r
+ result = get_en_or_ko_replies('translate_52', radio_var.get())\r
print(output_build)\r
else:\r
- result = "Build parameters values are not correct" + "\n" + "Please try again.."\r
+ result = get_en_or_ko_replies('translate_53', radio_var.get())\r
\r
- elif intent == "launchtctmgr":\r
- # print("inside launchtctmgr intent")\r
+ if intent == "launchtctmgr":\r
+ print("inside launchtctmgr intent")\r
bar("Installing...")\r
execute_params = get_build_parameters(execute_tc_params_text)\r
output_execute = tpk_build_install("install", "utc", MODULE_NAME, execute_params[1], execute_params[0])\r
base.update()\r
open_tct_mgr()\r
previous_intent="after_launch"\r
- result = "Installing the package..." + "Make sure the target is connected" "\n" + "Launching TCT-MGR tool" "\n\n" + "Do you want to continue for another module?"\r
+ result = get_en_or_ko_replies('translate_54', radio_var.get())\r
\r
print(output_execute)\r
\r
print("^^^^^^^^^^^^^^^^^^^^^^^^")\r
print(build_log_debug(build_log))\r
build_fail_reason = build_log_debug(build_log)\r
- result = build_fail_reason + "\n\n [ To navigate, please type 'Back' ]"\r
+ result = build_fail_reason + get_en_or_ko_replies('translate_55', radio_var.get())\r
\r
\r
elif intent == "goback":\r
- # print("checking new module value from goback", new_module)\r
- # print("Going back\n")\r
- # print("previous stage is ", last_stage_index)\r
- # print("previous result was: ")\r
- # print(result)\r
if last_stage_index == 6:\r
- result = "You can't go back at this stage. Please write the appropriate inputs"\r
+ result = get_en_or_ko_replies('translate_56', radio_var.get())\r
else:\r
previous_intent = "goback"\r
ind = 0\r
- result = "Please select numbers for the corresponding stage you want to go to:\n"\r
+ result = get_en_or_ko_replies('translate_57', radio_var.get())\r
while ind <= last_stage_index and ind < 6:\r
result = result + str(ind+1) + ". " + stage_list[ind] + "\n"\r
ind = ind + 1\r
- result = result + "\n\n" + "If you wish to EXIT, Please type Exit"\r
+ result = result + "\n\n" + get_en_or_ko_replies('translate_58', radio_var.get())\r
\r
except KeyboardInterrupt:\r
print('Interrupted')\r
os._exit(130)\r
except:\r
log_create(logger, "Error occurred in get_prediction function")\r
- return "Invalid Input. Please try writing again"\r
-\r
+ if radio_var.get() == 2:\r
+ result_next = translate_to_ko("Invalid Input. Please try writing again")\r
+ return result_next\r
\r
\r
return result\r
EntryBox.delete("0.0",END)\r
\r
if msg != '':\r
- # print("msg ############", msg)\r
if '\n' in msg:\r
msg = msg.replace('\n','')\r
msg = msg.replace('\t','')\r
- # print("msg after ############", msg)\r
\r
log_info_save(logger, "YOU", msg)\r
ChatLog.config(state=NORMAL)\r
if response=="Yes":\r
base.destroy()\r
\r
+def radiobutton_event():\r
+ print("radiobutton toggled, current value:", radio_var.get())\r
+ # child_info = base.winfo_children()\r
+ # print(child_info)\r
+ print("ChatLog.winfo_children()", ChatLog.winfo_children())\r
+ for child in ChatLog.winfo_children():\r
+ if child.widgetName == "frame":\r
+ child.destroy()\r
+ ChatLog.delete('0.0', END)\r
+ if radio_var.get() == 2:\r
+ Bot.destroy()\r
+ welcomeText = "Assistant: Hey, Welcome to TC Assistance System. Tell me how would you like to proceed? \n > You can add a new UTC in existing module\n > You can add UTC in new module\n > Support Assistant\n > Remove Deprecated APIs\n"\r
+ welcomeText = translate_to_ko(welcomeText)\r
+ Bot_ko = customtkinter.CTkLabel(ChatLog,text=welcomeText+"\n\n", justify='left', fg_color='#C0C0C0',text_color='black',corner_radius=10,font=("Malgun Gothic", 13),wraplength=500, cursor="hand2")\r
+ # ChatLog.insert('end', '\n ')\r
+ ChatLog.window_create('end', window=Bot_ko)\r
+ ChatLog.insert(END, '\n')\r
+ elif radio_var.get() == 1:\r
+ Bot.destroy()\r
+ welcomeText = "Assistant: Hey, Welcome to TC Assistance System. Tell me how would you like to proceed? \n > You can add a new UTC in existing module\n > You can add UTC in new module\n > Support Assistant\n > Remove Deprecated APIs\n"\r
+ Bot_ko = customtkinter.CTkLabel(ChatLog,text=welcomeText+"\n", justify='left', fg_color='#C0C0C0',text_color='black',corner_radius=10,font=("Malgun Gothic", 13),wraplength=500, cursor="hand2")\r
+ # ChatLog.insert('end', '\n ')\r
+ ChatLog.window_create('end', window=Bot_ko)\r
+ ChatLog.insert(END, '\n')\r
+ return radio_var.get()\r
+\r
\r
CURRENT_PATH = get_current_dir_path()\r
CURRENT_PATH_IMG = get_current_dir_path_for_image()\r
ChatLog = Text(base, bd=0, relief=FLAT, bg='#d3d3d3', highlightthickness=0, font="Arial",wrap=WORD)\r
ChatLog.pack(fill=BOTH, expand=True)\r
\r
-welcomeText = "Hey, Welcome to TC Assistance System. Tell me how would you like to proceed? \n > You can add a new UTC in existing module\n > You can add UTC in new module\n > Support Assistant\n"\r
+welcomeText = "Hey, Welcome to TC Assistance System. Tell me how would you like to proceed? \n > You can add a new UTC in existing module\n > You can add UTC in new module\n > Support Assistant\n > Remove Deprecated APIs\n"\r
\r
log_info_save(logger, "Assitant", welcomeText)\r
\r
+radio_var = tkinter.IntVar(value=0)\r
Bot = customtkinter.CTkLabel(ChatLog,text="Assistant: "+welcomeText, justify='left', fg_color='#C0C0C0',text_color='black',corner_radius=10,font=("Malgun Gothic", 13),wraplength=500, cursor="hand2")\r
ChatLog.insert('end', '\n ')\r
ChatLog.window_create('end', window=Bot)\r
ChatLog.insert(END, '\n')\r
+# Bot.after(1, Bot.destroy())\r
+\r
\r
ChatLog.config(state=DISABLED)\r
\r
copyrightText = customtkinter.CTkLabel(base,text='Copyright (c) 2023 Samsung Electronics Co., Ltd.',justify='right',padx=4)\r
\r
helpButton = customtkinter.CTkButton(base,text='Help',width=115,fg_color='#757575',hover_color="#343434",text_color='white',command= helpText)\r
+englishButton = customtkinter.CTkButton(base,text='En',width=35,fg_color='#757575',hover_color="#343434",text_color='white',command= helpText)\r
+koreanButton = customtkinter.CTkButton(base,text='Ko',width=35,fg_color='#757575',hover_color="#343434",text_color='white',command= helpText)\r
+\r
+radiobutton_1 = customtkinter.CTkRadioButton(base, text="En",\r
+ command=radiobutton_event, variable= radio_var, value=1, width=55)\r
+radiobutton_2 = customtkinter.CTkRadioButton(base, text="Ko",\r
+ command=radiobutton_event, variable= radio_var, value=2, width=55)\r
+radiobutton_1.select()\r
ChatLog.yview(END)\r
\r
scrollbar.place(x=576, y=22)\r
SendButton.place(x=470, y=688)\r
copyrightText.place(x=6, y=770)\r
helpButton.place(x=470,y=765)\r
+radiobutton_1.place(x=350,y=765)\r
+radiobutton_2.place(x=405,y=765)\r
progress.place(width=150)\r
progress.pack(fill=X, ipady=2)\r
base.bind('<Return>',send)\r
base.bind_all("<MouseWheel>", _on_mousewheel)\r
EntryBox.bind("<Control-Key-a>", select_all)\r
EntryBox.bind("<Control-Key-A>", select_all)\r
-base.bind('<Control-c>', quit)\r
+# base.bind('<Control-c>', quit)\r
base.mainloop()\r
TARGET_API_INPUT_PARAMS_LIST = []
Module_name_new =""
-tc_code_inti = """/**
- * @testcase utc_bluetooth_bt_initialize_p
- * @since_tizen 9.0
- * @description
- * @scenario
- */
-int utc_bluetooth_bt_initialize_p(void)
-{
- int ret = bt_initialize();
- assert_eq(ret, BT_ERROR_NONE);
-
- return 0;
-}"""
-
-
def check_if_str_or_int(inp_string):
if "char" in inp_string:
# return "test" if string
return "None"
def iniatialize_variables(inp_out_params_list_updated, all_comb_args_set, enum_dict, enum_dict_pre_post):
- # all_comb_args_set = ["const char interface", "const char service_type", "dnssd_service_h dnssd_service", "const char service_name", "unsigned int service_int"]
- # inp_out_params_list_updated = input_output_params_extract("nsd", "nsd/dns-sd-internal.h", "dnssd_create_remote_service", inp_out_params_list_updated)
- # inp_out_params_list_updated = input_output_params_extract("nsd", "nsd/dns-sd-internal.h", "dnssd_destroy_remote_service", inp_out_params_list_updated)
- ## print(inp_out_params_list_updated)
- ## print(check_if_param_is_in_or_out(inp_out_params_list_updated))
- #enum_dict = {'dnssd_service_set_interface': {'webrtc_state_e': 'WEBRTC_ERROR_PERMISSION_DENIED'}, 'webrtc_get_state': {'webrtc_state_e': 'WEBRTC_STATE_IDLE'}}
check_if_param_is_in_or_out_dict = check_if_param_is_in_or_out(inp_out_params_list_updated)
store_last_word_of_args = []
for pos, ele in enumerate(all_comb_args_set):
del all_comb_args_set[pos]
else:
all_comb_args_set[pos] = ele
- ## print("all combs args set")
- ## print(all_comb_args_set)
- ## print("storing", store_last_word_of_args)
+
store_last_word_of_args1 = store_last_word_of_args[0:pos+1]
if ele.split()[-1] in store_last_word_of_args1:
all_comb_args_set.remove(all_comb_args_set[pos])
all_comb_args_set.remove(i)
for pos, i in enumerate(all_comb_args_set):
- # print("reached till here tc_code4 part 0")
- # print(all_comb_args_set)
if i != "" and i != "void":
variable_name = i.split(" ")[1]
datatype_name = i.split(" ")[0]
- # print("var name", variable_name)
- # print("data name", datatype_name)
variable_name_without_ptr = variable_name.replace("*","")
- # print("var name without ptr", variable_name_without_ptr)
flag = 0
flag_pre_post = 0
- # print("reached till here tc_code4 part 1",enum_dict)
for ele, val in enum_dict.items():
- # print("entered", ele, val)
for ele1, val1 in val.items():
- # print("entered1", ele1, val1)
if ele1 in i:
if variable_name_without_ptr in check_if_param_is_in_or_out_dict:
if check_if_param_is_in_or_out_dict[variable_name_without_ptr] == "out":
break
if flag == 1:
break
- # print("reached till here tc_code4 part 2",enum_dict_pre_post)
+
if "=" not in all_comb_args_set[pos]:
for ele, val in enum_dict_pre_post.items():
- # print("entered inside pre post api", ele, val)
for ele1, val1 in val.items():
- # print("entered1 inside pre post api", ele1, val1)
+
if ele1 in i:
if variable_name_without_ptr in check_if_param_is_in_or_out_dict:
if check_if_param_is_in_or_out_dict[variable_name_without_ptr] == "out":
break
if flag == 1:
break
- # print("reached till here tc_code4 part 3")
- # print("all arguments sequential ", i)
+
if i == "void" or i == "void;" or i == "" or i == " ":
all_comb_args_set.remove(i)
- # # print("all_comb_args_set => ", all_comb_args_set)
- # print("alllll_comb_argsssssss",all_comb_args_set)
+
tc_code4 = (
f" {k};"
"\n"
for k in all_comb_args_set)
- # print(tc_code4)
return ''.join(tc_code4)
-
-
-def tc_code_write(RET_TYPE, MODULE_NAME, API_NAMES, FUNC_ARGS):
- tc_code = (
- "/**\n"
- f"* @testcase utc_{API_NAMES}_p\n"
- "* @since_tizen 9.0\n"
- "* @description \n"
- "* @scenario \n"
- "*/\n"
- f"{RET_TYPE} utc_{API_NAMES}_p(void)\n"
- "{\n"
- " int ret;\n"
-
- f" ret = {API_NAMES}({FUNC_ARGS.replace('*', '&')});\n"
- f" assert_eq(ret, TIZEN_ERROR_NONE);\n"
-
- " return 0;\n"
- "}\n"
- )
-
- return tc_code
-
def concat_params1(v):
FUNC_ARGS = ""
FUNC_ARGS = v[0].split()[-1]
def list_target_api_in_params(API_NAME, check_if_param_is_in_or_out_dict, inp_out_params_list_updated):
TARGET_API_INPUT_PARAMS_LIST.clear()
if API_NAME in inp_out_params_list_updated:
- #if len(inp_out_params_list_updated)>0:
in_out_array = inp_out_params_list_updated[API_NAME]
- # print("in_out_array",in_out_array)
- ## print("inp_out_params_list_updated[API_NAME]",inp_out_params_list_updated[API_NAME])
for ele in in_out_array:
for key, val in ele.items():
if val == 'in' and "_cb" not in key and 'user_data' not in key:
def concat_params(CURR_API, v, check_if_param_is_in_or_out_dict, inp_out_params_list_updated, all_callback_args, IDX_CALLBACK, PRE_POST_API_ARGS_LIST, TARGET_API_ARGS, TARGET_API_NAME_CB):
FUNC_ARGS = ""
- # print("CURR_API", CURR_API)
- # print("check_if_param_is_in_or_out_dict", check_if_param_is_in_or_out_dict)
- # print("inp_out_params_list_updated[CURR_API]", inp_out_params_list_updated)
- # print("inp_out_params_list_updated[CURR_API]", inp_out_params_list_updated[CURR_API])
- # print("inp_out_params_list_updated", inp_out_params_list_updated)
COMBINED_API_ARGS_DICT_CB = PRE_POST_API_ARGS_LIST.copy()
- # print("PRE_POST_API_ARGS_LIST", PRE_POST_API_ARGS_LIST)
- # print("TARGET_API_ARGS", TARGET_API_ARGS)
- # print("TARGET_API_NAME_CB", TARGET_API_NAME_CB)
COMBINED_API_ARGS_DICT_CB[TARGET_API_NAME_CB] = TARGET_API_ARGS
- # print("COMBINED_API_ARGS_DICT_CB", COMBINED_API_ARGS_DICT_CB)
- # print(v)
- # print("inp_out_params_list_updated inside concat_params", inp_out_params_list_updated)
- # print("all_callback_args inside concat_params", all_callback_args)
for j in range(0, len(v)):
- # print("j",j)
- # print("(v[j].split()[-1])", (v[j].split()[-1]))
- # print("v[j].split()[-1]).replace('*', '')",(v[j].split()[-1]).replace('*', ''))
if (v[j].split()[-1]).replace('*', '') in check_if_param_is_in_or_out_dict:
for ij in inp_out_params_list_updated[CURR_API]:
- # print("inp_out_params_list_updated[CURR_API]sdfsadfsda",inp_out_params_list_updated[CURR_API])
- # print("ij # print inside concat", ij)
key = list(ij.keys())[0]
value = ij[key]
splited_key = curr_ele.split()[0]
if splited_key in all_callback_args[IDX_CALLBACK]:
FUNC_ARGS += "callback_" + all_callback_args[IDX_CALLBACK] + ', '
- # print("FUNC_ARGS inside callback")
- # print(FUNC_ARGS)
IDX_CALLBACK = IDX_CALLBACK + 1
# break
- # print("FUNC_ARGS at the end")
- # print(FUNC_ARGS)
- # flag = flag + 1
- # print("final func args")
- # print(FUNC_ARGS)
else:
- # print("Func_args in else",FUNC_ARGS)
FUNC_ARGS += "" + (v[j].split()[-1]) + ', '
FUNC_ARGS = FUNC_ARGS.strip()
- # print("fuinc args", FUNC_ARGS)
FUNC_ARGS = FUNC_ARGS.rstrip(FUNC_ARGS[-1])
if "void" in FUNC_ARGS:
return ""
def tc_code_write1(RET_TYPE, MODULE_NAME, API_NAME, PRE_POST_API_LIST, PRE_POST_API_ARGS_LIST, TARGET_API_ARGS, HEADER_FILE_CONTAINED_FOLDER, enum_dict, enum_dict_pre_post, feature_name, callback_duplicate_check):
- # PRE_POST_API_LIST = PRE_POST_API_LIST['badge_create']
- ## print("checking")
- ## print("enum_dict", enum_dict)
- ## print("enum_pre_post", enum_dict_pre_post)
IDX_CALLBACK = 0
inp_out_params_list_updated = {}
check_if_param_is_in_or_out_dict = {}
header_files_dict = get_header_files(MODULE_NAME)
- ## print("##############")
- ## print("header_files_dict",header_files_dict)
# for ever file in the dictionary we have to check if all the api names provided by the user exists or not
# we will take api names one by one and check in all the files if it exists or not
for API_SEARCH in pre_apis:
- ## print("API_SEARCH",API_SEARCH)
for HEADER_FILE_NAME in header_files_dict:
- ## print("HEADER_FILE_NAME",HEADER_FILE_NAME)
inp_out_params_list_updated = input_output_params_extract(MODULE_NAME, HEADER_FILE_NAME, API_SEARCH, inp_out_params_list_updated)
- # print("inp_out_params_list_updated in pre api",inp_out_params_list_updated)
- # print("post_apis",post_apis)
+
for API_SEARCH in post_apis:
- ## print("hi")
for HEADER_FILE_NAME in header_files_dict:
- ## print("hi1")
inp_out_params_list_updated = input_output_params_extract(MODULE_NAME, HEADER_FILE_NAME, API_SEARCH, inp_out_params_list_updated)
- # print("inp_out_params_list_updated in post api",inp_out_params_list_updated)
- ## print("hi in post")
for HEADER_FILE_NAME in header_files_dict:
- ## print("hi")
- ## print("HEADER_FILE_NAME",HEADER_FILE_NAME)
inp_out_params_list_updated = input_output_params_extract(MODULE_NAME, HEADER_FILE_NAME, API_NAME, inp_out_params_list_updated)
- # print("inp_out_params_list_updated in header file",inp_out_params_list_updated)
for HEADER_FILE_NAME in header_files_dict:
api_desc = api_description_extract(MODULE_NAME, HEADER_FILE_NAME, API_NAME)
- # print("api_desc",api_desc)
if api_desc != "":
break
- ## print("###### inp_out_params_list_updated")
- ## print(inp_out_params_list_updated)
- # global callback_duplicate_check
TARGET_API_NAME_CB = API_NAME
callback_func_combined = ""
for cb_name in all_callback_args:
for header_file in header_files_dict:
- #print("header_files_dict",header_files_dict)
- #print(header_file)
if cb_name not in callback_duplicate_check:
callback_func_combined = callback_func_combined + cb_function_declaration(MODULE_NAME,header_file,cb_name)
- #print('cb_function_declaration(MODULE_NAME,header_file,cb_name', cb_function_declaration(MODULE_NAME,header_file,cb_name))
if cb_function_declaration(MODULE_NAME,header_file,cb_name) != '':
callback_duplicate_check.append(cb_name)
# break
else:
callback_func_combined = callback_func_combined + ''
- # callback_duplicate_check = callback_duplicate_check + all_callback_args
- # print("callback_func_combined")
API_NAME = API_NAME.strip()
- # print("RET_TYPE - ", RET_TYPE, "API_NAME - ", API_NAME)
tc_code0 = (
"/**\n"
tc_code4 = iniatialize_variables(inp_out_params_list_updated, all_comb_args_set, enum_dict, enum_dict_pre_post)
- # print("tc_code_4", tc_code4)
tc_code6 = callback_func_combined
check_if_param_is_in_or_out_dict = init_params_in_out_dict(inp_out_params_list_updated)
# function call to iniatialize
- # print("inp_out_params_list_updated",inp_out_params_list_updated)
list_target_api_in_params(API_NAME, check_if_param_is_in_or_out_dict, inp_out_params_list_updated)
if MODULE_NAME == "nsd":
tc_code1 = (f" ret = {i}({concat_params(i, PRE_POST_API_ARGS_LIST[i], check_if_param_is_in_or_out_dict, inp_out_params_list_updated, all_callback_args, IDX_CALLBACK, PRE_POST_API_ARGS_LIST, TARGET_API_ARGS, TARGET_API_NAME_CB)});\n assert_eq(ret, TIZEN_ERROR_NONE);\n\n" if RET_TYPE[i] != 'void' else f" {i}({concat_params(i, PRE_POST_API_ARGS_LIST[i], check_if_param_is_in_or_out_dict, inp_out_params_list_updated, all_callback_args, IDX_CALLBACK, PRE_POST_API_ARGS_LIST, TARGET_API_ARGS, TARGET_API_NAME_CB)});\n\n" for i in pre_apis)
-
- # print("tc_code1",tc_code1)
tc_code_feature = ""
if RET_TYPE[API_NAME] != 'void':
if feature_name != "":
f" return 0;\n"
" }\n\n")
- # print("tc_code_feature",tc_code_feature)
if RET_TYPE[API_NAME] == 'void':
tc_code2 = (f" {API_NAME}({concat_params(API_NAME, TARGET_API_ARGS, check_if_param_is_in_or_out_dict, inp_out_params_list_updated, all_callback_args, IDX_CALLBACK, PRE_POST_API_ARGS_LIST, TARGET_API_ARGS, TARGET_API_NAME_CB)});\n\n")
else:
tc_code2 = (f" ret = {API_NAME}({concat_params(API_NAME, TARGET_API_ARGS, check_if_param_is_in_or_out_dict, inp_out_params_list_updated, all_callback_args, IDX_CALLBACK, PRE_POST_API_ARGS_LIST, TARGET_API_ARGS, TARGET_API_NAME_CB)});\n assert_eq(ret, TIZEN_ERROR_NONE);\n\n")
- # print("tc_code2",tc_code2)
tc_code3 = (f" ret = {j}({concat_params(j, PRE_POST_API_ARGS_LIST[j], check_if_param_is_in_or_out_dict, inp_out_params_list_updated, all_callback_args, IDX_CALLBACK, PRE_POST_API_ARGS_LIST, TARGET_API_ARGS, TARGET_API_NAME_CB)});\n assert_eq(ret, TIZEN_ERROR_NONE);\n\n" if RET_TYPE[j] != 'void' else f" {j}({concat_params(j, PRE_POST_API_ARGS_LIST[j], check_if_param_is_in_or_out_dict, inp_out_params_list_updated, all_callback_args, IDX_CALLBACK, PRE_POST_API_ARGS_LIST, TARGET_API_ARGS, TARGET_API_NAME_CB)});\n\n"
for j in post_apis)
-
- # print("tc code 3", ''.join(tc_code3))
tc_code5 = (f" return 0;\n"
"}\n")
- # print("tc code 5", tc_code5)
- ## print("tc_code_6", tc_code6)
- ## print("checking tccode1")
- ## print(''.join(tc_code1))
- ## print("\n" + ''.join(tc_code1))
- ## print("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^66")
# print("checking tc")
# print("\n" + tc_code6 + "\n\n" + tc_code0 + tc_code + tc_code4 + "\n" + ''.join(tc_code1) + tc_code_feature + tc_code2 + ''.join(tc_code3) + tc_code5)
return "\n" + tc_code6 + "\n\n" + tc_code0 + tc_code + tc_code4 + "\n" + ''.join(tc_code1) + tc_code_feature + tc_code2 + ''.join(tc_code3) + tc_code5
--- /dev/null
+,Text,label
+0,add utc for webrtc apis,existingmodule
+1,The module is already existing,existingmodule
+2,REQUEST TO CREATE UTC OF NEW MODULE,newmodule
+3,tizen version 6.5,tizenversion
+4,Request is for Tizen version 6.0,tizenversion
+5,REQUEST TO COVER NEW APIS,request
+6,MODULE NAME: BLUETOOTH,modulename
+7,MODULE NAME:,modulename
+8,request to prepare utc,request
+9,file name: utc_media_webrtc.c,tcwritelocation
+10,THIS IS REQUEST TO COVER NEW MODULE APIS,newmodule
+11,FILE NAME: UTC_MEDIA_WEBRTC.C,tcwritelocation
+12,POST:,prepostinfo
+13,HI,greetings
+14,Add utc for webrtc APIs,existingmodule
+15,file name:,tcwritelocation
+16,pre: attach_panel_create,prepostinfo
+17,"its existing module, need to add new tcs",existingmodule
+18,"Its existing module, need to add new TCs",existingmodule
+19,TIZEN VERSION 6.5,tizenversion
+20,hello,greetings
+21,Tizen 6.5,tizenversion
+22,Tizen 7.0,tizenversion
+23,Pre: attach_panel_show Post: attach_panel_destroy,prepostinfo
+24,Request to create UTC of new module,newmodule
+25,"ITS EXISTING MODULE, NEED TO ADD NEW TCS",existingmodule
+26,Tizen version 6.5,tizenversion
+27,the module is already existing,existingmodule
+28,Request is for Tizen version 7.0,tizenversion
+29,FILE NAME:,tcwritelocation
+30,request is for tizen version 6.0,tizenversion
+31,Tizen version 7.0,tizenversion
+32,PRE:,prepostinfo
+33,REQUEST IS FOR TIZEN VERSION 7.0,tizenversion
+34,API names: attach_panel_create attach_panel_destroy,apiinfo
+35,Tizen 6.0,tizenversion
+36,module name:,modulename
+37,request is for tizen version 6.5,tizenversion
+38,tizen version 6.0,tizenversion
+39,Post:,prepostinfo
+40,tizen 6.0,tizenversion
+41,module name: bluetooth,modulename
+42,api names:,apiinfo
+43,NEED TO ADD NEW APIS IN BLUETOOTH MODULE,existingmodule
+44,API names:,apiinfo
+45,Module name: bluetooth,modulename
+46,Module name:,modulename
+47,This is an ACR request,request
+48,This is request to cover new module APIs,newmodule
+49,file name: utc-messaging-email.c,tcwritelocation
+50,REQUEST TO PREPARE UTC,request
+51,pre: attach_panel_show post: attach_panel_destroy,prepostinfo
+52,TIZEN 7.0,tizenversion
+53,Tizen version 6.0,tizenversion
+54,HELLO,greetings
+55,tizen 7.0,tizenversion
+56,TIZEN VERSION 7.0,tizenversion
+57,THIS IS AN ACR REQUEST,request
+58,FILE name: utc-messaging-email.c,tcwritelocation
+59,post: attach_panel_destroy,prepostinfo
+60,Pre: attach_panel_create,prepostinfo
+61,PRE: ATTACH_PANEL_SHOW POST: ATTACH_PANEL_DESTROY,prepostinfo
+62,REQUEST IS FOR TIZEN VERSION 6.5,tizenversion
+63,API NAMES:,apiinfo
+64,REQUEST IS FOR TIZEN VERSION 6.0,tizenversion
+65,Request is for Tizen version 6.5,tizenversion
+66,request to cover new apis,request
+67,TIZEN 6.0,tizenversion
+68,FILE name:,tcwritelocation
+69,TIZEN 6.5,tizenversion
+70,API NAMES: ATTACH_PANEL_CREATE ATTACH_PANEL_DESTROY,apiinfo
+71,POST: ATTACH_PANEL_DESTROY,prepostinfo
+72,tizen version 7.0,tizenversion
+73,Request to cover new APIS,request
+74,hi,greetings
+75,hello,greetings
+76,THE MODULE IS ALREADY EXISTING,existingmodule
+77,request is for tizen version 7.0,tizenversion
+78,Need to add new APIs in bluetooth module,existingmodule
+79,post:,prepostinfo
+80,FILE name: utc_media_webrtc.c,tcwritelocation
+81,Request to prepare UTC,request
+82,FILE NAME: UTC-MESSAGING-EMAIL.C,tcwritelocation
+83,request to create utc of new module,newmodule
+84,ARCH: PROFILE: ,executetc
+85,need to add new apis in bluetooth module,existingmodule
+86,this is request to cover new module apis,newmodule
+87,Pre:,prepostinfo
+88,hi,greetings
+89,Post: attach_panel_destroy,prepostinfo
+90,PRE: ATTACH_PANEL_CREATE,prepostinfo
+91,ARCH: armv7l PROFILE: wearable,executetc
+92,this is an acr request,request
+93,pre:,prepostinfo
+94,ARCH: armv7l PROFILE: tizeniot,executetc
+95,TIZEN VERSION 6.0,tizenversion
+96,ARCH: armv7l PROFILE: mobile,executetc
+97,ADD UTC FOR WEBRTC APIS,existingmodule
+98,api names: attach_panel_create attach_panel_destroy,apiinfo
+99,ARCH: armv7l PROFILE: tv,executetc
+100,tizen 6.5,tizenversion
+101,header info:,headerinfo
+102,Do you want to add negative TCs?,negativetc
+103,Add a negative TC,negativetc
+104,negative TC,negativetc
+105,Header File:dns-sd.h,headerinfo
+106,Back,goback
+107,I want to go back,goback
+108,Feature name:,featureinfo
+109,feature:,featureinfo
+110,New module:,newmodule
+111,newmodule:,newmodule
+112,Header File:,headerinfo
+113,headerfile:,headerinfo
+114,existing,existingmodule
+115,I want to add negative tc,negativetc
+116,NEW MODULE:webrtc,newmodule
+117,pre:yaca_key_generate,prepostinfo
+118,pre:yaca,prepostinfo
+119,Pre:yaca,prepostinfo
+120,PRE:yaca,prepostinfo
+121,Module name:yaca,modulename
+122,Support,supportsys
+123,I want support for issue,supportsys
+124,Environment Setup,envsetupsupport
+125,Need help for environment setup,envsetupsupport
+126,Installing rootstrap,rootstrapsupport
+127,Need help for installing rootstrap,rootstrapsupport
+128,Build Issue,buildsupport
+129,I want support for build related issue,buildsupport
+130,Logs:,buildlogdebug
+131,log:,buildlogdebug
+132,Install issue,installsupport
+133,I want help regarding install issue,installsupport
+134,Need support,supportsys
+135,Support Assistant,supportsys
+136,i need to add a new module,newmodule
+137,dictionary:,prepostinfo
+138,dictionary: post:,prepostinfo
+139,remove deprecated api,removeapi
+140,remove apis,removeapi
+141,REMOVE APIS,removeapi
+142,REMOVE DEPRECATED API,removeapi
+143,deprecated apis,removeapi
+144,DEPRECATED APIS,removeapi
+145,"DELETE: API_NAME_1, API_NAME_2",inputremovalapi
+146,DELETE:,inputremovalapi
+147,delete:,inputremovalapi
+148,"delete: api_name_1, api_name_2",inputremovalapi
+149,"EXCLUDE: 1, 2, 3",donotremove
+150,"exclude: 1, 2, 3",donotremove
+151,EXCLUDE:,donotremove
+152,exclude:,donotremove
# We have prepared a dataset with 7 labels
try:
- df = pd.read_csv('newdata.csv', encoding='ISO-8859-1')
+ df = pd.read_csv('tool_dataset.csv', encoding='ISO-8859-1')
df.head()
except:
log_create(logger, "Error occurred while reading dataset file!")
self.relu = nn.ReLU()
self.fc1 = nn.Linear(768, 512)
self.fc2 = nn.Linear(512, 256)
- self.fc3 = nn.Linear(256, 21)
+ self.fc3 = nn.Linear(256, 24)
self.softmax = nn.LogSoftmax(dim=1)
def forward(self, sent_id, mask):