How to use _post method in robotframework-ioslibrary

Best Python code snippet using robotframework-ioslibrary_python

create_controllers_views.py

Source:create_controllers_views.py Github

copy

Full Screen

1# create_controllers.py23import os4 5#controller = os.mkdir('controller')67if not os.path.exists('../controllers'):8 os.makedirs('../controllers')9 os.makedirs('../views')10 11userinput = input('Please Enter Filename!: ')1213os.makedirs('../views/'+userinput)1415ext = ".php"1617filename = userinput+ext1819uclassinput = input('Please Enter Class name!: ')2021classinput = uclassinput.title()2223f = open('../controllers/'+filename,'w')24g = open('../views/'+userinput+'/index.php','w')2526if not os.path.exists('../views/templates'):27 os.makedirs('../views/templates')2829h = open('../views/templates/header.php','w')30i = open('../views/templates/footer.php','w') 3132message = """<?php3334 class """ + classinput + """ extends Controller{35 36 public function index(){3738 $data['title'] = '"""+classinput+"""';39 40 $this->view('templates/header', $data);41 $this->view('"""+userinput+"""/index', $data);42 $this->view('templates/footer'); 4344 }45 46 public function User(){47 48 $data['title'] = "User";4950 $this->view('templates/header', $data);51 $this->view('users/index', $data);52 $this->view('templates/footer'); 53 54 } 5556 public function dashboard(){57 58 $logged = Session::get('loggedIn');59 60 if ($logged == false) {61 62 Session::destroy();63 header('location: ' . BASEURL . 'dashboard/login');64 exit;65 66 }67 68 $uid = Session::get('uid');69 70 $data['users'] = $this->model('Users_model')->getAllData($uid);7172 $data['title'] = "User";7374 $this->view('templates/header', $data);75 $this->view('dashboard/index', $data);76 $this->view('templates/footer'); 77 78 }79 80 public function resetPass(){81 82 $password = $_POST['npassword'];83 $email = $_POST['emailpass'];84 85 $apassword = Openssl::encrypt($password,$email);8687 if($this->model('Users_model')->checkAccPassword($_POST) > 0 ){ 8889 $change = $this->model('Users_model')->changeAccPassword($_POST, $apassword);9091 if($change > 0 ){92 93 $to = $email;94 $subject = "MVC Crud Password Changed";95 $message = "96 <html>97 <head>98 <title>MVC Crud Password Changed</title>99 </head>100 <body>101 <p>Hai '$username'</p>102 <p><h2>Acc Info</h2></p>103 <p>Login ID: '$username'</p>104 <p>Your New Password: '$password'</p>105 <p>106 Thank you,<br >107 MVC Crud <br >108 Hotline : 012-3456789109 </p>110 </body>111 </html>112 ";113 // Always set content-type when sending HTML email114 $headers = "MIME-Version: 1.0" . "\r\n";115 $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";116 // More headers117 $headers .= 'From: <admin@progse.com>' . "\r\n";118 $headers .= 'Cc: myboss@example.com' . "\r\n";119 mail($to,$subject,$message,$headers); 120 121 Session::destroy();122 Session::setFlash(' Password Change ', 'Succesfully', 'success'); 123 header('Location: ' . BASEURL . 'Users/login');124 exit;125126 }else{127128 Session::setFlash(' Failed ', 'to Change Password', 'danger');129 header('Location: ' . BASEURL . 'Users');130 exit;131132 }133134 }else{135136 Session::setFlash(' Current ', 'Password Invalid', 'danger');137 header('Location: ' . BASEURL . 'Users');138 exit; 139140 }141 142 }143 144145 public function login(){146147 $data['title'] = "Login";148149 $this->view('templates/header', $data);150 $this->view('dashboard/login', $data);151 $this->view('templates/footer');152153 }154155156 public function loginCheck(){157158 $data['title'] = "Login Check";159160 $logid = $_POST['logid'];161162 $password = $_POST['password'];163 164 if($this->model('Users_model')->loginCheck($_POST) > 0){165 166 $data['users'] = $this->model('Users_model')->getUserData($logid, $password);167 168 $uid = $data['users']['id'];169 170 Session::set('uid', $uid);171 Session::set('loggedIn', true);172173 Session::setFlash(' Succesfully ', 'Logged in', 'success');174 header('Location: ' . BASEURL . 'dashboard');175 exit;176177 }else{178 179 Session::setFlash(' Password maybe Wrong or your Users is not activate ', 'please check your email', 'danger');180 181 ?>182 <script>183 alert("Failed");184 </script>185 186 <?php187 header('Location: ' . BASEURL . 'dashboard/login');188 exit;189 }190191 }192193194 public function create(){195196 $pics = BASEURL . "uploads/" . $_FILES["file"]["name"];197198 $username = $_POST['username'];199 $password = $_POST['password'];200 $email = $_POST['email']; 201 $contact = $_POST['contact'];202 203 $apassword = Openssl::encrypt($password,$email);204205 if($this->model('Users_model')->createAcc($_POST, $pics, $apassword) > 0){206 207 208 $url = 'https://api.twilio.com/2010-04-01/Users/+yourtoke+/Messages.json'; 209 210 $from = "+14792529356";211212 $to = "+6".$contact;213 214 $root = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . '/';215 $activate = $root.ACTVURL.$username."/".$password; 216217 $body = $activate;218219 $id = "AC4244a6a3efbb7ac8da72613fca003bf6";220221 $token = "f10db1f05c42bc6f8074175c88f487da";222223 $data = array (224225 'From' => $from,226 'To' => $to,227 'Body' => $body228 229 );230 231 $post = http_build_query($data);232 $x = curl_init($url);233 curl_setopt($x, CURLOPT_POST, true);234 curl_setopt($x, CURLOPT_RETURNTRANSFER, true);235 curl_setopt($x, CURLOPT_USERPWD, "$id:$token");236 curl_setopt($x, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);237 curl_setopt($x, CURLOPT_POSTFIELDS, $post);238239 var_dump($post);240 $y = curl_exec($x);241 var_dump($y);242 curl_close($x);243244245 $root = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . '/';246 $activate = $root.ACTVURL.$username."/".$password;247 $to = $email;248 $subject = "MVC Crud Registration";249 $message = "250 <html>251 <head>252 <title>MVC Crud Registration</title>253 </head>254 <body>255 <p>Hai '$username'</p>256 <p><h2>Acc Info</h2></p>257 <p>Activation URL : '$activate'</p>258 <p>Login ID: '$username'</p>259 <p>Password: '$password'</p>260 <p>261 Thank you,<br >262 MVC Crud <br >263 Hotline : 012-3456789264 </p>265 </body>266 </html>267 ";268 // Always set content-type when sending HTML email269 $headers = "MIME-Version: 1.0" . "\r\n";270 $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";271 // More headers272 $headers .= 'From: <admin@progse.com>' . "\r\n";273 $headers .= 'Cc: myboss@example.com' . "\r\n";274 mail($to,$subject,$message,$headers); 275 276 Session::setFlash(' Succesfully ', 'Added', 'success');277 header('Location: ' . BASEURL . 'Users/login');278 exit;279280 }else{281282 Session::setFlash(' Failed ', 'to Add', 'danger');283 header('Location: ' . BASEURL . 'Users/login');284 exit;285286 } 287288 }289290 291 public function email_activation($logid, $password){ 292 293 $data['Users'] = $this->model('Users_model')->getAccData($logid, $password);294 295 $uid = $data['Users']['id'];296 297 if($this->model('Users_model')->editStatus($uid) > 0 ){298 299 ?>300 301 <script type="text/javascript">302 303 alert("Akaun anda telah di Aktifkan!");304305 window.close();306 307 </script>308 309 <?php310311 }else{312 313 ?>314 315 <script type="text/javascript">316 317 alert("Akaun anda gagal di Aktifkan!");318319 window.close();320 321 </script>322 323 <?php324325 } 326 327 }328329330 public function logout(){331 332 Session::destroy();333 header('location: ' . BASEURL . 'Users/login');334 exit;335336 }337338339 public function editAcc(){340341 //echo $_POST['id'];342343 echo json_encode($this->model('Users_model')->editAccData($_POST['id']));344345 } 346347348 public function editUsers(){349 350 //echo $_POST['id']; 351352 $username = $_POST['username'];353 $contact = $_POST['contact'];354 $email = $_POST['email']; 355 356 if($this->model('Users_model')->editUsersData($_POST) > 0 ){357 358 $to = $email;359 $subject = "MVC Crud Users Modified";360 $message = "361 <html>362 <head>363 <title>MVC Crud Users Modified</title>364 </head>365 <body>366 <p>Hai '$username'</p>367 <p><h2>Acc Info</h2></p>368 <p>Login ID: '$username'</p>369 <p>Contact Number: '$contact'</p>370 <p>Email: '$email'</p>371 <p>372 Thank you,<br >373 MVC Crud <br >374 Hotline : 012-3456789375 </p>376 </body>377 </html>378 ";379 // Always set content-type when sending HTML email380 $headers = "MIME-Version: 1.0" . "\r\n";381 $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";382 // More headers383 $headers .= 'From: <admin@progse.com>' . "\r\n";384 $headers .= 'Cc: myboss@example.com' . "\r\n";385 mail($to,$subject,$message,$headers); 386 387 Session::setFlash(' Users Edited ', 'Succesfully', 'success');388 header('Location: ' . BASEURL . 'Users');389 exit;390391 }else{392 393 Session::setFlash(' Failed ', 'to Edit Users', 'danger');394 header('Location: ' . BASEURL . 'Users');395 exit;396397 }398399 }400401402403 public function editPic(){404405 $pics = BASEURL . "uploads/" . $_FILES["file"]["name"];406407 if($this->model('Users_model')->changeAccPic($_POST, $pics) > 0 ){408409 Session::setFlash(' Picture Change ', 'Succesfully', 'success');410 header('Location: ' . BASEURL . 'Users');411 exit;412413 }else{414415 Session::setFlash(' Failed ', 'to Change Picture', 'danger');416 header('Location: ' . BASEURL . 'Users');417 exit;418419 } 420421 }422423424 public function changePassword(){425426 $username = $_POST['userpass'];427 $password = $_POST['npassword'];428 $email = $_POST['emailpass'];429 430 $apassword = Openssl::encrypt($password,$email);431432 if($this->model('Users_model')->checkAccPassword($_POST) > 0 ){ 433434 $change = $this->model('Users_model')->changeAccPassword($_POST, $apassword);435436 if($change > 0 ){437 438 $to = $email;439 $subject = "MVC Crud Password Changed";440 $message = "441 <html>442 <head>443 <title>MVC Crud Password Changed</title>444 </head>445 <body>446 <p>Hai '$username'</p>447 <p><h2>Acc Info</h2></p>448 <p>Login ID: '$username'</p>449 <p>Your New Password: '$password'</p>450 <p>451 Thank you,<br >452 MVC Crud <br >453 Hotline : 012-3456789454 </p>455 </body>456 </html>457 ";458 // Always set content-type when sending HTML email459 $headers = "MIME-Version: 1.0" . "\r\n";460 $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";461 // More headers462 $headers .= 'From: <admin@progse.com>' . "\r\n";463 $headers .= 'Cc: myboss@example.com' . "\r\n";464 mail($to,$subject,$message,$headers); 465 466 Session::destroy();467 Session::setFlash(' Password Change ', 'Succesfully', 'success'); 468 header('Location: ' . BASEURL . 'Users/login');469 exit;470471 }else{472473 Session::setFlash(' Failed ', 'to Change Password', 'danger');474 header('Location: ' . BASEURL . 'Users');475 exit;476477 }478479 }else{480481 Session::setFlash(' Current ', 'Password Invalid', 'danger');482 header('Location: ' . BASEURL . 'Users');483 exit; 484485 } 486487 }488 489 490 public function passcheck(){491 492 $email = $_POST['email'];493 494 if($this->model('Users_model')->getPass($_POST['email']) > 0 ){ 495496 $data['Users'] = $this->model('Users_model')->getPass($_POST['email']);497 498 $apassword = $data['Users']['apassword'];499 500 $password = Openssl::decrypt($apassword, $email); 501502 if($password != null ){503 504 $to = $email;505 $subject = "MVC Crud Forgot Password";506 $message = "507 <html>508 <head>509 <title>MVC Crud PForgot Password</title>510 </head>511 <body>512 <p>Hai '$username'</p>513 <p><h2>Acc Info</h2></p>514 <p>Login ID: '$username'</p>515 <p>Your Password is: '$password'</p>516 <p>517 Thank you,<br >518 MVC Crud <br >519 Hotline : 012-3456789520 </p>521 </body>522 </html>523 ";524 // Always set content-type when sending HTML email525 $headers = "MIME-Version: 1.0" . "\r\n";526 $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";527 // More headers528 $headers .= 'From: <admin@progse.com>' . "\r\n";529 $headers .= 'Cc: myboss@example.com' . "\r\n";530 mail($to,$subject,$message,$headers); 531 532 Session::setFlash(' Forgot Password Send ', 'Succesfully', 'success'); 533 header('Location: ' . BASEURL . 'Users/forgotpass');534 exit;535536 }else{537538 Session::setFlash(' Failed ', 'to send Password', 'danger');539 header('Location: ' . BASEURL . 'Users/forgotpass');540 exit;541542 }543544 }else{545546 Session::setFlash(' Email ', 'Not Exist', 'danger');547 header('Location: ' . BASEURL . 'Users/forgotpass');548 exit; 549550 } 551 552 }553 554 public function ajaxApi(){555 556 //$data = $_POST['data']; 557 558 $logid = $_POST['logid'];559 560 $password = $_POST['password'];561 562 //$logid = $_SERVER['PHP_AUTH_USER'];563 //$password = $_SERVER['PHP_AUTH_PW'];564 565 566 567 if($this->model('Users_model')->getAccData($logid, $password)){568 569 header("Access-Control-Allow-Origin: *");570 header("Content-Type: application/json; charset=UTF-8");571572 echo json_encode($this->model('Users_model')->getAccData($logid, $password));573 574 }else{575 576 $msg = "Failed!";577 578 echo json_encode($msg);579 }580581 }582583 public function curlApi(){584 585 //$data = $_POST['data']; 586 587 //$logid = $_POST['logid']; 588 //$password = $_POST['password'];589 590 $logid = $_SERVER['PHP_AUTH_USER'];591 $password = $_SERVER['PHP_AUTH_PW'];592 593 594 595 if($this->model('Users_model')->getAccData($logid, $password)){596 597 header("Access-Control-Allow-Origin: *");598 header("Content-Type: application/json; charset=UTF-8");599600 echo json_encode($this->model('Users_model')->getAccData($logid, $password));601 602 }else{603 604 $msg = "Failed!";605 606 echo json_encode($msg);607 }608609 } 610 611 public function detail($id){612613 $data['title'] = '"""+classinput+"""';614 $data['mhs'] = $this->model('"""+classinput+"""_model')->getDataById($id);615 $this->view('templates/header', $data);616 $this->view('"""+userinput+"""/detail', $data);617 $this->view('templates/footer');618619 } 620621 public function added(){622623 if($this->model('"""+classinput+"""_model')->addData($_POST, $_FILES['pics']['name'], $_FILES['pics']['tmp_name']) > 0 ){624 625 Flasher::setFlash(' Added ', 'Succesfully', 'success');626 header('Location: ' . BASEURL . '/"""+userinput+"""');627 exit;628629 }else{630631 Flasher::setFlash(' Added ', 'Failed!', 'danger');632 header('Location: ' . BASEURL . '/"""+userinput+"""');633 exit;634635 }636637 } 638639 public function delete($id){640641 if($this->model('"""+classinput+"""_model')->deleteData($id) > 0){642 Flasher::setFlash(' deleted ', 'Succesfully', 'success');643 header('Location: ' . BASEURL . '/"""+userinput+"""');644 exit;645646 }else{647648 Flasher::setFlash(' delete ', 'Failed', 'danger');649 header('Location: ' . BASEURL . '/"""+userinput+"""');650 exit;651652 }653654 } 655656 public function getedit(){657658 //echo $_POST['id'];659660 echo json_encode($this->model('"""+classinput+"""_model')->getEditData($_POST['id']));661662 }663664 public function edit(){665666 if($this->model('"""+classinput+"""_model')->editData($_POST) > 0 ){667 Flasher::setFlash(' berjaya ', 'di edit', 'success');668 header('Location: ' . BASEURL . '/"""+userinput+"""');669 exit;670671 }else{672673 Flasher::setFlash(' gagal ', 'di edit', 'danger');674 header('Location: ' . BASEURL . '/"""+userinput+"""');675 exit;676677 } 678679 }680681682 public function search(){683684 $data['title'] = '"""+classinput+"""';685 $data['mhs'] = $this->model('"""+classinput+"""_model')->searchData();686 $this->view('templates/header', $data);687 $this->view('"""+userinput+"""/index', $data);688 $this->view('templates/footer'); 689690 } 691 692 public function phpinfo(){ 693694 $data['title'] = 'Defaults';695696 $this->view('defaults/phpinfo', $data);697 }698699 700 }701702"""703704f.write(message)705f.close()706707708content = """<h1>Hello World!</h1>"""709710g.write(content)711g.close()712713header = """<!doctype html>714<html lang="en">715 <head>716 <!-- Required meta tags -->717 <meta charset="utf-8">718 <meta name="viewport" content="width=device-width, initial-scale=1">719720 <!-- Bootstrap CSS -->721 <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/css/bootstrap.min.css" integrity="sha384-r4NyP46KrjDleawBgD5tp8Y7UzmLA05oM1iAEQ17CSuDqnUK2+k9luXQOfXJCJ4I" crossorigin="anonymous">722723 <title>Hello, world!</title>724 </head>725 <body>"""726 727h.write(header)728h.close()729730footer = """ <!-- Optional JavaScript -->731 <!-- Popper.js first, then Bootstrap JS -->732 <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>733 <script src="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/js/bootstrap.min.js" integrity="sha384-oesi62hOLfzrys4LxRF63OJCXdXDipiYWBnvTl9Y9/TRlw5xlKIEHpNyvvDShgf/" crossorigin="anonymous"></script>734 </body>735</html>"""736 737i.write(footer) ...

Full Screen

Full Screen

__init__.py

Source:__init__.py Github

copy

Full Screen

...21 self.order = MerchantOrder(self._client)22 self.common = MerchantCommon(self._client)23 def create(self, product_data):24 """增加商品"""25 return self._post(26 'merchant/create',27 data=product_data28 )29 def delete(self, product_id):30 """删除商品"""31 return self._post(32 'merchant/del',33 data={34 'product_id': product_id35 }36 )37 def update(self, product_id, product_data):38 """修改商品"""39 product_data['product_id'] = product_id40 return self._post(41 'merchant/update',42 data=product_data43 )44 def get(self, product_id):45 """查询商品"""46 return self._post(47 'merchant/get',48 data={49 'product_id': product_id50 }51 )52 def get_by_status(self, status):53 """获取指定状态的所有商品"""54 return self._post(55 'merchant/getbystatus',56 data={57 'status': status58 }59 )60 def update_product_status(self, product_id, status):61 """商品上下架"""62 return self._post(63 'merchant/modproductstatus',64 data={65 'product_id': product_id,66 'status': status67 }68 )69 def get_subcategories(self, cate_id):70 """71 获取指定分类的所有子分类72 :param cate_id: 大分类ID(根节点分类id为1)73 :return: 返回的 JSON 数据包74 """75 return self._post(76 'merchant/category/getsub',77 data={78 'cate_id': cate_id79 }80 )81 def get_category_sku(self, cate_id):82 """83 获取指定子分类的所有SKU84 :param cate_id: 商品子分类ID85 :return: 返回的 JSON 数据包86 """87 return self._post(88 'merchant/category/getsku',89 data={90 'cate_id': cate_id91 }92 )93 def get_category_property(self, cate_id):94 """95 获取指定分类的所有属性96 :param cate_id: 商品子分类ID97 :return: 返回的 JSON 数据包98 """99 return self._post(100 'merchant/category/getproperty',101 data={102 'cate_id': cate_id103 }104 )105 def add_stock(self, product_id, sku_info, quantity):106 """107 增加库存108 :param product_id: 商品ID109 :param sku_info: sku信息,格式"id1:vid1;id2:vid2",如商品为统一规格,则此处赋值为空字符串即可110 :param quantity: 增加的库存数量111 :return: 返回的 JSON 数据包112 """113 return self._post(114 'merchant/stock/add',115 data={116 "product_id": product_id,117 "sku_info": sku_info,118 "quantity": quantity119 }120 )121 def reduce_stock(self, product_id, sku_info, quantity):122 """123 减少库存124 :param product_id: 商品ID125 :param sku_info: sku信息,格式"id1:vid1;id2:vid2",如商品为统一规格,则此处赋值为空字符串即可126 :param quantity: 减少的库存数量127 :return: 返回的 JSON 数据包128 """129 return self._post(130 'merchant/stock/reduce',131 data={132 "product_id": product_id,133 "sku_info": sku_info,134 "quantity": quantity135 }136 )137 def add_express(self, product_data):138 """139 增加邮费模板140 :param product_data: 邮费信息141 :return: 返回的 JSON 数据包142 """143 return self._post(144 'merchant/express/add',145 data=product_data146 )147 def del_express(self, template_id):148 """149 增加邮费模板150 :param template_id: 邮费模板ID151 :return: 返回的 JSON 数据包152 """153 return self._post(154 'merchant/express/del',155 data={156 'template_id': template_id157 }158 )159 def update_express(self, template_id, delivery_template):160 """161 增加邮费模板162 :param template_id: 邮费模板ID163 :param delivery_template: 邮费模板信息(字段说明详见增加邮费模板)164 :return: 返回的 JSON 数据包165 """166 delivery_template['template_id'] = template_id167 return self._post(168 'merchant/express/update',169 data=delivery_template170 )171 def get_express(self, template_id):172 """173 获取指定ID的邮费模板174 :param template_id: 邮费模板ID175 :return: 返回的 JSON 数据包176 """177 return self._post(178 'merchant/express/getbyid',179 data={180 'template_id': template_id181 }182 )183 def get_all_express(self):184 """185 获取所有邮费模板186 :param template_id: 邮费模板ID187 :return: 返回的 JSON 数据包188 """189 return self._get(190 'merchant/express/getall'191 )192 def add_group(self, group_detail):193 """194 增加分组195 :param group_detail: 商品分组信息196 :return: 返回的 JSON 数据包197 """198 return self._post(199 'merchant/group/add',200 data=group_detail201 )202 def del_group(self, group_id):203 """204 删除分组205 :param group_id: 商品分组ID206 :return: 返回的 JSON 数据包207 """208 return self._post(209 'merchant/group/del',210 data={211 'group_id': group_id212 }213 )214 def update_group_property(self, group_id, group_properties):215 """216 修改分组属性217 :param group_id: 商品分组ID218 :param group_properties: 商品分组属性219 :return: 返回的 JSON 数据包220 """221 group_properties['group_id'] = group_id222 return self._post(223 'merchant/group/propertymod',224 data=group_properties225 )226 def update_group_product(self, group_id, product_data):227 """228 修改分组商品229 :param group_id: 商品分组ID230 :param product_data: 分组商品信息231 :return: 返回的 JSON 数据包232 """233 product_data['group_id'] = group_id234 return self._post(235 'merchant/group/productmod',236 data=product_data237 )238 def get_all_groups(self):239 """240 获取所有分组241 :return: 返回的 JSON 数据包242 """243 return self._get(244 'merchant/group/getall'245 )246 def get_group(self, group_id):247 """248 根据分组ID获取分组信息249 :param group_id: 商品分组ID250 :return: 返回的 JSON 数据包251 """252 return self._post(253 'merchant/group/getbyid',254 data={255 'group_id': group_id256 }257 )258 def add_shelf(self, shelf_data):259 """260 增加货架261 :param shelf_data: 货架详情信息262 :return: 返回的 JSON 数据包263 """264 return self._post(265 'merchant/shelf/add',266 data=shelf_data267 )268 def del_shelf(self, shelf_id):269 """270 删除货架271 :param shelf_id: 货架ID272 :return: 返回的 JSON 数据包273 """274 return self._post(275 'merchant/shelf/del',276 data={277 'shelf_id': shelf_id278 }279 )280 def update_shelf(self, shelf_id, shelf_data):281 """282 修改货架283 :param shelf_id: 货架ID284 :param shelf_data: 货架详情285 :return: 返回的 JSON 数据包286 """287 shelf_data['shelf_id'] = shelf_id288 return self._post(289 'merchant/shelf/mod',290 data=shelf_data291 )292 def get_all_shelves(self):293 """294 获取所有货架295 :return: 返回的 JSON 数据包296 """297 return self._get(298 'merchant/shelf/getall'299 )300 def get_shelf(self, shelf_id):301 """302 根据货架ID获取货架信息303 :param shelf_id: 货架ID304 :return: 返回的 JSON 数据包305 """306 return self._post(307 'merchant/shelf/getbyid',308 data={309 'shelf_id': shelf_id310 }311 )312 def get_order(self, order_id):313 """314 根据订单ID获取订单详情315 :param order_id: 订单ID316 :return: 返回的 JSON 数据包317 """318 return self._post(319 'merchant/order/getbyid',320 data={321 'order_id': order_id322 }323 )324 def query_order(self, status=None, begintime=None, endtime=None):325 """326 根据订单状态/创建时间获取订单详情327 :param status: 订单状态(不带该字段-全部状态, 2-待发货, 3-已发货, 5-已完成, 8-维权中, )328 :param begintime: 订单创建时间起始时间(不带该字段则不按照时间做筛选)329 :param endtime: 订单创建时间终止时间(不带该字段则不按照时间做筛选)330 :return: 返回的 JSON 数据包331 """332 return self._post(333 'merchant/order/getbyfilter',334 data={335 'status': status,336 'begintime': begintime,337 'endtime': endtime338 }339 )340 def set_delivery(self, order_id, delivery_data):341 """342 修改货架343 :param order_id: 订单ID344 :param delivery_data: 商品物流信息345 :return: 返回的 JSON 数据包346 """347 delivery_data['order_id'] = order_id348 return self._post(349 'merchant/shelf/setdeliverymod',350 data=delivery_data351 )352 def upload_image(self, media_file):353 """354 上传图片355 :param media_file: 要上传的文件,一个 File-object356 :return: 上传成功时返回图片 URL357 """358 res = self._post(359 url='merchant/common/upload_img',360 files={361 'media': media_file362 },363 result_processor=lambda x: x['url']364 )...

Full Screen

Full Screen

xlsx2sportsapp.py

Source:xlsx2sportsapp.py Github

copy

Full Screen

1from openpyxl import load_workbook2wb2 = load_workbook('Move_2015_08_21_13_09_49_Running.xlsx')3print(wb2.get_sheet_names())4#['21 Aug 2015 13_09_49']5ws = wb2.active6#$seance_id=$_POST['seance_id'];7#$seance_name=$_POST['seance_name'];8#$sport_id=$_POST['sport_id'];9print(ws['A3'].value)10##1=velo11##2=escalade12##3=natation13##4=Footing14##5=Rando15##6=Ski de rando16##7=Skating17##8=SKI ALPIN18##10=musculation19#$date=$_POST['date'];20#$cal=$_POST['cal'];21print(ws['D3'].value)22#$dist=$_POST['dist'];23print(ws['E3'].value)24##in meter25#$duration=$_POST['duration'];26print(ws['C3'].value)27##in seconde to be converted HH:MM:ss28#$fat=$_POST['fat'];29#$above=$_POST['above'];30#$below=$_POST['below'];31#$in_zone=$_POST['in_zone'];32#$lower=$_POST['lower'];33#$upper=$_POST['upper'];34#$fmoy=$_POST['fmoy'];35print(ws['F3'].value)36#$fmax=$_POST['fmax'];37print(ws['S3'].value)38#$vmoy=$_POST['vmoy'];39print(ws['I3'].value)40#$vmax=$_POST['vmax'];41#$altitude=$_POST['altitude'];42#$url = $_POST['url'];...

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