Best Python code snippet using fMBT_python
ui_keywords.py
Source:ui_keywords.py
...288 #gui not found289 290 #Give focus to an item in the list291 while selectedIndex == -1:292 if not self._target.getMonkeyDriver().sendPress("DPAD_DOWN"):293 return False294 295 list, selectedIndex = self.__getSelectedIndex__()296 if list == None:297 return False298 299 item = self._target.getGUIReader().findComponentWithText(matcher.group("item"), rootItem = list, searchAll = False)300 301 #Selected item's index relative to currently shown list part302 RelIndex = 0303 for c in list.getChildren():304 if self._target.getGUIReader().findComponent(lambda x: x.getProperties().has_key("isSelected()") and x.getProperties()["isSelected()"].lower() == "true", c, False):305 break306 RelIndex +=1307 308 309 #Scroll list to the top if not already and if the item was not found from the current list part310 if selectedIndex > 0 and item == None and RelIndex != selectedIndex:311 for i in range(0,selectedIndex):312 if not self._target.getMonkeyDriver().sendPress("DPAD_UP"):313 return False314 time.sleep(NAV_DELAY)315 self._target.getGUIReader().readGUI()316 317 #Scroll the list down until the item is seen, or the bottom of the list is reached318 while item == None: 319 320 list = self._target.getGUIReader().getListView()321 item = self._target.getGUIReader().findComponentWithText(matcher.group("item"), rootItem = list, searchAll = False)322 selectedIndex = int(list.getProperties()["mSelectedPosition"])323 324 if item:325 break326 RelCurrentIndex = 0327 for c in list.getChildren():328 if self._target.getGUIReader().findComponent(lambda x: x.getProperties().has_key("isSelected()") and x.getProperties()["isSelected()"].lower() == "true", c, False):329 break330 RelCurrentIndex += 1331 332 #If last item of the list is listed, item can't be found333 if selectedIndex + (len(list.getChildren()) - RelCurrentIndex) >= int(list.getProperties()["mItemCount"]):334 return False335 336 337 #TODO: Too much scrolling in some situations.338 for i in range(0,len(list.getChildren())):339 if not self._target.getMonkeyDriver().sendPress("DPAD_DOWN"):340 return False341 342 time.sleep(NAV_DELAY)343 self._target.getGUIReader().readGUI()344 #If item was found, tap it...345 if item:346 347 #...only if execute parameter allows348 if executeItem:349 350 try:351 x,y = self._target.getGUIReader().getViewCoordinates(item)352 except guireader.GuiReaderError,e:353 print e354 return False355 356 return self._target.getMonkeyDriver().sendTap(x,y)357 358 #else make sure the item is in the selected state359 else:360 361 currentRelIndex = 0362 currentFound = False363 itemRelIndex = 0364 itemFound = False365 366 for c in list.getChildren():367 368 if self._target.getGUIReader().findComponentWithText(matcher.group("item"), rootItem = c) != None:369 itemFound = True 370 elif not itemFound:371 itemRelIndex += 1372 373 if c.getProperties()["isSelected()"] == "true":374 currentFound = True 375 elif not currentFound:376 currentRelIndex += 1377 press = "DPAD_DOWN"378 if itemRelIndex < currentRelIndex:379 press = "DPAD_UP"380 381 while item.getProperties()["isSelected()"] == "false":382 if not self._target.getMonkeyDriver().sendPress(press):383 return False384 time.sleep(NAV_DELAY) 385 self._target.getGUIReader().readGUI() 386 list = self._target.getGUIReader().getListView()387 item = self._target.getGUIReader().findComponentWithText(matcher.group("item"), rootItem = list, searchAll = False)388 if not item:389 return False390 391 392 return True 393 394 """395 #This implementation navigates to the desired item with dpad. It does not work if the list contains items that are not focusable.396 397 RelItemIndex = 0 398 for c in list.getChildren():399 if self._target.getGUIReader().findComponentWithText(matcher.group("item"), rootItem = c, searchAll = False):400 break401 RelItemIndex +=1402 403 RelCurrentIndex = 0404 for c in list.getChildren():405 if self._target.getGUIReader().findComponent(lambda x: x.getProperties().has_key("isSelected()") and x.getProperties()["isSelected()"].lower() == "true", c, False):406 break407 RelCurrentIndex +=1408 409 steps = RelItemIndex - RelCurrentIndex410 411 if steps > 0:412 key = "DPAD_DOWN"413 else:414 key = "DPAD_UP"415 416 for i in range(0,abs(steps)):417 if not self._target.getMonkeyDriver().sendPress(key):418 return False 419 420 if not self._target.getMonkeyDriver().sendPress("DPAD_CENTER"):421 return False 422 423 return True 424 """425 426 return False427 428 429#-----------------------------------------------------------------------------# 430class TapCoordinate(Keyword):431 432 def __init__(self):433 super(TapCoordinate,self).__init__()434 pattern = re.compile("(?P<x>\d+)\s*,\s*(?P<y>\d+)(\s*,\s*(?P<times>\d+))?") 435 self.attributePattern = pattern 436 437 def doTap(self,x,y):438 439 w, h = self._target.getMonkeyDriver().getScreenSize()440 if (int(x) > w or int(y) > h):441 print "Invalid coordinates"442 return False443 444 return self._target.getMonkeyDriver().sendTap(x,y) 445 446 def execute(self):447 448 matcher = self.attributePattern.match(self.attributes)449 times = 1450 451 if matcher.group("times"):452 times = int(matcher.group("times"))453 454 for i in range(0,times):455 if not self.doTap(matcher.group(1),matcher.group(2)):456 return False457 458 return True459#-----------------------------------------------------------------------------# 460class TapDownCoordinate(TapCoordinate):461 462 def doTap(self,x,y):463 return self._target.getMonkeyDriver().sendTouchDown(x,y) 464 465#-----------------------------------------------------------------------------# 466class TapUpCoordinate(TapCoordinate):467 468 def doTap(self,x,y):469 return self._target.getMonkeyDriver().sendTouchUp(x,y) 470#-----------------------------------------------------------------------------# 471class LongTapCoordinate(TapCoordinate):472 473 def doTap(self,x,y):474 475 if self._target.getMonkeyDriver().sendTouchDown(x,y):476 time.sleep(self.__hold_time)477 return self._target.getMonkeyDriver().sendTouchUp(x,y)478 return False479 480 def execute(self):481 482 matcher = self.attributePattern.match(self.attributes)483 self.__hold_time = 2484 485 if matcher.group("times"):486 self.__hold_time = int(matcher.group("times"))487 if not self.doTap(matcher.group(1),matcher.group(2)):488 return False489 490 return True491#-----------------------------------------------------------------------------#492class MoveToCoordinate(TapCoordinate):493 494 def doTap(self,x,y):495 return self._target.getMonkeyDriver().sendTouchMove(x,y) 496 497#-----------------------------------------------------------------------------# 498class TapObject(ObjectKeyword):499 500 """501 Taps the given component.502 503 Usage:504 kw_TapObject componentReferece505 """506 507 def __init__(self):508 super(TapObject,self).__init__()509 pattern = re.compile("((?P<times>\d+)\s*,\s*)?(?P<component>" + self.componentPattern + ")")510 self.attributePattern = pattern 511 512 def doTapAction(self,x,y):513 return self._target.getMonkeyDriver().sendTap(x,y) 514 515 def doTap(self,reference, times = 1): 516 517 item = self.findComponentReference(reference)518 519 if not item:520 return False 521 522 try:523 524 x,y = self._target.getGUIReader().getViewCoordinates(item)525 except guireader.GuiReaderError,e:526 print e527 return False528 529 for i in range(0,times):530 if not self.doTapAction(x,y):531 return False532 if times > 1:533 time.sleep(TAP_INTERVAL)534 return True535 536 def execute(self):537 matcher = self.attributePattern.match(self.attributes)538 539 times = 1540 if matcher.group("times"):541 times = int(matcher.group("times"))542 543 return self.doTap(matcher.group("component"),times) 544 545 546#-----------------------------------------------------------------------------# 547class TapDownObject(TapObject):548 549 def doTapAction(self,x,y):550 return self._target.getMonkeyDriver().sendTouchDown(x,y) 551 552#-----------------------------------------------------------------------------# 553class TapUpObject(TapObject):554 555 def doTapAction(self,x,y):556 return self._target.getMonkeyDriver().sendTouchUp(x,y) 557#-----------------------------------------------------------------------------# 558class LongTapObject(TapObject):559 560 def doTapAction(self,x,y):561 562 if self._target.getMonkeyDriver().sendTouchDown(x,y):563 time.sleep(self.__hold_time)564 return self._target.getMonkeyDriver().sendTouchUp(x,y)565 return False566 567 568 def execute(self):569 matcher = self.attributePattern.match(self.attributes)570 571 times = 1572 self.__hold_time = 2573 if matcher.group("times"):574 self.__hold_time = int(matcher.group("times"))575 576 return self.doTap(matcher.group("component"),times) 577 578#-----------------------------------------------------------------------------# 579class MoveToObject(TapObject):580 581 def doTapAction(self,x,y):582 return self._target.getMonkeyDriver().sendTouchMove(x,y) 583#-----------------------------------------------------------------------------# 584class Drag(ObjectKeyword):585 586 def __init__(self):587 super(Drag,self).__init__()588 pattern = re.compile("((?P<coord1>(?P<x1>\d+)\s*,\s*(?P<y1>\d+))|(?P<component1>.+))\s*-->\s*((?P<coord2>(?P<x2>\d+)\s*,\s*(?P<y2>\d+))|(?P<component2>.*))") 589 self.attributePattern = pattern 590 self._holdtime = 2591 self._dragtime = 0.001592 self._movepoints = 20593 594 595 def execute(self):596 597 matcher = self.attributePattern.match(self.attributes)598 599 if matcher.group("coord1"):600 x1 = int(matcher.group("x1"))601 y1 = int(matcher.group("y1"))602 else:603 604 item = self.findComponentReference(matcher.group("component1").strip())605 if not item:606 return False607 608 try: 609 x1,y1 = self._target.getGUIReader().getViewCoordinates(item)610 except guireader.GuiReaderError,e:611 612 print e613 return False614 615 #Tap down the first coordinate616 if not self._target.getMonkeyDriver().sendTouchDown(x1,y1):617 return False618 619 620 if matcher.group("coord2"):621 x2 = int(matcher.group("x2"))622 y2 = int(matcher.group("y2"))623 time.sleep(self._holdtime)624 else:625 626 item = self.findComponentReference(matcher.group("component2").strip())627 if not item:628 return False629 try:630 631 x2,y2 = self._target.getGUIReader().getViewCoordinates(item) 632 except guireader.GuiReaderError,e:633 print e634 return False635 636 #Move to the second coordinate and tap up637 for i in range(0,self._movepoints):638 if x2 > x1:639 nx = x1 + ((x2-x1)/self._movepoints)*i640 else:641 nx = x1 - ((x1 -x2)/self._movepoints)*i642 643 if x2 > x1:644 ny = y1 + ((y2-y1)/self._movepoints)*i645 else:646 ny = y1 - ((y1 -y2)/self._movepoints)*i647 #print nx,ny648 if not self._target.getMonkeyDriver().sendTouchMove(nx,ny):649 return False650 651 #time.sleep(self._dragtime)652 653 if self._target.getMonkeyDriver().sendTouchUp(x2,y2):654 return True655 656 return False657 658#-----------------------------------------------------------------------------# 659class TouchScroll(Drag):660 661 def __init__(self):662 super(TouchScroll,self).__init__()663 self._holdtime = 0664 665 666 667#-----------------------------------------------------------------------------# 668class MoveTrackBall(Keyword):669 670 671 """672 Taps the given component.673 674 Usage:675 kw_TapObject componentReferece676 """677 678 def __init__(self):679 super(MoveTrackBall,self).__init__()680 pattern = re.compile("(?P<dx>(-)?\d+)\s*,\s*(?P<dy>(-)?\d+)")681 self.attributePattern = pattern 682 683 684 def execute(self):685 matcher = self.attributePattern.match(self.attributes)686 687 return self._target.getMonkeyDriver().sendTrackBallMove(matcher.group("dx"),matcher.group("dy"))688#-----------------------------------------------------------------------------# 689class SelectFromMenu(TapObject):690 691 """692 Selects an item from the menu. 693 694 Presses the menu button, and finds the desired item. If the menu does not fit entirely to the screen and contains a "more" option, the item is searched under that menu. If the item is not found, menu will be closed in the end.695 696 Usage:697 """698 699 def __init__(self):700 super(SelectFromMenu,self).__init__()701 pattern = re.compile("(?P<menu>'.*')")702 self.attributePattern = pattern 703 704 def execute(self):705 matcher = self.attributePattern.match(self.attributes)706 707 item = matcher.group("menu")708 709 if not self._target.getMonkeyDriver().sendPress("menu"):710 return False711 712 time.sleep(2)713 714 self._target.getGUIReader().readGUI()715 716 if self.doTap(item):717 result = True718 719 elif self.doTap("'More'"):720 self._target.getGUIReader().readGUI()721 result = self.doTap(item)722 723 else:724 result = False725 726 if not result:727 self._target.getMonkeyDriver().sendPress("menu")728 729 return result 730 731 732#-----------------------------------------------------------------------------# 733class IsTrue(Keyword):734 """735 Kw_IsTrue returns True or False depending on the parameter736 737 Usage::738 kw_IsTrue True739 kw_IsTrue False740 """741 def __init__(self):742 super(IsTrue,self).__init__()743 pattern = re.compile("((True)|(False))?")744 self.attributePattern = pattern745 self.delay = -1746 self.shouldLog = False747 748 def execute(self):749 matcher = self.attributePattern.match(self.attributes)750 if(matcher.group(2) != None):751 return True752 return False 753#-----------------------------------------------------------------------------#754class SetTarget(Keyword):755 def __init__(self):756 super(SetTarget,self).__init__()757 pattern = re.compile(".*")758 self.attributePattern = pattern759 self.delay = -1760 761 def execute(self):762 return True 763#-----------------------------------------------------------------------------# 764class UpdateScreen(Keyword):765 def __init__(self):766 super(UpdateScreen,self).__init__()767 pattern = re.compile("\s*")768 self.attributePattern = pattern769 self.delay = -1770 self.shouldLog = False771 772 def execute(self):773 self._target.getGUIReader().readGUI()774 return True 775#-----------------------------------------------------------------------------# 776class Delay(Keyword):777 def __init__(self):778 super(Delay,self).__init__()779 pattern = re.compile("(\\d.)?\\d+")780 self.attributePattern = pattern781 self.delay = -1782 self.shouldLog = False783 784 def execute(self):785 matcher = self.attributePattern.match(self.attributes)786 if(matcher.group(0) != None):787 time.sleep(eval(matcher.group(0)))788 return True789 return False 790#-----------------------------------------------------------------------------#791class Type(Keyword):792 """793 Inserts text into a component. 794 Returns false if the component does not support text editation.795 796 Usage:797 kw_Type 'text', componentReference798 """799 def __init__(self):800 super(Type,self).__init__() 801 pattern = re.compile("'(.*)\'")#(\s*,\s*(" + self.componentPattern + "))")802 self.attributePattern = pattern 803 804 805 def execute(self):806 807 matcher = self.attributePattern.match(self.attributes)808 text = matcher.group(1)809 words = text.split(' ')810 811 first = True812 813 for word in words:814 815 if not first:816 817 if not self._target.getMonkeyDriver().sendPress("space"):818 return False819 820 if word != '':821 if not self._target.getMonkeyDriver().sendType(word): 822 return False823 824 first = False825 826 return True827 828#-----------------------------------------------------------------------------# 829class PressKey(Keyword):830 """831 Presses and releases a key832 833 Usage:834 Kw_PressKey keyname 835 """836 837 def __init__(self):838 super(PressKey,self).__init__()839 pattern = re.compile("(?P<button>\w+)(\s*,\s*(?P<times>\d+))?") 840 self.attributePattern = pattern841 842 def execute(self):843 matcher = self.attributePattern.match(self.attributes) 844 times = 1845 846 if matcher.group("times"):847 times = int(matcher.group("times"))848 for i in range(0,times):849 if not self._target.getMonkeyDriver().sendPress(matcher.group(1)):850 return False851 852 return True853#-----------------------------------------------------------------------------# 854#Alias855class PressHardKey(PressKey):856 pass857#-----------------------------------------------------------------------------# 858class PressKeyUp(PressKey):859 """860 releases a key861 862 Usage:863 Kw_PressKeyUp keyname 864 """865 866 def __init__(self):867 super(PressKeyUp,self).__init__()868 pattern = re.compile("(?P<button>\w+)") 869 self.attributePattern = pattern870 871 def execute(self):872 matcher = self.attributePattern.match(self.attributes) 873 return self._target.getMonkeyDriver().sendKeyUp(matcher.group(1))874 875#-----------------------------------------------------------------------------# 876class PressKeyDown(PressKey):877 """878 presses and holds a key879 880 Usage:881 Kw_PressKeyDown keyname 882 """883 884 def __init__(self):885 super(PressKeyDown,self).__init__()886 pattern = re.compile("(?P<button>\w+)") 887 self.attributePattern = pattern888 889 def execute(self):890 matcher = self.attributePattern.match(self.attributes) 891 return self._target.getMonkeyDriver().sendKeyDown(matcher.group(1))892#-----------------------------------------------------------------------------# 893class LongPressKey(PressKey):894 """895 896 """897 898 def __init__(self):899 super(LongPressKey,self).__init__()900 pattern = re.compile("(?P<button>\w+)(\s*,\s*(?P<time>\d+))?") 901 self.attributePattern = pattern902 903 def execute(self):904 matcher = self.attributePattern.match(self.attributes) 905 hold_time = 2906 907 if matcher.group("time"):908 hold_time = int(matcher.group("time"))909 if not self._target.getMonkeyDriver().sendKeyDown(matcher.group(1)):910 return False911 912 time.sleep(hold_time)913 914 return self._target.getMonkeyDriver().sendKeyUp(matcher.group(1))915 916#-----------------------------------------------------------------------------# 917class CheckProperty(ObjectKeyword):918 919 """920 921 """922 923 def __init__(self):924 super(CheckProperty,self).__init__()925 pattern = re.compile('(?P<property>[^,]*)\s*,\s*\'(?P<value>.*)\'\s*,\s*(?P<component>' + self.componentPattern+ ')')926 self.attributePattern = pattern927 928 def execute(self):929 930 matcher = self.attributePattern.match(self.attributes)931 property = matcher.group("property")932 value = matcher.group("value") 933 component = self.findComponentReference(matcher.group("component"))934 if component == None:935 return False936 937 if component.getProperties().has_key(property) and component.getProperties()[property] == value:938 return True939 940 return False 941 942#-----------------------------------------------------------------------------# 943class LaunchApp(ObjectKeyword):944 945 """946 LaunchApp 'package.Activity'947 948 """949 950 def __init__(self):951 super(LaunchApp,self).__init__() 952 pattern = re.compile('\'((?P<class>(?P<package>[^:]*)(::(?P<activityOtherPackage>.+)|(?P<activitySamePackage>\.[^.]+)))|(?P<launchplace>(recent|appmenu):)?(?P<appname>[^\.]*))\'')953 #pattern = re.compile("'(?P<name>.*)'")954 self.attributePattern = pattern955 self.delay = 5956 957 def execute(self):958 959 matcher = self.attributePattern.match(self.attributes)960 print self.attributes961 962 config = ConfigParser.ConfigParser()963 964 #If the application has a specified launchup name, use that instead. 965 try:966 config.read("appconfig.ini") 967 launchname = config.get("Applications", matcher.group(1))968 if launchname:969 self.attributes = "'" + launchname + "'"970 971 except ConfigParser.Error:972 self.log("Application name not found from config, using the name directly")973 974 975 matcher = self.attributePattern.match(self.attributes)976 self.log('Launching activity: ' + matcher.group(0))977 978 979 #Launching application process directly980 if matcher.group("class"):981 try:982 #activity in the same package with the process983 activity = matcher.group('activitySamePackage')984 985 #Activity in a other package than the process986 if not activity:987 activity = matcher.group('activityOtherPackage')988 989 retcode = subprocess.call("adb -s " + self._target.name + " shell am start -n " + matcher.group('package') + "/" + activity, shell=True)990 print "adb -s " + self._target.name + " shell am start -n " + matcher.group('package') + "/" + activity991 except (OSError, ValueError):992 return False993 994 if retcode != 0:995 self.log("Launching application failed, check that android sdk tools are in the path variable")996 return False997 998 return True999 1000 #Launching application through the GUI1001 else:1002 1003 appname = matcher.group("appname")1004 1005 #Try launching from recent applications window1006 if not matcher.group("launchplace") == "appmenu:":1007 kw = LongPressKey()1008 kw.initialize('home', self._target)1009 if not kw.execute():1010 return False1011 time.sleep(1)1012 kw = TapObject()1013 kw.initialize("'" + appname +"'", self._target)1014 if kw.execute():1015 return True1016 else:1017 self._target.getMonkeyDriver().sendPress('back')1018 1019 #Try launching from the application menu1020 if not matcher.group("launchplace") == "recent:":1021 1022 if not self._target.getMonkeyDriver().sendPress('home'):1023 return False1024 #TODO: Better solution?1025 time.sleep(1)1026 #TODO: Platform version dependant, Yuck!1027 appsButton = 'id/all_apps'1028 appsGrid = 'id/content'1029 1030 1031 if self._target.getMonkeyDriver().getPlatformVersion() == "2.2":1032 1033 appsButton = 'id/all_apps_button'1034 appsGrid = 'id/all_apps_2d_grid'1035 1036 ...
wp_models.py
Source:wp_models.py
1# This is an auto-generated Django model module.2# You'll have to do the following manually to clean this up:3# * Rearrange models' order4# * Make sure each model has one field with primary_key=True5# Feel free to rename the models, but don't rename db_table values or field names.6#7# Also note: You'll have to insert the output of 'django-admin.py sqlcustom [appname]'8# into your database.9from __future__ import unicode_literals10from django.db import models11class WpCommentmeta(models.Model):12 meta_id = models.BigIntegerField(primary_key=True)13 comment_id = models.BigIntegerField()14 meta_key = models.CharField(max_length=255L, blank=True)15 meta_value = models.TextField(blank=True)16 class Meta:17 db_table = 'wp_commentmeta'18class WpComments(models.Model):19 comment_id = models.BigIntegerField(primary_key=True, db_column='comment_ID') # Field name made lowercase.20 comment_post_id = models.BigIntegerField(db_column='comment_post_ID') # Field name made lowercase.21 comment_author = models.TextField()22 comment_author_email = models.CharField(max_length=100L)23 comment_author_url = models.CharField(max_length=200L)24 comment_author_ip = models.CharField(max_length=100L, db_column='comment_author_IP') # Field name made lowercase.25 comment_date = models.DateTimeField()26 comment_date_gmt = models.DateTimeField()27 comment_content = models.TextField()28 comment_karma = models.IntegerField()29 comment_approved = models.CharField(max_length=20L)30 comment_agent = models.CharField(max_length=255L)31 comment_type = models.CharField(max_length=20L)32 comment_parent = models.BigIntegerField()33 user_id = models.BigIntegerField()34 class Meta:35 db_table = 'wp_comments'36class WpFrontendBuilderOptions(models.Model):37 id = models.IntegerField(primary_key=True)38 name = models.TextField()39 value = models.TextField()40 class Meta:41 db_table = 'wp_frontend_builder_options'42class WpFrontendBuilderPages(models.Model):43 id = models.IntegerField(primary_key=True)44 switch = models.TextField()45 layout = models.TextField()46 items = models.TextField()47 class Meta:48 db_table = 'wp_frontend_builder_pages'49class WpLinks(models.Model):50 link_id = models.BigIntegerField(primary_key=True)51 link_url = models.CharField(max_length=255L)52 link_name = models.CharField(max_length=255L)53 link_image = models.CharField(max_length=255L)54 link_target = models.CharField(max_length=25L)55 link_description = models.CharField(max_length=255L)56 link_visible = models.CharField(max_length=20L)57 link_owner = models.BigIntegerField()58 link_rating = models.IntegerField()59 link_updated = models.DateTimeField()60 link_rel = models.CharField(max_length=255L)61 link_notes = models.TextField()62 link_rss = models.CharField(max_length=255L)63 class Meta:64 db_table = 'wp_links'65class WpOptions(models.Model):66 option_id = models.BigIntegerField(primary_key=True)67 option_name = models.CharField(max_length=64L, unique=True)68 option_value = models.TextField()69 autoload = models.CharField(max_length=20L)70 class Meta:71 db_table = 'wp_options'72class WpPostmeta(models.Model):73 meta_id = models.BigIntegerField(primary_key=True)74 post_id = models.BigIntegerField()75 meta_key = models.CharField(max_length=255L, blank=True)76 meta_value = models.TextField(blank=True)77 class Meta:78 db_table = 'wp_postmeta'79class WpPosts(models.Model):80 id = models.BigIntegerField(primary_key=True, db_column='ID') # Field name made lowercase.81 post_author = models.BigIntegerField()82 post_date = models.DateTimeField()83 post_date_gmt = models.DateTimeField()84 post_content = models.TextField()85 post_title = models.TextField()86 post_excerpt = models.TextField()87 post_status = models.CharField(max_length=20L)88 comment_status = models.CharField(max_length=20L)89 ping_status = models.CharField(max_length=20L)90 post_password = models.CharField(max_length=20L)91 post_name = models.CharField(max_length=200L)92 to_ping = models.TextField()93 pinged = models.TextField()94 post_modified = models.DateTimeField()95 post_modified_gmt = models.DateTimeField()96 post_content_filtered = models.TextField()97 post_parent = models.BigIntegerField()98 guid = models.CharField(max_length=255L)99 menu_order = models.IntegerField()100 post_type = models.CharField(max_length=20L)101 post_mime_type = models.CharField(max_length=100L)102 comment_count = models.BigIntegerField()103 class Meta:104 db_table = 'wp_posts'105class WpRevsliderCss(models.Model):106 id = models.IntegerField(primary_key=True)107 handle = models.TextField()108 settings = models.TextField(blank=True)109 hover = models.TextField(blank=True)110 params = models.TextField()111 class Meta:112 db_table = 'wp_revslider_css'113class WpRevsliderLayerAnimations(models.Model):114 id = models.IntegerField(primary_key=True)115 handle = models.TextField()116 params = models.TextField()117 class Meta:118 db_table = 'wp_revslider_layer_animations'119class WpRevsliderSettings(models.Model):120 id = models.IntegerField(primary_key=True)121 general = models.TextField()122 params = models.TextField()123 class Meta:124 db_table = 'wp_revslider_settings'125class WpRevsliderSliders(models.Model):126 id = models.IntegerField(primary_key=True)127 title = models.TextField()128 alias = models.TextField(blank=True)129 params = models.TextField()130 class Meta:131 db_table = 'wp_revslider_sliders'132class WpRevsliderSlides(models.Model):133 id = models.IntegerField(primary_key=True)134 slider_id = models.IntegerField()135 slide_order = models.IntegerField()136 params = models.TextField()137 layers = models.TextField()138 class Meta:139 db_table = 'wp_revslider_slides'140class WpSendpressListSubscribers(models.Model):141 id = models.IntegerField(primary_key=True)142 listid = models.IntegerField(null=True, db_column='listID', blank=True) # Field name made lowercase.143 subscriberid = models.IntegerField(null=True, db_column='subscriberID', blank=True) # Field name made lowercase.144 status = models.IntegerField(null=True, blank=True)145 updated = models.DateTimeField()146 class Meta:147 db_table = 'wp_sendpress_list_subscribers'148class WpSendpressQueue(models.Model):149 id = models.IntegerField(primary_key=True)150 subscriberid = models.IntegerField(null=True, db_column='subscriberID', blank=True) # Field name made lowercase.151 listid = models.IntegerField(null=True, db_column='listID', blank=True) # Field name made lowercase.152 from_name = models.CharField(max_length=64L, blank=True)153 from_email = models.CharField(max_length=128L)154 to_email = models.CharField(max_length=128L)155 subject = models.CharField(max_length=255L)156 messageid = models.CharField(max_length=400L, db_column='messageID') # Field name made lowercase.157 emailid = models.IntegerField(db_column='emailID') # Field name made lowercase.158 max_attempts = models.IntegerField()159 attempts = models.IntegerField()160 success = models.IntegerField()161 date_published = models.DateTimeField()162 inprocess = models.IntegerField(null=True, blank=True)163 last_attempt = models.DateTimeField()164 date_sent = models.DateTimeField()165 class Meta:166 db_table = 'wp_sendpress_queue'167class WpSendpressReportUrl(models.Model):168 urlid = models.IntegerField(primary_key=True, db_column='urlID') # Field name made lowercase.169 url = models.CharField(max_length=2000L, blank=True)170 reportid = models.IntegerField(null=True, db_column='reportID', blank=True) # Field name made lowercase.171 class Meta:172 db_table = 'wp_sendpress_report_url'173class WpSendpressSubscribers(models.Model):174 subscriberid = models.BigIntegerField(primary_key=True, db_column='subscriberID') # Field name made lowercase.175 email = models.CharField(max_length=100L, unique=True)176 join_date = models.DateTimeField()177 status = models.IntegerField()178 registered = models.DateTimeField()179 registered_ip = models.CharField(max_length=20L)180 identity_key = models.CharField(max_length=60L, unique=True)181 bounced = models.IntegerField()182 firstname = models.CharField(max_length=250L)183 lastname = models.CharField(max_length=250L)184 wp_user_id = models.BigIntegerField(unique=True, null=True, blank=True)185 class Meta:186 db_table = 'wp_sendpress_subscribers'187class WpSendpressSubscribersEvent(models.Model):188 eventid = models.IntegerField(primary_key=True, db_column='eventID') # Field name made lowercase.189 subscriberid = models.IntegerField(db_column='subscriberID') # Field name made lowercase.190 reportid = models.IntegerField(null=True, db_column='reportID', blank=True) # Field name made lowercase.191 urlid = models.IntegerField(null=True, db_column='urlID', blank=True) # Field name made lowercase.192 listid = models.IntegerField(null=True, db_column='listID', blank=True) # Field name made lowercase.193 eventdate = models.DateTimeField()194 ip = models.CharField(max_length=400L, blank=True)195 devicetype = models.CharField(max_length=50L, blank=True)196 device = models.CharField(max_length=50L, blank=True)197 type = models.CharField(max_length=50L, blank=True)198 class Meta:199 db_table = 'wp_sendpress_subscribers_event'200class WpSendpressSubscribersMeta(models.Model):201 smeta_id = models.BigIntegerField(primary_key=True)202 subscriberid = models.BigIntegerField(db_column='subscriberID') # Field name made lowercase.203 listid = models.BigIntegerField(null=True, db_column='listID', blank=True) # Field name made lowercase.204 meta_key = models.CharField(max_length=255L, blank=True)205 meta_value = models.TextField(blank=True)206 class Meta:207 db_table = 'wp_sendpress_subscribers_meta'208class WpSendpressSubscribersStatus(models.Model):209 statusid = models.IntegerField(primary_key=True)210 status = models.CharField(max_length=255L, blank=True)211 class Meta:212 db_table = 'wp_sendpress_subscribers_status'213class WpTermRelationships(models.Model):214 object_id = models.BigIntegerField(primary_key=True)215 term_taxonomy_id = models.BigIntegerField()216 term_order = models.IntegerField()217 class Meta:218 db_table = 'wp_term_relationships'219class WpTermTaxonomy(models.Model):220 term_taxonomy_id = models.BigIntegerField(primary_key=True)221 term_id = models.BigIntegerField()222 taxonomy = models.CharField(max_length=32L)223 description = models.TextField()224 parent = models.BigIntegerField()225 count = models.BigIntegerField()226 class Meta:227 db_table = 'wp_term_taxonomy'228class WpTerms(models.Model):229 term_id = models.BigIntegerField(primary_key=True)230 name = models.CharField(max_length=200L)231 slug = models.CharField(max_length=200L, unique=True)232 term_group = models.BigIntegerField()233 class Meta:234 db_table = 'wp_terms'235class WpUsermeta(models.Model):236 umeta_id = models.BigIntegerField(primary_key=True)237 user_id = models.BigIntegerField()238 meta_key = models.CharField(max_length=255L, blank=True)239 meta_value = models.TextField(blank=True)240 class Meta:241 db_table = 'wp_usermeta'242class WpUsers(models.Model):243 id = models.BigIntegerField(primary_key=True, db_column='ID') # Field name made lowercase.244 user_login = models.CharField(max_length=60L)245 user_pass = models.CharField(max_length=64L)246 user_nicename = models.CharField(max_length=50L)247 user_email = models.CharField(max_length=100L)248 user_url = models.CharField(max_length=100L)249 user_registered = models.DateTimeField()250 user_activation_key = models.CharField(max_length=60L)251 user_status = models.IntegerField()252 display_name = models.CharField(max_length=250L)253 class Meta:254 db_table = 'wp_users'255class WpWoocommerceAttributeTaxonomies(models.Model):256 attribute_id = models.BigIntegerField(primary_key=True)257 attribute_name = models.CharField(max_length=200L)258 attribute_label = models.TextField(blank=True)259 attribute_type = models.CharField(max_length=200L)260 attribute_orderby = models.CharField(max_length=200L)261 class Meta:262 db_table = 'wp_woocommerce_attribute_taxonomies'263class WpWoocommerceDownloadableProductPermissions(models.Model):264 download_id = models.CharField(max_length=32L)265 product_id = models.BigIntegerField()266 order_id = models.BigIntegerField()267 order_key = models.CharField(max_length=200L)268 user_email = models.CharField(max_length=200L)269 user_id = models.BigIntegerField(null=True, blank=True)270 downloads_remaining = models.CharField(max_length=9L, blank=True)271 access_granted = models.DateTimeField()272 access_expires = models.DateTimeField(null=True, blank=True)273 download_count = models.BigIntegerField()274 class Meta:275 db_table = 'wp_woocommerce_downloadable_product_permissions'276class WpWoocommerceOrderItemmeta(models.Model):277 meta_id = models.BigIntegerField(primary_key=True)278 order_item_id = models.BigIntegerField()279 meta_key = models.CharField(max_length=255L, blank=True)280 meta_value = models.TextField(blank=True)281 class Meta:282 db_table = 'wp_woocommerce_order_itemmeta'283class WpWoocommerceOrderItems(models.Model):284 order_item_id = models.BigIntegerField(primary_key=True)285 order_item_name = models.TextField()286 order_item_type = models.CharField(max_length=200L)287 order_id = models.BigIntegerField()288 class Meta:289 db_table = 'wp_woocommerce_order_items'290class WpWoocommerceTaxRateLocations(models.Model):291 location_id = models.BigIntegerField(primary_key=True)292 location_code = models.CharField(max_length=255L)293 tax_rate_id = models.BigIntegerField()294 location_type = models.CharField(max_length=40L)295 class Meta:296 db_table = 'wp_woocommerce_tax_rate_locations'297class WpWoocommerceTaxRates(models.Model):298 tax_rate_id = models.BigIntegerField(primary_key=True)299 tax_rate_country = models.CharField(max_length=200L)300 tax_rate_state = models.CharField(max_length=200L)301 tax_rate = models.CharField(max_length=200L)302 tax_rate_name = models.CharField(max_length=200L)303 tax_rate_priority = models.BigIntegerField()304 tax_rate_compound = models.IntegerField()305 tax_rate_shipping = models.IntegerField()306 tax_rate_order = models.BigIntegerField()307 tax_rate_class = models.CharField(max_length=200L)308 class Meta:309 db_table = 'wp_woocommerce_tax_rates'310class WpWoocommerceTermmeta(models.Model):311 meta_id = models.BigIntegerField(primary_key=True)312 woocommerce_term_id = models.BigIntegerField()313 meta_key = models.CharField(max_length=255L, blank=True)314 meta_value = models.TextField(blank=True)315 class Meta:316 db_table = 'wp_woocommerce_termmeta'317class WpYopPollAnswermeta(models.Model):318 meta_id = models.IntegerField(primary_key=True)319 yop_poll_answer_id = models.IntegerField()320 meta_key = models.CharField(max_length=255L)321 meta_value = models.TextField()322 class Meta:323 db_table = 'wp_yop_poll_answermeta'324class WpYopPollAnswers(models.Model):325 id = models.IntegerField(primary_key=True)326 poll_id = models.IntegerField()327 answer = models.CharField(max_length=255L)328 type = models.CharField(max_length=7L)329 votes = models.IntegerField()330 status = models.CharField(max_length=255L)331 class Meta:332 db_table = 'wp_yop_poll_answers'333class WpYopPollBans(models.Model):334 id = models.IntegerField(primary_key=True)335 poll_id = models.IntegerField()336 type = models.CharField(max_length=255L)337 value = models.CharField(max_length=255L)338 class Meta:339 db_table = 'wp_yop_poll_bans'340class WpYopPollCustomFields(models.Model):341 id = models.IntegerField(primary_key=True)342 poll_id = models.IntegerField()343 custom_field = models.CharField(max_length=255L)344 required = models.CharField(max_length=3L)345 status = models.CharField(max_length=255L)346 class Meta:347 db_table = 'wp_yop_poll_custom_fields'348class WpYopPollFacebookUsers(models.Model):349 id = models.IntegerField(primary_key=True)350 fb_id = models.CharField(max_length=255L)351 name = models.CharField(max_length=255L)352 first_name = models.CharField(max_length=255L)353 last_name = models.CharField(max_length=255L)354 username = models.CharField(max_length=255L)355 email = models.CharField(max_length=255L)356 gender = models.CharField(max_length=255L)357 date_added = models.DateTimeField()358 class Meta:359 db_table = 'wp_yop_poll_facebook_users'360class WpYopPollLogs(models.Model):361 id = models.IntegerField(primary_key=True)362 poll_id = models.IntegerField()363 vote_id = models.CharField(max_length=255L)364 answer_id = models.IntegerField()365 ip = models.CharField(max_length=100L)366 user_id = models.IntegerField()367 user_type = models.CharField(max_length=9L)368 http_referer = models.CharField(max_length=255L)369 tr_id = models.CharField(max_length=255L)370 other_answer_value = models.TextField()371 host = models.CharField(max_length=200L)372 vote_date = models.DateTimeField()373 class Meta:374 db_table = 'wp_yop_poll_logs'375class WpYopPollTemplates(models.Model):376 id = models.IntegerField(primary_key=True)377 template_author = models.BigIntegerField()378 name = models.CharField(max_length=255L)379 before_vote_template = models.TextField()380 after_vote_template = models.TextField()381 before_start_date_template = models.TextField()382 after_end_date_template = models.TextField()383 css = models.TextField()384 js = models.TextField()385 status = models.CharField(max_length=255L)386 last_modified = models.DateTimeField()387 date_added = models.DateTimeField()388 class Meta:389 db_table = 'wp_yop_poll_templates'390class WpYopPollVoters(models.Model):391 id = models.IntegerField(primary_key=True)392 poll_id = models.IntegerField()393 user_id = models.IntegerField()394 user_type = models.CharField(max_length=9L)395 class Meta:396 db_table = 'wp_yop_poll_voters'397class WpYopPollVotesCustomFields(models.Model):398 id = models.IntegerField(primary_key=True)399 poll_id = models.IntegerField()400 vote_id = models.CharField(max_length=255L)401 custom_field_id = models.IntegerField()402 user_id = models.IntegerField()403 user_type = models.CharField(max_length=9L)404 custom_field_value = models.TextField()405 tr_id = models.CharField(max_length=255L)406 vote_date = models.DateTimeField()407 class Meta:408 db_table = 'wp_yop_poll_votes_custom_fields'409class WpYopPollmeta(models.Model):410 meta_id = models.IntegerField(primary_key=True)411 yop_poll_id = models.IntegerField()412 meta_key = models.CharField(max_length=255L)413 meta_value = models.TextField()414 class Meta:415 db_table = 'wp_yop_pollmeta'416class WpYopPolls(models.Model):417 id = models.IntegerField(primary_key=True)418 poll_author = models.BigIntegerField()419 name = models.CharField(max_length=255L)420 question = models.TextField()421 start_date = models.DateTimeField()422 end_date = models.DateTimeField()423 total_votes = models.IntegerField()424 total_answers = models.IntegerField()425 status = models.CharField(max_length=255L)426 last_modified = models.DateTimeField()427 date_added = models.DateTimeField()428 show_in_archive = models.CharField(max_length=3L)429 archive_order = models.IntegerField()430 class Meta:...
hubobj.py
Source:hubobj.py
1class hub(object):2 def GetNode(self, name, proxy):3 # return (Control Obj, Monitor Obj)4 pass5 def SendPress(self, ControlObj):6 pass # return success? there already is a SendCommand for OnOff nodes in ISY7 def SetSliderVal(self):8 pass9 def GetCurrentStatus(self, MonitorNode):...
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!