How to use go_back method in robotframework-ioslibrary

Best Python code snippet using robotframework-ioslibrary_python

fsm.py

Source:fsm.py Github

copy

Full Screen

...266 text = update.message.text267 return text.lower() == 'turbo'268 def on_enter_stateNCKUCSIEIntroduction(self, update):269 update.message.reply_text("history or professor")270 #self.go_back(update)271 def on_exit_stateNCKUCSIEIntroduction(self, update):272 print('Leaving stateNCKUCSIEIntroduction')273 def on_enter_stateHistory(self, update):274 update.message.reply_text("系所歷史與沿革\n本系為南台灣第一個純以資訊及計算機工程為重心的高級學術單位, 於民國七十六年八月成立碩士班,八十一年八月成立博士班, 於八十六年八月成立大學部,九十一年八月擴增大學部為兩班, 並於九十五學年度再增設醫學資訊研究所,一百年八月製造資訊與系統研究所整合至本系,以一系三所之模式進行。\n為因應國內高科技產業人力需求, 每位教授及研究生均積極參與國內外學術活動,並在高水準的期刊及會議上發表研究成果, 並有多位教授獲得學術榮譽如國科會傑出研究獎等獎項。")275 self.go_back(update)276 def on_exit_stateHistory(self, update):277 print('Leaving stateHistory')278 def on_enter_stateProfessor(self, update):279 update.message.reply_text("1.高宏宇\n2.連震杰\n3.李同益\n4.鄭芳田\n5.吳宗憲\n6.孫永年\n7.黃崇明\n8.謝孫源\n9.黃宗立\n10.郭耀煌\n11.陳裕民\n12.蔣榮先\n13.陳培殷\n14.李強\n15.陳響亮\n16.鄭憲宗\n17.楊大和\n18.蘇文鈺\n19.張燕光\n20.郭淑美\n21.王士豪\n22.蘇銓清\n23.蕭宏章\n24.張大緯\n25.梁勝富\n26.許靜芳\n27.盧文祥\n28.楊中平\n29.藍崑展\n30.林英超\n31.吳明龍\n32.陳朝鈞\n33.李家岩\n34.趙梓程\n35.蔡孟勳\n36.莊坤達\n37.蔡佩璇\n38.胡敏君\n39.涂嘉恒\n40.李信杰\n41.張瑞紘\n42.黃敬群\nexit")280 #self.go_back(update)281 def on_exit_stateProfessor(self, update):282 print('Leaving stateProfessor')283 def on_enter_state1(self, update):284 update.message.reply_text("高宏宇 教授 兼 代理系主任 兼 醫資所所長\n\n專長及研究領域:\n資訊檢索/資訊擷取、資料探勘、機器學習、全球資訊網資訊系統、生物資訊、社群網路計算\n\n系所別:\n資訊系 / 資訊所 / 醫資所\n\n電話:\n06-2757575 ext 62546\n\nE-mail:\nhykao@mail.ncku.edu.tw\n\n實驗室:\n智慧型知識管理實驗室 (資訊系館新大樓9F 65903)\n\n個人網頁:\nhttp://myweb.ncku.edu.tw/~hykao/\n")285 self.go_back(update)286 def on_exit_state1(self, update):287 print('Leaving state1')288 289 def on_enter_state2(self, update):290 update.message.reply_text("連震杰 教授 兼 副系主任 兼 製造所所長\n\n專長及研究領域:\n智慧型機器人及自動化、人機互動及擴增實境、3D自動光學檢測、視覺伺服控制、影像處理,3D電腦視覺及圖形辨識、機器學習、嵌入式系統、雲端智慧型監控服務\n\n系所別:\n資訊系 / 資訊所 / 製造所\n\n電話:\n06-2757575 ext 62540\n\nE-mail:\njjlien@csie.ncku.edu.tw\n\n實驗室:\n機器人實驗室 (資訊系館新大樓9F 65904)")291 self.go_back(update)292 def on_exit_state2(self, update):293 print('Leaving state2')294 295 def on_enter_state3(self, update):296 update.message.reply_text("李同益 講座教授\n\n專長及研究領域:\n3D遊戲設計 (3D Game Design)、3D NPR動畫合成(3D Non-photo-realistic rendering)、電腦繪圖與動畫(Computer Graphics and Animation)、電腦視覺化模擬(Visualization)、虛擬實境與環境(Virtual Reality and Environment)、醫學手術模擬系統(3D Medical Surgical Simulation and Application)、Video/Image Retargeting、3D Captcha Design for Internet Security\n\n系所別:\n資訊系 / 資訊所\n\n電話:\n06-2757575 ext 62531\n\nE-mail:\ntonylee@mail.ncku.edu.tw\n\n實驗室:\n電腦繪圖研究群/視覺系統實驗室 (資訊系館新大樓7F 65701)")297 self.go_back(update)298 def on_exit_state3(self, update):299 print('Leaving state3')300 301 def on_enter_state4(self, update):302 update.message.reply_text("鄭芳田 講座教授\n\n專長及研究領域:\nE化製造 (工業4.0)、半導體生產自動化、虛擬量測、預測保養、智慧型製造系統\n\n系所別:\n資訊系 / 製造所\n\n電話:\n06-2757575 ext 34224\n\nE-mail:\nchengft@mail.ncku.edu.tw\n\n實驗室:\n自動化實驗室 (自強校區儀器設備大樓95619)\n\n個人網頁:\nhttp://super.ime.ncku.edu.tw/pages/teacher.htm")303 self.go_back(update)304 def on_exit_state4(self, update):305 print('Leaving state4')306 307 def on_enter_state5(self, update):308 update.message.reply_text("吳宗憲 講座教授\n\n專長及研究領域:\n人工智慧與深度學習、語音與語者識別、語音合成與變音、口述語言對話與理解、多媒體情緒辨識與追蹤、影音多媒體摘要與檢索、聽語障口/手語學習輔具、電腦輔助口說語言學習、多媒體人機互動\n\n系所別:\n資訊系 / 資訊所\n\n電話:\n電話:06-2757575 ext 62521\n\nE-mail:\nchunghsienwu@gmail.com; chwu@csie.ncku.edu.tw\n\n實驗室:\n多媒體人機通訊實驗室 (資訊系館新大樓8F 65801)\n\n個人網頁:\nhttp://chinese.csie.ncku.edu.tw/web_tw/professor/")309 self.go_back(update)310 def on_exit_state5(self, update):311 print('Leaving state5')312 313 def on_enter_state6(self, update):314 update.message.reply_text("孫永年 特聘教授\n\n專長及研究領域:\n影像處理、電腦視覺、醫學影像、工業檢測、醫學資訊、視訊科學、虛擬環境\n\n系所別:\n資訊系 / 資訊所 / 醫資所\n\n電話:\n06-2757575 ext 62526\n\nE-mail:\nynsun@mail.ncku.edu.tw\n\n實驗室:\n視覺系統實驗室 (資訊系館新大樓7F 65702)")315 self.go_back(update)316 def on_exit_state6(self, update):317 print('Leaving state6')318 319 def on_enter_state7(self, update):320 update.message.reply_text("黃崇明 特聘教授\n\n專長及研究領域:\n無線及行動網路和協定設計與分析、多媒體處理和串流技術、綠色通訊與計算、創意網路應用與服務\n\n系所別:\n資訊系 / 資訊所\n\n電話:\n06-2757575 ext 62523\n\nE-mail:\nhuangcm@locust.csie.ncku.edu.tw\ncmdhuang@gmail.com\n\n實驗室:\n多媒體行動電腦網路實驗室 (資訊系館新大樓3F 65303)")321 self.go_back(update)322 def on_exit_state7(self, update):323 print('Leaving state7')324 325 def on_enter_state8(self, update):326 update.message.reply_text("謝孫源 特聘教授 兼 研發長\n\n專長及研究領域:\n容錯計算、生物資訊、平行及分散式計算、演算法設計與分析、圖形理論\n\n系所別:\n資訊系 / 資訊所 / 醫資所\n\n電話:\n06-2757575 ext 62538\n\nE-mail:\nhsiehsy@mail.ncku.edu.tw\n\n實驗室:\n互連網路暨高效率計算實驗室 (資訊系館新大樓8F 65803)\n\n個人網頁:\nhttp://algorithm.csie.ncku.edu.tw/syhsieh.htm")327 self.go_back(update)328 def on_exit_state8(self, update):329 print('Leaving state8')330 331 def on_enter_state9(self, update):332 update.message.reply_text("黃宗立 特聘教授\n\n專長及研究領域:\n密碼技術、網路安全、資訊安全、門禁系統、錯誤控制碼、量子密碼學\n\n系所別:\n資訊系 / 資訊所\n\n電話:\n06-2757575 ext 62524\n\nE-mail:\nhwangtl@csie.ncku.edu.tw\n\n實驗室:\n量子資訊與網路安全實驗室 (資訊系館新大樓6F 65603)")333 self.go_back(update)334 def on_exit_state9(self, update):335 print('Leaving state9')336 337 def on_enter_state10(self, update):338 update.message.reply_text("郭耀煌 特聘教授\n\n專長及研究領域:\n嵌入式系統與應用、感測網路與隨意計算、寬頻網路系統、智慧型資訊系統、網際網路服務、物件導向式設計、模糊系統、知識庫系統、系統晶片設計、人工智慧、情境感知、數位家庭\n\n系所別:\n資訊系 / 資訊所 / 醫資所\n\n電話:\n06-2757575 ext 62522\n\nE-mail:\nkuoyh@ismp.csie.ncku.edu.tw\n\n實驗室:\n智慧型系統暨媒體處理實驗室 (資訊系館新大樓5F 65507)")339 self.go_back(update)340 def on_exit_state10(self, update):341 print('Leaving state10')342 343 def on_enter_state11(self, update):344 update.message.reply_text("陳裕民 特聘教授\n\n系所別:\n資訊系 / 製造所\n\n電話:\n06-2757575 ext 34222\n\nE-mail:\nymchen@mail.ncku.edu.tw\n\n實驗室:\n企業工程與整合實驗室 (自強校區儀器設備大樓95604)")345 self.go_back(update)346 def on_exit_state11(self, update):347 print('Leaving state11')348 349 def on_enter_state12(self, update):350 update.message.reply_text("蔣榮先 特聘教授 兼 計算機與網路中心主任\n\n專長及研究領域:\n生醫資訊探勘、人工智慧、智慧型計算、雲端醫療照護、癌症與幹細胞研究、巨量資料分析、手持穿戴裝置行動計算\n\n系所別:\n資訊系 / 資訊所 / 醫資所 / 計網中心\n\n電話:\n06-2757575 ext 62534\n\nE-mail:\njchiang@mail.ncku.edu.tw\n\n實驗室:\n智慧型資訊擷取實驗室 (資訊系館新大樓6F 65604)")351 self.go_back(update)352 def on_exit_state12(self, update):353 print('Leaving state12')354 355 def on_enter_state13(self, update):356 update.message.reply_text("陳培殷 特聘教授 兼 電資學院副院長\n\n專長及研究領域:\nVLSI電路/FPGA晶片設計、人工智慧AI影像處理與應用、資訊系統開發、嵌入式系統開發設計\n\n系所別:\n資訊系 / 資訊所\n\n電話:\n06-2757575 ext 62547\n\nE-mail:\npychen@mail.ncku.edu.tw\n\n實驗室:\n數位晶片設計實驗室 (資訊系館新大樓10F 65A01)")357 self.go_back(update)358 def on_exit_state13(self, update):359 print('Leaving state13')360 361 def on_enter_state14(self, update):362 update.message.reply_text("李強 教授\n\n專長及研究領域:\n大數據/巨量資料處理技術、社群網站/雲端平行計算、地理資訊系統、網際網路資料庫與處理技術\n\n系所別:\n資訊系 / 資訊所\n\n電話:\n06-2757575 ext 62528\n\nE-mail:\nleec@mail.ncku.edu.tw\n\n實驗室:\n高等資料系統(ADS)實驗室 (資訊系館新大樓3F 65302)")363 self.go_back(update)364 def on_exit_state14(self, update):365 print('Leaving state14')366 367 def on_enter_state15(self, update):368 update.message.reply_text("陳響亮 教授\n\n專長及研究領域:\n資訊與機電整合、智慧型遠端監控系統、C#物件導向程式設計、PC-based 多軸控制器設計、自動化光學檢測、CAD/CAM、雲端服務系統\n\n系所別:\n資訊系 / 製造所\n\n電話:\n06-2757575 ext 61001\n\nE-mail:\nslchen@mail.ncku.edu.tw\n\n實驗室:\n資訊與機電整合實驗室 (自強校區儀器設備大樓95507)\n\n個人網頁:\nhttp://140.116.86.180")369 self.go_back(update)370 def on_exit_state15(self, update):371 print('Leaving state15')372 373 def on_enter_state16(self, update):374 update.message.reply_text("鄭憲宗 教授\n\n專長及研究領域:\n雲端計算,行動裝置App研究與開發,無線通訊, 行動計算, 數位生活科技, 量子計算與通訊, 電腦網路\n\n系所別:\n資訊系 / 資訊所\n\n電話:\n06-2757575 ext 62529\n\nE-mail:\nstcheng@mail.ncku.edu.tw\n\n實驗室:\n塵間感知與雲端計算實驗室 (資訊系館新大樓6F 65607)")375 self.go_back(update)376 def on_exit_state16(self, update):377 print('Leaving state16')378 379 def on_enter_state17(self, update):380 update.message.reply_text("楊大和 教授\n\n系所別:\n資訊系 / 製造所\n\n電話:\n06-2757575 ext 34225\n\nE-mail:\ntyang@mail.ncku.edu.tw\n\n實驗室:\n製造管理實驗室 (自強校區儀器設備大樓95623)")381 self.go_back(update)382 def on_exit_state17(self, update):383 print('Leaving state17')384 385 def on_enter_state18(self, update):386 update.message.reply_text("蘇文鈺 教授\n\n專長及研究領域:\n數位音訊處理、影像視訊處理與壓縮、電腦音樂分析合成、文件影像處理、媒體處理機設計、MPEG-4多媒體標準、數位訊號處理用SoC\n\n系所別:\n資訊系 / 資訊所 / 醫資所\n\n電話:\n06-2757575 ext 62537\n\nE-mail:\nalvinsu@mail.ncku.edu.tw\n\n實驗室:\n音樂多媒體系統實驗室 (資訊系館新大樓7F 65707)")387 self.go_back(update)388 def on_exit_state18(self, update):389 print('Leaving state18')390 391 def on_enter_state19(self, update):392 update.message.reply_text("張燕光 教授\n\n專長及研究領域:\nRouter & Switch Design、Scalable Web Server、Cooperative Web Proxy、QoS、Network Processor Design、Computer Architecture、Multiprocessor Network and Cache Coherence Design、Fault-Tolerant\n\n系所別:\n資訊系 / 資訊所\n\n電話:\n06-2757575 ext 62539\n\nE-mail:\nykchang@mail.ncku.edu.tw\n\n實驗室:\n計算機網路架構實驗室 (資訊系館新大樓5F 65502)\n\n個人網頁:\nhttp://cial.csie.ncku.edu.tw/")393 self.go_back(update)394 def on_exit_state19(self, update):395 print('Leaving state19')396 397 def on_enter_state20(self, update):398 update.message.reply_text("郭淑美 教授\n\n專長及研究領域:\n影像處理、醫療影像處理、進化計算論、渾沌系統應用、模糊理論、系統工程\n\n系所別:\n資訊系 / 資訊所 / 醫資所\n\n電話:\n06-2757575 ext 62525\n\nE-mail:\nguosm@mail.ncku.edu.tw\n\n實驗室:\n智慧型數位影像處理實驗室 (資訊系館新大樓4F 65403)")399 self.go_back(update)400 def on_exit_state20(self, update):401 print('Leaving state20')402 403 def on_enter_state21(self, update):404 update.message.reply_text("王士豪 教授 兼 成大醫院資訊室主任\n\n專長及研究領域:\n超音波訊號及成像技術、超音波鑑別生物組織與材料、醫用物聯網與機器學習、訊號與影像處理、醫學與健康照護資訊、醫療器材\n\n系所別:\n資訊系 / 資訊所 / 醫資所\n\n電話:\n06-2757575 ext 62519\n\nE-mail:\nshyhhau@mail.ncku.edu.tw\n\n實驗室:\n生醫超音波系統實驗室 (資訊大樓8樓) (資訊系館新大樓8F 65804)")405 self.go_back(update)406 def on_exit_state21(self, update):407 print('Leaving state21')408 409 def on_enter_state22(self, update):410 update.message.reply_text("蘇銓清 教授\n\n專長及研究領域:\n光接取網路、多波長分波多工光纖網路、無線感測網路、網際網路電視系統\n\n系所別:\n資訊系 / 資訊所\n\n電話:\n06-2757575 ext 62543\n\nE-mail:\nsuecc@mail.ncku.edu.tw\n\n實驗室:\n可靠計算及網路實驗室 (資訊系館新大樓7F 65703)")411 self.go_back(update)412 def on_exit_state22(self, update):413 print('Leaving state22')414 415 def on_enter_state23(self, update):416 update.message.reply_text("蕭宏章 教授\n\n專長及研究領域:\n巨量資料儲存體與計算平台、Apache開源專案、平行暨分散式計算、雲端計算、同儕網路\n\n系所別:\n資訊系 / 資訊所\n\n電話:\n06-2757575 ext 62548\n\nE-mail:\nhchsiao@csie.ncku.edu.tw\n\n實驗室:\n分散式計算實驗室 (資訊系館新大樓10F 65A03)")417 self.go_back(update)418 def on_exit_state23(self, update):419 print('Leaving state23')420 421 def on_enter_state24(self, update):422 update.message.reply_text("張大緯 教授\n\n專長及研究領域:\n容錯機制、作業系統、虛擬機器、嵌入式系統\n\n系所別:\n資訊系 / 資訊所\n\n電話:\n06-2757575 ext 62551\n\nE-mail:\ndavidchang@csie.ncku.edu.tw\n\n實驗室:\n作業系統與嵌入式系統實驗室 (資訊系館新大樓4F 65409)\n\n個人網頁:\nhttp://140.116.247.213/")423 self.go_back(update)424 def on_exit_state24(self, update):425 print('Leaving state24')426 427 def on_enter_state25(self, update):428 update.message.reply_text("梁勝富 教授\n\n專長及研究領域:\n智慧型科技及其應用、神經認知腦機界面、生醫訊號處理、可攜式嵌入式系統、多媒體訊號與系統\n\n系所別:\n資訊系 / 資訊所 / 醫資所\n\n電話:\n06-2757575 ext 62549\n\nE-mail:\nsfliang@mail.ncku.edu.tw\n\n個人網頁:\nncbci.csie.ncku.edu.tw")429 self.go_back(update)430 def on_exit_state25(self, update):431 print('Leaving state25')432 433 def on_enter_state26(self, update):434 update.message.reply_text("許靜芳 副教授\n\n專長及研究領域:\n光波分割多工網路、繞徑策略設計、網際網路通訊協定\n\n系所別:\n資訊系 / 資訊所\n\n電話:\n06-2757575 ext 62535\n\nE-mail:\nhsucf@csie.ncku.edu.tw\n\n實驗室:\n高速網路實驗室 (資訊系館新大樓5F 65503)")435 self.go_back(update)436 def on_exit_state26(self, update):437 print('Leaving state26')438 439 def on_enter_state27(self, update):440 update.message.reply_text("盧文祥 副教授\n\n專長及研究領域:\n文件探勘、網路探勘、資訊檢索、自然語言處理、機器翻譯、跨語知識系統、數位典藏、醫學資訊檢索\n\n系所別:\n資訊系 / 資訊所 / 醫資所\n\n電話:\n06-2757575 ext 62545\n\nE-mail:\nwhlu@mail.ncku.edu.tw\n\n實驗室:\n網路探勘暨跨語知識系統實驗室 (資訊系館新大樓8F 65802)")441 self.go_back(update)442 def on_exit_state27(self, update):443 print('Leaving state27')444 445 def on_enter_state28(self, update):446 update.message.reply_text("楊中平 副教授\n\n專長及研究領域:\nMicroprocessor Architecture and Interface、Real-time Embedded System、Virtual Instrumentation\n\n系所別:\n資訊系 / 資訊所 / 醫資所\n\n電話:\n06-2757575 ext 62533\n\nE-mail:\ndryncku@gmail.com\n\n實驗室:\n聯網型嵌入式應用與技術實驗室 (資訊系館新大樓4F 65402)")447 self.go_back(update)448 def on_exit_state28(self, update):449 print('Leaving state28')450 451 def on_enter_state29(self, update):452 update.message.reply_text("藍崑展 副教授\n\n專長及研究領域:\n車載網路, 感測網路, 物聯網, 預防醫學大資料分析, 雲端照護, 中醫電腦化(自動診斷. 無痛針灸, 智慧處方系\n\n系所別:\n資訊系 / 資訊所 / 醫資所\n\n電話:\n06-2757575 ext 62550\n\nE-mail:\nklan@csie.ncku.edu.tw\n\n實驗室:\n精準醫療與網路系統實驗室 (資訊系館新大樓5F 65501)\n\n個人網頁:\nhttp://www.csie.ncku.edu.tw/~klan/")453 self.go_back(update)454 def on_exit_state29(self, update):455 print('Leaving state29')456 457 def on_enter_state30(self, update):458 update.message.reply_text("林英超 副教授\n\n專長及研究領域:\n計算機結構、可靠節能系統設計、電子設計自動化、嵌入式系統設計、超大型積體電路/系統單晶片設計 、物聯網系統及架構、記憶體系統及架構、數位系統設計、異質運算系統及架構設計\n\n系所別:\n資訊系 / 資訊所\n\n電話:\n06-2757575 ext 62553\n\nE-mail:\niclin@csie.ncku.edu.tw\n\n實驗室:\n電腦架構與晶片設計實驗室 (資訊系館新大樓10F 65A02)\n\n個人網頁:\nhttps://sites.google.com/a/caid.tw/iclin/")459 self.go_back(update)460 def on_exit_state30(self, update):461 print('Leaving state30')462 463 def on_enter_state31(self, update):464 update.message.reply_text("吳明龍 副教授\n\n專長及研究領域:\n生醫影像處理、平行計算、核磁共振影像成像技術、大腦功能性磁振造影、核磁共振脈衝序列設計、機器學習、資料科學\n\n系所別:\n資訊系 / 資訊所 / 醫資所\n\n電話:\n06-2757575 ext 62541\n\nE-mail:\nminglong.wu@csie.ncku.edu.tw\n\n實驗室:\n生醫影像實驗室 (資訊系館新大樓9F 65902)")465 self.go_back(update)466 def on_exit_state31(self, update):467 print('Leaving state31')468 469 def on_enter_state32(self, update):470 update.message.reply_text("陳朝鈞 副教授\n\n系所別:\n資訊系 / 製造所\n\n電話:\n06-2757575 ext 34226\n\nE-mail:\nchaochun@mail.ncku.edu.tw\n\n實驗室:\n製造與行動資料庫實驗室 (自強校區儀器設備大樓95508)")471 self.go_back(update)472 def on_exit_state32(self, update):473 print('Leaving state32')474 475 def on_enter_state33(self, update):476 update.message.reply_text("李家岩 副教授\n\n系所別:\n資訊系 / 製造所\n\n電話:\n06-2757575 ext 34223\n\nE-mail:\ncylee@mail.ncku.edu.tw\n\n實驗室:\n生產力最佳化實驗室")477 self.go_back(update)478 def on_exit_state33(self, update):479 print('Leaving state33')480 481 def on_enter_state34(self, update):482 update.message.reply_text("趙梓程 副教授\n\n專長及研究領域:\n醫學影像與數位影像處理、計算神經學、磁振造影技術、磁振造影加速演算法、分子系統模擬\n\n系所別:\n資訊系 / 資訊所 / 醫資所\n\n電話:\n06-2757575 ext\n\nE-mail:\ntcchao@mail.ncku.edu.tw\n\n實驗室:\n醫學影像處理實驗室 (資訊系館新大樓4F 65401)")483 self.go_back(update)484 def on_exit_state34(self, update):485 print('Leaving state34')486 487 def on_enter_state35(self, update):488 update.message.reply_text("蔡孟勳 副教授\n\n專長及研究領域:\n網路效能評估、行動網路設計與分析、網際網路電話、行動計算、行動網路與網際網路整合\n\n系所別:\n資訊系 / 資訊所\n\n電話:\n06-2757575 ext 62518\n\nE-mail:\ntsaimh@csie.ncku.edu.tw\n\n實驗室:\n智慧化行動服務實驗室 (資訊系館新大樓10F 65A04)\n\n個人網頁:\nhttp://imslab.org/~tsaimh/")489 self.go_back(update)490 def on_exit_state35(self, update):491 print('Leaving state35')492 493 def on_enter_state36(self, update):494 update.message.reply_text("莊坤達 助理教授\n\n專長及研究領域:\n資料探勘、資料庫系統、行動運算、網路資訊系統\n\n系所別:\n資訊系 / 資訊所 / 醫資所\n\n電話:\n06-2757575 ext 62556\n\nE-mail:\nktchuang@mail.ncku.edu.tw\n\n實驗室:\n前瞻網路資料庫實驗室 (資訊系館新大樓6F 65602)\n\n個人網頁:\nhttp://cv_ktchuang.cannerapp.com/")495 self.go_back(update)496 def on_exit_state36(self, update):497 print('Leaving state36')498 499 def on_enter_state37(self, update):500 update.message.reply_text("蔡佩璇 助理教授\n\n專長及研究領域:\n即時定位與導航服務、智慧型系統與應用程式開發、影像壓縮與即時傳輸、即時排程理論、使用者介面結構設計、健康看護應用及個人設備\n\n系所別:\n資訊系 / 製造所\n\n電話:\n06-2757575 ext 34228\n\nE-mail:\nphtsai@mail.ncku.edu.tw\n\n實驗室:\n資訊系統與應用實驗室 (自強校區儀器設備大樓95508)")501 self.go_back(update)502 def on_exit_state37(self, update):503 print('Leaving state37')504 505 def on_enter_state38(self, update):506 update.message.reply_text("胡敏君 助理教授\n\n專長及研究領域:\n多媒體資訊系統、雲端多媒體計算、電腦視覺與圖形識別、機器學習、電腦圖學、虛擬實境與擴增實境技術應用\n\n系所別:\n資訊系 / 資訊所\n\n電話:\n06-2757575 ext 62557\n\nE-mail:\nanita_hu@mail.ncku.edu.tw\n\n實驗室:\n多媒體資訊系統實驗室 (資訊系館新大樓6F 65601)\n\n個人網頁:\nhttp://mislab.csie.ncku.edu.tw/trimy")507 self.go_back(update)508 def on_exit_state38(self, update):509 print('Leaving state38')510 511 def on_enter_state39(self, update):512 update.message.reply_text("涂嘉恒 助理教授\n\n專長及研究領域:\n異質平行計算、嵌入式系統設計與最佳化、編譯器設計\n\n系所別:\n資訊系 / 資訊所\n\n電話:\n06-2757575 ext 62527\n\nE-mail:\nchiaheng@mail.ncku.edu.tw\n\n實驗室:\n前瞻系統研究實驗室 (資訊系館新大樓7F 65708)\n\n個人網頁:\nhttp://chiaheng.wordpress.com")513 self.go_back(update)514 def on_exit_state39(self, update):515 print('Leaving state39')516 517 def on_enter_state40(self, update):518 update.message.reply_text("李信杰 副教授\n\n專長及研究領域:\n軟體工程、網頁自動化測試、服務導向架構、程式碼分析、軟體代理人\n\n系所別:\n資訊系 / 資訊所 / 計網中心\n\n電話:\n06-2757575 ext 61035\n\nE-mail:\njielee@mail.ncku.edu.tw\n\n實驗室:\n軟體工程實驗室 (資訊系館新大樓9F 65912)")519 self.go_back(update)520 def on_exit_state40(self, update):521 print('Leaving state40')522 523 def on_enter_state41(self, update):524 update.message.reply_text("張瑞紘 助理教授\n\n專長及研究領域:\n資料挖掘、雲端運算平台應用、資料庫管理、系統分析與設計、數位學習系統、程式設計與撰寫、程式設計與撰寫\n\n系所別:\n資訊系 / 資訊所 / 計網中心\n\n電話:\n06-2757575 ext 61053\n\nE-mail:\nchangrh@mail.ncku.edu.tw\n\n實驗室:\n創新系統軟體應用實驗室 (資訊系館新大樓9F 65912)")525 self.go_back(update)526 def on_exit_state41(self, update):527 print('Leaving state41')528 529 def on_enter_state42(self, update):530 update.message.reply_text("黃敬群 業界專家 兼 助理教授\n\n專長及研究領域:\n作業系統、嵌入式系統、消費性電子產品\n\n系所別:\n資訊系\n\n電話:\n06-2757575 ext 62542\n\nE-mail:\njserv.tw@gmail.com\n\n個人網頁:\nhttp://wiki.csie.ncku.edu.tw/User/jserv")531 self.go_back(update)532 def on_exit_state42(self, update):533 print('Leaving state42')534 535 def on_enter_statePsychologicalTest(self, update):536 update.message.reply_text("love or personality or work")537 #self.go_back(update)538 def on_exit_statePsychologicalTest(self, update):539 print('Leaving statePsychologicalTest')540 def on_enter_stateLove(self, update):541 update.message.reply_text("你走在森林中,突然愛神維納斯出現,祂要送你一款愛情糖果,你覺得他送你的是下面哪一款?\na、紅白條紋糖\nb、彩色鑽石糖\nc、七彩星星糖\nd、白色方糖\ne、橘色圓形糖")542 self.go_back(update)543 def on_exit_stateLove(self, update):544 print('Leaving stateLove')545 546 def on_enter_stateLoveA(self, update):547 update.message.reply_text("a、你的必修課題是「放下矜持與面子」\n你喜歡一個人很明顯,眼光總是追著對方在轉,每每開口都是與對方有關的話題,然而碰到你不喜歡的人,你也不會浪費時間在他身上。對於你有好感的對象,你卻不一定有勇氣告白,總是一再試探對方的感覺,就怕自己表錯情。\n愛面子沒有錯,但你戀愛時也會因為太愛面子而不願意承認錯誤。個性活潑的你,其實不缺戀愛機會。千萬不要將就在沒有心動的關係,挑選與你勢均力敵的對象,才能彰顯你耀眼的特質。")548 self.go_back(update)549 def on_exit_stateLoveA(self, update):550 print('Leaving stateLoveA')551 552 def on_enter_stateLoveB(self, update):553 update.message.reply_text("b、你的必修課題是「學習放下武裝與面具」\n你是個多愁善感的人,在感情中受過不少傷害(童年不受重視的陰影、青少年同儕的爭執排擠),導致現在的你對愛情缺乏信心。為了保護自己武裝成尖銳、難以捉摸的人。其實你的內心是單純而渴望愛的,偏偏你老是愛上與你不同世界的人,讓你陷入無止境的猜心遊戲。\n最後,你只好流連於曖昧關係,心軟脆弱的你,因為害怕寂寞,心裡面其實沒有安全感卻又捨不得放手,導致自己不斷輪迴。是該讓自己解脫的時候了,抽身,其實比你想的還容易。")554 self.go_back(update)555 def on_exit_stateLoveB(self, update):556 print('Leaving stateLoveB')557 558 def on_enter_stateLoveC(self, update):559 update.message.reply_text("c、你的必修課題是「放下對感情的理想化,找回平衡感」\n你對於愛情抱持著太美好的憧憬,你渴望另一半可以徹底了解你的想法,所以當兩人因為某些事而意見不合時,你會感到非常沮喪。然而,在同樣生長環境下的姐妹都有意見不合的時候,更何況是一個生長家庭、環境都不同的人。\n你需要在夢想與現實間求得平衡、學習在黏膩的關係中,找回獨處時的平靜。當你學會寬宥自己與對方,你將會感受到更自在的情感關係。")560 self.go_back(update)561 def on_exit_stateLoveC(self, update):562 print('Leaving stateLoveC')563 564 def on_enter_stateLoveD(self, update):565 update.message.reply_text("d、你的必修課題是「找回對自己的自信」\n你根本還沒準備好談戀愛,又或是對戀愛心存恐懼,害怕自己沒資格被愛,怕自己都照顧不好自己了,如何去對別人好?你的問題在於對自己缺乏自信,習慣把事情想的太悲觀來嚇自己。\n回想一下你所擔心過的事,是否有許多不曾發生、讓自己白擔心一場呢?那麽,你還在擔心什麽呢?勇敢去愛吧。相信自己值得被愛,你也有能力去愛別人。")566 self.go_back(update)567 def on_exit_stateLoveD(self, update):568 print('Leaving stateLoveD')569 570 def on_enter_stateLoveE(self, update):571 update.message.reply_text("e、你的必修課題是「學會獨立,放下害怕被忽略的感受」\n在愛情面前,你還是個孩子,貪玩、任性、依賴。單身時,你依賴你的家人、你的閨蜜;談戀愛、結婚後,依賴你的另一半。好奇的你喜歡問「為什麽?」得不到滿意的答案便自顧自的生氣。不喜歡被對方忽略的感覺,卻常因為專注在自己的興趣而忽略對方。\n愛上你得有照顧孩子的心理準備。你要學會的,是獨立,不要擔心另一半這一刻沒想你,就會把你忘記。要知道,愛一個人是放在心上,而不是掛在嘴邊。")572 self.go_back(update)573 def on_exit_stateLoveE(self, update):574 print('Leaving stateLoveE')575 def on_enter_statePersonality(self, update):576 update.message.reply_text("如果要你隨身攜帶「幸運符」,你會把它放在哪裡,以保佑你平安呢?\na、放在內衣裡\nb、放在隨身的包包中\nc、掛在手機上\nd、當成項鍊或手鍊掛在身上")577 #self.go_back(update)578 def on_exit_statePersonality(self, update):579 print('Leaving statePersonality')580 def on_enter_statePersonalityA(self, update):581 update.message.reply_text("a、緊張大師指數:100% \n你是大夥人眼中的緊張大師!只要你一緊張起來,臉色就跟著難看,身旁的人都會感受到你的緊張氣氛。因為你的個性急,遇上狀況急著快快解決,而未能思考完善就行動,反而會陷入另一個麻煩中。")582 self.go_back(update)583 def on_exit_statePersonalityA(self, update):584 print('Leaving statePersonalityA')585 def on_enter_statePersonalityB(self, update):586 update.message.reply_text("b、緊張大師指數:50% \n你不會過於緊張,因為任何事情對你來說,都是有解決方法的,與其花費太多時間,讓自己陷入焦慮痛苦的狀態,不如老神在在,等到事情發生再去思考。")587 self.go_back(update)588 def on_exit_statePersonalityB(self, update):589 print('Leaving statePersonalityB')590 def on_enter_statePersonalityC(self, update):591 update.message.reply_text("c、緊張大師指數:20% \n你神經算有些大條,有時候事情大家都知道了,你才恍然大悟,可以說常在狀況外。但你卻很容易受人影響,只要親朋好友緊張兮兮地找你商量事情,即使你還搞不清楚狀況,也跟著一起窮緊張!")592 self.go_back(update)593 def on_exit_statePersonalityC(self, update):594 print('Leaving statePersonalityC')595 def on_enter_statePersonalityD(self, update):596 update.message.reply_text("d、緊張大師指數:80%\n你是一個滿容易緊張的人,一點風吹草動,就會讓你胡思亂想起來,要是真的發生大事,很容易往壞處想。而你又不想讓別人發現而努力撐住,無形中讓你的精神、身體都長期處於緊張的狀態!")597 self.go_back(update)598 def on_exit_statePersonalityD(self, update):599 print('Leaving statePersonalityD')600 def on_enter_stateWork(self, update):601 update.message.reply_text("如果你是一家大企業的負責人,有一位年輕貌美的私人秘書,你有權規定她的上班服裝,你認為下列何者較符合你的想法?\na、保守的套裝裙長過膝才顯得莊重\nb、突顯身材的窄裙不但可以帶出去應酬自己也賞心悅目\nc、一律和其他職員一樣穿工作服公司要注意紀律\nd、任其自由穿著")602 #self.go_back(update)603 def on_exit_stateWork(self, update):604 print('Leaving stateWork')605 def on_enter_stateWorkA(self, update):606 update.message.reply_text("a、保守的套裝裙長過膝才顯得莊重\n你是個平常看起來很散漫,實際上只要投入工作便一本正經的人。認真是你一貫的做事方式,而且勇於負責,絲毫不馬虎,你最痛恨敷衍了事的工作態度,所以你是十足的工作狂。")607 self.go_back(update)608 def on_exit_stateWorkA(self, update):609 print('Leaving stateWorkA')610 def on_enter_stateWorkB(self, update):611 update.message.reply_text("b、突顯身材的窄裙不但可以帶出去應酬自己也賞心悅目\n你很聰明機靈,懂得在該努力的時候努力工作,能偷懶的時候也不放過休息的機會,所以你在工作時精神特別好,還滿注意工作環境的情調,你只能說是看起來象個工作狂。")612 self.go_back(update)613 def on_exit_stateWorkB(self, update):614 print('Leaving stateWorkB')615 def on_enter_stateWorkC(self, update):616 update.message.reply_text("c、一律和其他職員一樣穿工作服公司要注意紀律\n你是個公私分明的人,雖然談不上是個工作狂,但是只要辦公事時,你不喜歡涉及私人的事情,基本上你也算工作狂型的人物。")617 self.go_back(update)618 def on_exit_stateWorkC(self, update):619 print('Leaving stateWorkC')620 def on_enter_stateWorkD(self, update):621 update.message.reply_text("d、任其自由穿著\n你是個奇才型人物,比較擅長策劃性的工作,如果認真起來,做事一絲不茍;但是如果你根本沒興趣,你就會搪塞過去,不大理會。所以你是不是工作狂,完全視工作性質而定。")622 self.go_back(update)623 def on_exit_stateWorkD(self, update):624 print('Leaving stateWorkD')625 def on_enter_stateChat(self, update):626 update.message.reply_text("Hi!")627 #self.go_back(update)628 def on_exit_stateChat(self, update):629 print('Leaving stateChat')630 def on_enter_stateChat1(self, update):631 update.message.reply_text("How are you?")632 #self.go_back(update)633 def on_exit_stateChat1(self, update):634 print('Leaving stateChat1')635 def on_enter_stateChat2(self, update):636 update.message.reply_text("Are you single?")637 #self.go_back(update)638 def on_exit_stateChat2(self, update):639 print('Leaving stateChat2')640 def on_enter_stateChat3(self, update):641 update.message.reply_text("Ok~This is for you.\nhttps://youtu.be/WCpKhCyqmFE")642 self.go_back(update)643 def on_exit_stateChat3(self, update):644 print('Leaving stateChat3')645 def on_enter_stateChat4(self, update):646 update.message.reply_text("Congratulations!\n")647 update.message.reply_photo('https://pbs.twimg.com/media/DB4AHDFU0AEu6G4.jpg')648 self.go_back(update)649 def on_exit_stateChat4(self, update):650 print('Leaving stateChat4')651 def on_enter_stateJoke(self, update):652 update.message.reply_text("normal or turbo")653 #self.go_back(update)654 def on_exit_stateJoke(self, update):655 print('Leaving stateJoke')656 def on_enter_stateJokeNormal(self, update):657 update.message.reply_text("有一天總統不小心掉到水溝里了.恰好有三個小孩經過\n總統就對他們說:「如果你們救我起來我就給你們每人一個願望」\n第一個小孩就說他要一輛腳踏車\n第二個小孩就說他要一個棒球手套\n第三個小孩想了很久說他要一台輪椅\n總統心里就覺得很奇怪手腳好好的為什麼需要輪椅呢?\n就問第三個小孩說:「你為什麼要輪椅呢?」\n第三個小孩就說:「如果我爸知道我救你起來會把我的腿打斷」\n")658 self.go_back(update)659 def on_exit_stateJokeNormal(self, update):660 print('Leaving stateJokeNormal')661 def on_enter_stateJokeTurbo(self, update):662 update.message.reply_text("有個人,來到本地一家健身館想減肥,好使自己苗條些,健身館裡備有各種健身計劃,看來挺複雜,於是,這傢伙選了一種最便宜的,就是在一小時內減掉一磅。他被帶到一間房子裡,裡面站著一個赤裸的女孩子,手裡拿著個牌子,上面寫道:「如果你能抓住我,就允許你幹我!」這傢伙立即接受了挑戰,開始追逐女孩,但每次都是快要抓住女孩時,又給她跑掉,一個小時過去了,他仍沒有抓住那個女孩,健身教練帶他去稱了一下體重,剛好少了一磅。「這挺不錯嘛,」這傢伙心想,「我既能減肥,又能開心耶。」\n這次,他選了一個稍貴些的減肥方案,可以在一小時內減去兩磅。他被帶到一間房裡,裡面站著兩位全裸的女孩,手裡都拿著牌子,上面也寫道:「如果你能抓住我,就允許你幹我!」這傢伙十分興奮,拚命地追趕這兩個女孩子,最後還是一個也沒追到,一小時後,教練又給他稱了下體重,剛好掉了兩磅肉。\n這時,這傢伙被激怒了,他告訴經理,他要選用最貴的減肥方案,經理向他保證他一定能夠在一小時內減去十磅,但是又補充說,這個方案十分危險,這傢伙心想,不就是再多幾個女孩嗎,越多就越有機會,至少能夠抓住一個吧。他催經理趕快把他送到那個最貴的房間去,儘管經理不斷向他聲明危險。於是,這人被帶到一個稍遠些的一間房子裡,他們讓他進去後,在外面鎖上了門,房間裡燈光昏暗,等待他的是一隻黑猩猩,只見它手裡拿著一個牌子,上面寫道:「如果我抓住你,我就幹你」")663 self.go_back(update)664 def on_exit_stateJokeTurbo(self, update):...

Full Screen

Full Screen

menu.py

Source:menu.py Github

copy

Full Screen

...97 menu_count = main.main_menu_switcher(main.activated)98 # "7. Запрос: Автомобили в прокате"99 elif position == 6:100 request.rent_request()101 go_back()102 # "8. Сохранение в файл"103 elif position == 7:104 file.save_file()105 go_back()106 # "9. Загрузка из файла"107 elif position == 8:108 file.load_file()109 go_back()110 # "i. Справка"111 elif position == 9:112 show_info()113 go_back()114 # "0. Выход"115 elif position == 10:116 return 0117 else:118 # "1. Заполнение таблицы"119 if position == 0:120 menu_count = const.FILL_LIST_MENU_COUNT121 menu(const.FILL_LIST_MENU_MODE, menu_count)122 menu_count = main.main_menu_switcher(main.activated)123 # "2. Загрузка из файла"124 elif position == 1:125 file.load_file()126 go_back()127 # "i. Справка"128 elif position == 2:129 show_info()130 go_back()131 # "0. Выход"132 elif position == 3:133 return 0134 elif mode == const.PRINT_LIST_MENU_MODE:135 if position == 0:136 out.print_employee_table()137 go_back()138 elif position == 1:139 out.print_position_table()140 go_back()141 elif position == 2:142 out.print_brand_table()143 go_back()144 elif position == 3:145 out.print_service_table()146 go_back()147 elif position == 4:148 out.print_car_table()149 go_back()150 elif position == 5:151 out.print_client_table()152 go_back()153 elif position == 6:154 out.print_rent_table()155 go_back()156 elif mode == const.FILL_LIST_MENU_MODE:157 if position == 0:158 fill.fill_employee_table(main.table_row[const.EMPLOYEE_TABLE])159 go_back()160 elif position == 1:161 fill.fill_position_table(main.table_row[const.POSITION_TABLE])162 go_back()163 elif position == 2:164 fill.fill_brand_table(main.table_row[const.BRAND_TABLE])165 go_back()166 elif position == 3:167 fill.fill_service_table(main.table_row[const.SERVICE_TABLE])168 go_back()169 elif position == 4:170 fill.fill_car_table(main.table_row[const.CAR_TABLE])171 go_back()172 elif position == 5:173 fill.fill_client_table(main.table_row[const.CLIENT_TABLE])174 go_back()175 elif position == 6:176 fill.fill_rent_table(main.table_row[const.RENT_TABLE])177 go_back()178 elif mode == const.ADD_LIST_MENU_MODE or mode == const.DELETE_LIST_MENU_MODE:179 if position == 0:180 edit.edit_employee_table()181 go_back()182 elif position == 1:183 edit.edit_position_table()184 go_back()185 elif position == 2:186 edit.edit_brand_table()187 go_back()188 elif position == 3:189 edit.edit_service_table()190 go_back()191 elif position == 4:192 edit.edit_car_table()193 go_back()194 elif position == 5:195 edit.edit_client_table()196 go_back()197 elif position == 6:198 edit.edit_rent_table()199 go_back()200 elif mode == const.REQUEST_HRD_LIST_MENU_MODE:201 if position == 0:202 request.hrd_request()203 go_back()204 elif position == 1:205 request.hrd_filter_specific_position()206 go_back()207 elif mode == const.REQUEST_AUTOPARK_LIST_MENU_MODE:208 if position == 0:209 request.autopark_request()210 go_back()211 elif position == 1:212 request.autopark_filter_specific_brand()213 go_back()214 elif position == 2:215 request.autopark_filter_in_and_off_rent()216 go_back()217 elif position == 3:218 request.autopark_filter_specific_delivery_and_return_date()219 go_back()220 elif position == 4:221 request.autopark_filter_paid_and_unpaid_rented_cars()222 go_back()223 # Перерисовка224 if mode == const.MAIN_MENU_MODE:225 show_main_menu(cursor)226 elif mode == const.PRINT_LIST_MENU_MODE:227 show_print_list_menu(cursor)228 elif mode == const.FILL_LIST_MENU_MODE:229 show_fill_list_menu(cursor)230 elif mode == const.ADD_LIST_MENU_MODE:231 show_add_list_menu(cursor)232 elif mode == const.DELETE_LIST_MENU_MODE:233 show_delete_list_menu(cursor)234 elif mode == const.REQUEST_HRD_LIST_MENU_MODE:235 show_request_hrd_list_menu(cursor)236 elif mode == const.REQUEST_AUTOPARK_LIST_MENU_MODE:237 show_request_autopark_list_menu(cursor)238def show_main_menu(cur):239 os.system("clear")240 print("\t\t _____ _____ _____ _ _ _____ _____")241 print("\t\t| | | \\ / \\ | | | | / \\ |__ __|")242 print("\t\t| | | | | <=> | | | | | | |/ / | <=> | | |")243 print("\t\t| | | | | ___/ | | | | | | | _ | | |")244 print("\t\t| | | | | | | | | | | |\\ \\ | | | | | |")245 print("\t\t|_| |_| |_| \\_____/ |_| |_| |_| |_| |_|\n")246 print("\t\t _____ _____ _____ _____")247 print("\t\t / \\ | \\ |__ __| / \\")248 print("\t\t | <=> | | <=> | | | | | | |")249 print("\t\t | _ | | < | | | | | |")250 print("\t\t | | | | | <=> | | | | | | |")251 print("\t\t |_| |_| |_____/ |_| \\_____/\n\n")252 if main.activated:253 print("\t\t %s 1. Вывод таблицы" % (cur[0]))254 print("\t\t %s 2. Заполнение таблицы" % (cur[1]))255 print("\t\t %s 3. Добавление элементов в таблицу" % (cur[2]))256 print("\t\t %s 4. Удаление элементов из таблицы" % (cur[3]))257 print("\t\t ___________________________________\n")258 print("\t\t %s 5. Запрос: Отдел кадров" % (cur[4]))259 print("\t\t %s 6. Запрос: Автопарк" % (cur[5]))260 print("\t\t %s 7. Запрос: Автомобили в прокате" % (cur[6]))261 print("\t\t ___________________________________\n")262 print("\t\t %s 8. Сохранение в файл" % (cur[7]))263 print("\t\t %s 9. Загрузка из файла" % (cur[8]))264 print("\t\t ___________________________________\n")265 print("\t\t %s i. Справка" % (cur[9]))266 print("\t\t %s 0. Выход" % (cur[10]))267 else:268 print("\t\t %s 1. Заполнение таблицы" % (cur[0]))269 print("\t\t ___________________________________\n")270 print("\t\t %s 2. Загрузка из файла" % (cur[1]))271 print("\t\t ___________________________________\n")272 print("\t\t %s i. Справка" % (cur[2]))273 print("\t\t %s 0. Выход" % (cur[3]))274def show_print_list_menu(cur):275 os.system("clear")276 print("\n\n\t\tКакую таблицу Вы хотите вывести:")277 print("\t\t %s 1. Сотрудники" % (cur[0]))278 print("\t\t %s 2. Должности" % (cur[1]))279 print("\t\t %s 3. Марки автомобилей" % (cur[2]))280 print("\t\t %s 4. Дополнительные услуги" % (cur[3]))281 print("\t\t %s 5. Автомобили" % (cur[4]))282 print("\t\t %s 6. Клиенты" % (cur[5]))283 print("\t\t %s 7. Прокат" % (cur[6]))284def show_fill_list_menu(cur):285 os.system("clear")286 print("\n\n\t\tКакую таблицу Вы хотите заполнить:")287 print("\t\t %s 1. Сотрудники" % (cur[0]))288 print("\t\t %s 2. Должности" % (cur[1]))289 print("\t\t %s 3. Марки автомобилей" % (cur[2]))290 print("\t\t %s 4. Дополнительные услуги" % (cur[3]))291 print("\t\t %s 5. Автомобили" % (cur[4]))292 print("\t\t %s 6. Клиенты" % (cur[5]))293 print("\t\t %s 7. Прокат" % (cur[6]))294def show_add_list_menu(cur):295 os.system("clear")296 print("\n\n\t\tВ какую таблицу Вы хотите добавить элемент:")297 print("\t\t %s 1. Сотрудники" % (cur[0]))298 print("\t\t %s 2. Должности" % (cur[1]))299 print("\t\t %s 3. Марки автомобилей" % (cur[2]))300 print("\t\t %s 4. Дополнительные услуги" % (cur[3]))301 print("\t\t %s 5. Автомобили" % (cur[4]))302 print("\t\t %s 6. Клиенты" % (cur[5]))303 print("\t\t %s 7. Прокат" % (cur[6]))304def show_delete_list_menu(cur):305 os.system("clear")306 print("\n\n\t\tВ какую таблицу Вы хотите добавить элемент:")307 print("\t\t %s 1. Сотрудники" % (cur[0]))308 print("\t\t %s 2. Должности" % (cur[1]))309 print("\t\t %s 3. Марки автомобилей" % (cur[2]))310 print("\t\t %s 4. Дополнительные услуги" % (cur[3]))311 print("\t\t %s 5. Автомобили" % (cur[4]))312 print("\t\t %s 6. Клиенты" % (cur[5]))313 print("\t\t %s 7. Прокат" % (cur[6]))314def show_request_hrd_list_menu(cur):315 os.system("clear")316 print("\n\n\t\tВыберите режим:")317 print("\t\t %s Запрос \"Отдел кадров\"" % (cur[0]))318 print("\t\t %s Фильтр для отображения сотрудников отдельных должностей" % (cur[1]))319def show_request_autopark_list_menu(cur):320 os.system("clear")321 print("\n\n\t\tВыберите режим:")322 print("\t\t %s Запрос \"Автопарк\"" % (cur[0]))323 print("\t\t %s Фильтр отображения автомобилей отдельных марок" % (cur[1]))324 print("\t\t %s Фильтр отображения автомобилей, находящихся и не находящихся в прокате" % (cur[2]))325 print("\t\t %s Фильтр для отображения автомобилей выданных и возвращённых в определённую дату" % (cur[3]))326 print("\t\t %s Фильтр оплаченных и не оплаченных автомобилей в прокате" % (cur[4]))327def show_info():328 os.system("clear")329 print("\n\n\t\tСправка:\n")330 print("\t\tДля управления меню используются клавиатурные стрелки")331 print("\t\tлибо vi-подобные клавиши управления:")332 print("\t\t^ или k -- перемещение вверх")333 print("\t\tv или j -- перемещение вниз")334 print("\t\t< или h или Esc -- перемещение назад по меню")335 print("\t\t> или l или Enter -- выбор пункта меню\n")336 print("\t\tВыполнил курсовой проект: блаблабла\n") # TODO: поставь сюда свое имя337 print("\t\tНажмите < или h или Esc, чтобы выйти в главное меню.")338def go_back():339 while True:340 os.system("stty raw -echo")341 c = sys.stdin.read(1)342 os.system("stty -raw echo")343 if c == 'h':...

Full Screen

Full Screen

shell_options.py

Source:shell_options.py Github

copy

Full Screen

1#!/usr/bin/env python2# encoding: UTF-83"""4This file is part of Commix Project (https://commixproject.com).5Copyright (c) 2014-2022 Anastasios Stasinopoulos (@ancst).6This program is free software: you can redistribute it and/or modify7it under the terms of the GNU General Public License as published by8the Free Software Foundation, either version 3 of the License, or9(at your option) any later version.10 11For more see the file 'readme/COPYING' for copying permission.12"""13import re14import os15import sys16import time17from src.utils import logs18from src.utils import menu19from src.utils import settings20from src.core.shells import bind_tcp21from src.core.shells import reverse_tcp22from src.core.injections.controller import checks23from src.thirdparty.six.moves import urllib as _urllib24from src.thirdparty.colorama import Fore, Back, Style, init25from src.core.injections.results_based.techniques.classic import cb_injector26from src.core.injections.results_based.techniques.eval_based import eb_injector27from src.core.injections.semiblind.techniques.file_based import fb_injector28"""29Check for established connection30"""31def check_established_connection():32 while True:33 time.sleep(1)34 if settings.VERBOSITY_LEVEL == 1:35 print(settings.SINGLE_WHITESPACE)36 warn_msg = "Something went wrong with the reverse TCP connection."37 warn_msg += " Please wait while checking state."38 print(settings.print_warning_msg(warn_msg))39 lines = os.popen('netstat -anta').read().split("\n")40 for line in lines:41 if settings.LHOST + ":" + settings.LPORT in line and "ESTABLISHED" in line:42 pass43 else:44 return 45"""46Execute the bind / reverse TCP shell47"""48def execute_shell(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename, os_shell_option, payload, OUTPUT_TEXTFILE):49 if settings.EVAL_BASED_STATE != False:50 # Command execution results.51 start = time.time()52 response = eb_injector.injection(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename)53 end = time.time()54 diff = end - start55 # Evaluate injection results.56 shell = eb_injector.injection_results(response, TAG, cmd)57 else:58 # Command execution results.59 start = time.time()60 if settings.FILE_BASED_STATE == True:61 response = fb_injector.injection(separator, payload, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, OUTPUT_TEXTFILE, alter_shell, filename)62 else:63 whitespace = settings.WHITESPACES[0]64 if whitespace == " ":65 whitespace = _urllib.parse.quote(whitespace) 66 response = cb_injector.injection(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename)67 end = time.time()68 diff = end - start69 # Evaluate injection results.70 shell = cb_injector.injection_results(response, TAG, cmd)71 if settings.REVERSE_TCP and (int(diff) > 0 and int(diff) < 6):72 check_established_connection()73 else:74 if settings.VERBOSITY_LEVEL == 1:75 print(settings.SINGLE_WHITESPACE)76 err_msg = "The " + os_shell_option.split("_")[0] + " "77 err_msg += os_shell_option.split("_")[1].upper() + " connection has failed."78 print(settings.print_critical_msg(err_msg))79"""80Configure the bind TCP shell81"""82def bind_tcp_config(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename, os_shell_option, go_back, go_back_again, payload, OUTPUT_TEXTFILE):83 settings.BIND_TCP = True84 # Set up RHOST / LPORT for the bind TCP connection.85 bind_tcp.configure_bind_tcp(separator)86 if settings.BIND_TCP == False:87 if settings.REVERSE_TCP == True:88 os_shell_option = "reverse_tcp"89 reverse_tcp_config(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename, os_shell_option, go_back, go_back_again, payload, OUTPUT_TEXTFILE)90 return go_back, go_back_again91 while True:92 if settings.RHOST and settings.LPORT in settings.SHELL_OPTIONS:93 result = checks.check_bind_tcp_options(settings.RHOST)94 else: 95 cmd = bind_tcp.bind_tcp_options(separator)96 result = checks.check_bind_tcp_options(cmd)97 if result != None:98 if result == 0:99 go_back_again = False100 elif result == 1 or result == 2:101 go_back_again = True102 settings.BIND_TCP = False103 elif result == 3:104 settings.BIND_TCP = False105 reverse_tcp_config(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename, os_shell_option, go_back, go_back_again, payload, OUTPUT_TEXTFILE) 106 return go_back, go_back_again107 # execute bind TCP shell 108 execute_shell(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename, os_shell_option, payload, OUTPUT_TEXTFILE)109"""110Configure the reverse TCP shell111"""112def reverse_tcp_config(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename, os_shell_option, go_back, go_back_again, payload, OUTPUT_TEXTFILE):113 settings.REVERSE_TCP = True114 # Set up LHOST / LPORT for the reverse TCP connection.115 reverse_tcp.configure_reverse_tcp(separator)116 if settings.REVERSE_TCP == False:117 if settings.BIND_TCP == True:118 os_shell_option = "bind_tcp"119 bind_tcp_config(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename, os_shell_option, go_back, go_back_again, payload, OUTPUT_TEXTFILE)120 return go_back, go_back_again121 while True:122 if settings.LHOST and settings.LPORT in settings.SHELL_OPTIONS:123 result = checks.check_reverse_tcp_options(settings.LHOST)124 else: 125 cmd = reverse_tcp.reverse_tcp_options(separator)126 result = checks.check_reverse_tcp_options(cmd)127 if result != None:128 if result == 0:129 go_back_again = False130 elif result == 1 or result == 2:131 go_back_again = True132 settings.REVERSE_TCP = False133 elif result == 3:134 settings.REVERSE_TCP = False135 bind_tcp_config(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename, os_shell_option, go_back, go_back_again, payload, OUTPUT_TEXTFILE)136 #reverse_tcp_config(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename, os_shell_option, go_back, go_back_again) 137 return go_back, go_back_again138 # execute reverse TCP shell 139 execute_shell(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename, os_shell_option, payload, OUTPUT_TEXTFILE)140"""141Check commix shell options142"""143def check_option(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename, technique, go_back, no_result, timesec, go_back_again, payload, OUTPUT_TEXTFILE):144 os_shell_option = checks.check_os_shell_options(cmd.lower(), technique, go_back, no_result) 145 if os_shell_option == "back" or os_shell_option == True or os_shell_option == False:146 go_back = True147 if os_shell_option == False:148 go_back_again = True149 return go_back, go_back_again150 # The "os_shell" option151 elif os_shell_option == "os_shell": 152 warn_msg = "You are already into the '" + os_shell_option + "' mode."153 print(settings.print_warning_msg(warn_msg))154 return go_back, go_back_again155 # The "bind_tcp" option156 elif os_shell_option == "bind_tcp":157 go_back, go_back_again = bind_tcp_config(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename, os_shell_option, go_back, go_back_again, payload, OUTPUT_TEXTFILE)158 return go_back, go_back_again159 # The "reverse_tcp" option160 elif os_shell_option == "reverse_tcp":161 go_back, go_back_again = reverse_tcp_config(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename, os_shell_option, go_back, go_back_again, payload, OUTPUT_TEXTFILE)162 return go_back, go_back_again163 # The "quit" option164 elif os_shell_option == "quit": 165 logs.print_logs_notification(filename, url) 166 raise SystemExit()167 else:...

Full Screen

Full Screen

12425_shell_options.py

Source:12425_shell_options.py Github

copy

Full Screen

1#!/usr/bin/env python2# encoding: UTF-83"""4This file is part of Commix Project (http://commixproject.com).5Copyright (c) 2014-2017 Anastasios Stasinopoulos (@ancst).6This program is free software: you can redistribute it and/or modify7it under the terms of the GNU General Public License as published by8the Free Software Foundation, either version 3 of the License, or9(at your option) any later version.10 11For more see the file 'readme/COPYING' for copying permission.12"""13import re14import os15import sys16import time17import urllib18import urlparse19from src.utils import menu20from src.utils import settings21from src.core.injections.controller import checks22from src.thirdparty.colorama import Fore, Back, Style, init23from src.core.shells import bind_tcp24from src.core.shells import reverse_tcp25from src.core.injections.results_based.techniques.classic import cb_injector26from src.core.injections.results_based.techniques.eval_based import eb_injector27from src.core.injections.semiblind.techniques.file_based import fb_injector28"""29Check for established connection30"""31def check_established_connection():32 while True:33 if settings.VERBOSITY_LEVEL == 1:34 print ""35 warn_msg = "Something went wrong with the reverse TCP connection."36 warn_msg += " Please wait while checking state."37 print settings.print_warning_msg(warn_msg)38 time.sleep(10)39 lines = os.popen('netstat -anta').read().split("\n")40 found = False41 for line in lines:42 if "ESTABLISHED" in line and settings.LPORT in line.split():43 found = True44 pass45 if not found:46 return 47"""48Execute the bind / reverse TCP shell49"""50def execute_shell(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename, os_shell_option, payload, OUTPUT_TEXTFILE):51 if settings.EVAL_BASED_STATE != False:52 # Command execution results.53 start = time.time()54 response = eb_injector.injection(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename)55 end = time.time()56 diff = end - start57 # Evaluate injection results.58 shell = eb_injector.injection_results(response, TAG, cmd)59 else:60 # Command execution results.61 start = time.time()62 if settings.FILE_BASED_STATE == True:63 response = fb_injector.injection(separator, payload, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, OUTPUT_TEXTFILE, alter_shell, filename)64 else:65 whitespace = settings.WHITESPACE[0]66 if whitespace == " ":67 whitespace = urllib.quote(whitespace) 68 response = cb_injector.injection(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename)69 end = time.time()70 diff = end - start71 # Evaluate injection results.72 shell = cb_injector.injection_results(response, TAG, cmd)73 if settings.REVERSE_TCP and (int(diff) > 0 and int(diff) < 6):74 check_established_connection()75 else:76 if settings.VERBOSITY_LEVEL == 1:77 print ""78 err_msg = "The " + os_shell_option.split("_")[0] + " "79 err_msg += os_shell_option.split("_")[1].upper() + " connection has failed!"80 print settings.print_critical_msg(err_msg)81"""82Configure the bind TCP shell83"""84def bind_tcp_config(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename, os_shell_option, go_back, go_back_again, payload, OUTPUT_TEXTFILE):85 settings.BIND_TCP = True86 # Set up RHOST / LPORT for the bind TCP connection.87 bind_tcp.configure_bind_tcp()88 if settings.BIND_TCP == False:89 if settings.REVERSE_TCP == True:90 os_shell_option = "reverse_tcp"91 reverse_tcp_config(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename, os_shell_option, go_back, go_back_again, payload, OUTPUT_TEXTFILE)92 return go_back, go_back_again93 while True:94 if settings.RHOST and settings.LPORT in settings.SHELL_OPTIONS:95 result = checks.check_bind_tcp_options(settings.RHOST)96 else: 97 cmd = bind_tcp.bind_tcp_options()98 result = checks.check_bind_tcp_options(cmd)99 if result != None:100 if result == 0:101 go_back_again = False102 elif result == 1 or result == 2:103 go_back_again = True104 settings.BIND_TCP = False105 elif result == 3:106 settings.BIND_TCP = False107 reverse_tcp_config(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename, os_shell_option, go_back, go_back_again, payload, OUTPUT_TEXTFILE) 108 return go_back, go_back_again109 # execute bind TCP shell 110 execute_shell(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename, os_shell_option, payload, OUTPUT_TEXTFILE)111"""112Configure the reverse TCP shell113"""114def reverse_tcp_config(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename, os_shell_option, go_back, go_back_again, payload, OUTPUT_TEXTFILE):115 settings.REVERSE_TCP = True116 # Set up LHOST / LPORT for the reverse TCP connection.117 reverse_tcp.configure_reverse_tcp()118 if settings.REVERSE_TCP == False:119 if settings.BIND_TCP == True:120 os_shell_option = "bind_tcp"121 bind_tcp_config(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename, os_shell_option, go_back, go_back_again, payload, OUTPUT_TEXTFILE)122 return go_back, go_back_again123 while True:124 if settings.LHOST and settings.LPORT in settings.SHELL_OPTIONS:125 result = checks.check_reverse_tcp_options(settings.LHOST)126 else: 127 cmd = reverse_tcp.reverse_tcp_options()128 result = checks.check_reverse_tcp_options(cmd)129 if result != None:130 if result == 0:131 go_back_again = False132 elif result == 1 or result == 2:133 go_back_again = True134 settings.REVERSE_TCP = False135 elif result == 3:136 settings.REVERSE_TCP = False137 bind_tcp_config(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename, os_shell_option, go_back, go_back_again, payload, OUTPUT_TEXTFILE)138 #reverse_tcp_config(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename, os_shell_option, go_back, go_back_again) 139 return go_back, go_back_again140 # execute reverse TCP shell 141 execute_shell(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename, os_shell_option, payload, OUTPUT_TEXTFILE)142"""143Check commix shell options144"""145def check_option(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename, technique, go_back, no_result, timesec, go_back_again, payload, OUTPUT_TEXTFILE):146 os_shell_option = checks.check_os_shell_options(cmd.lower(), technique, go_back, no_result) 147 if os_shell_option == "back" or os_shell_option == True or os_shell_option == False:148 go_back = True149 if os_shell_option == False:150 go_back_again = True151 return go_back, go_back_again152 # The "os_shell" option153 elif os_shell_option == "os_shell": 154 warn_msg = "You are already into the '" + os_shell_option + "' mode."155 print settings.print_warning_msg(warn_msg)156 return go_back, go_back_again157 # The "bind_tcp" option158 elif os_shell_option == "bind_tcp":159 go_back, go_back_again = bind_tcp_config(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename, os_shell_option, go_back, go_back_again, payload, OUTPUT_TEXTFILE)160 return go_back, go_back_again161 # The "reverse_tcp" option162 elif os_shell_option == "reverse_tcp":163 go_back, go_back_again = reverse_tcp_config(separator, TAG, cmd, prefix, suffix, whitespace, http_request_method, url, vuln_parameter, alter_shell, filename, os_shell_option, go_back, go_back_again, payload, OUTPUT_TEXTFILE)164 return go_back, go_back_again165 # The "quit" option166 elif os_shell_option == "quit": 167 sys.exit(0)168 else:...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run robotframework-ioslibrary automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful