Best Python code snippet using robotframework-androidlibrary_python
TouchTest.py
Source: TouchTest.py
1bl_info = {2 "name": "Touch Viewport",3 "blender": (2, 80, 0),4 "category": "View 3D",5}67import bpy8import mathutils910class TouchInput(bpy.types.Operator):11 bl_idname = "view3d.touch_view"12 bl_label = "Touch View"13 14 mode: bpy.props.EnumProperty(15 name="Mode", 16 description="Sets the viewport control type",17 items={18 ('ORBIT','rotate','Rotate the viewport'),19 ('PAN','pan','Move the viewport'),20 ('DOLLY','zoom','Zoom in/out the viewport')21 },22 default="ORBIT")2324 def execute(self, context):25 if self.mode == "ORBIT":26 bpy.ops.view3d.view_orbit(angle=self.delta.x/180, type="ORBITRIGHT")27 bpy.ops.view3d.view_orbit(angle=self.delta.y/180, type="ORBITUP")28 elif self.mode == "PAN":29 if self.delta.y > 0:30 bpy.ops.view3d.view_pan("INVOKE_REGION_WIN",type="PANUP")31 if self.delta.y < 0:32 bpy.ops.view3d.view_pan("INVOKE_REGION_WIN",type="PANDOWN")33 if self.delta.x > 0:34 bpy.ops.view3d.view_pan("INVOKE_REGION_WIN",type="PANRIGHT")35 if self.delta.x < 0:36 bpy.ops.view3d.view_pan("INVOKE_REGION_WIN",type="PANLEFT")37 elif self.mode == "DOLLY":38 bpy.ops.view3d.dolly()39 return {'FINISHED'}4041 def modal(self, context, event):42 if event.type == 'MOUSEMOVE': # Apply43 #print(event.id_data)44 self.delta.x = (event.mouse_prev_x - event.mouse_x)45 self.delta.y = (event.mouse_prev_y - event.mouse_y)46 self.execute(context)47 elif event.type == 'LEFTMOUSE' and event.value == 'RELEASE': # Confirm48 return {'FINISHED'}49 elif event.type == 'ESC': # Cancel\50 return {'CANCELLED'}51 elif event.type not in {'INBETWEEN_MOUSEMOVE', 'TIMER_REPORT'}:52 print(event.type, event.value)53 return {'RUNNING_MODAL'}5455 def invoke(self, context, event):56 self.delta = mathutils.Vector((0.0,0.0))57 self.mode = "PAN"58 self.execute(context)5960 context.window_manager.modal_handler_add(self)61 return {'RUNNING_MODAL'}62 63 @classmethod64 def poll(cls, context):65 return context.area.type == 'VIEW_3D' and context.region.type == 'WINDOW'6667addon_keymaps = []6869def register():70 bpy.utils.register_class(TouchInput)71 72 wm = bpy.context.window_manager73 km = wm.keyconfigs.addon.keymaps.new(name='', space_type='EMPTY')74 kmi = km.keymap_items.new('view3d.touch_view', 'LEFTMOUSE', 'PRESS')75 addon_keymaps.append((km, kmi))76 77 km = wm.keyconfigs.addon.keymaps.new(name='Sculpt', space_type='EMPTY')78 kmi = km.keymap_items.new('view3d.touch_view', 'LEFTMOUSE', 'PRESS')79 addon_keymaps.append((km, kmi))80 81 kmi = km.keymap_items.new('sculpt.brush_stroke', 'PEN', 'PRESS')82 kmi.properties.mode = "NORMAL"83 addon_keymaps.append((km, kmi))84 85 kmi = km.keymap_items.new('sculpt.brush_stroke', 'ERASER', 'PRESS')86 kmi.properties.mode = "INVERT"87 addon_keymaps.append((km, kmi))8889def unregister():90 bpy.utils.unregister_class(TouchInput)9192 for km, kmi in addon_keymaps:93 km.keymap_items.remove(kmi)94 addon_keymaps.clear()95 9697if __name__ == "__main__":
...
urls.py
Source: urls.py
1from django.conf import settings2from django.conf.urls import include, url3from django.conf.urls.static import static4from django.contrib import admin5from django.contrib.staticfiles.templatetags.staticfiles import static as static_url6from django.views.generic.base import RedirectView, TemplateView7admin.autodiscover()8favicon_view = RedirectView.as_view(url=static_url("qatrack_core/img/favicon.ico"), permanent=True)9touch_view = RedirectView.as_view(url=static_url("qatrack_core/img/apple-touch-icon.png"), permanent=True)10urlpatterns = [11 url(r'^$', TemplateView.as_view(template_name="homepage.html"), name="home"),12 url(r'^accounts/', include('qatrack.accounts.urls')),13 url(r'^qa/', include('qatrack.qa.urls')),14 url(r'^units/', include('qatrack.units.urls')),15 url(r'^core/', include('qatrack.qatrack_core.urls')),16 # Uncomment the next line to enable the admin:17 url(r'^admin/', include(admin.site.urls)),18 url(r'^favicon\.ico$', favicon_view),19 url(r'^apple-touch-icon\.png$', touch_view),20 # third party21 url(r'^', include('genericdropdown.urls')),22 url(r'^comments/', include('django_comments.urls')),23 url(r'^admin/dynamic_raw_id/', include('dynamic_raw_id.urls')),24 url(r'^api/', include('qatrack.api.urls')),25]26urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)27if settings.USE_SERVICE_LOG:28 urlpatterns += [url(r'^servicelog/', include('qatrack.service_log.urls'))]29if settings.USE_PARTS:30 urlpatterns += [url(r'^parts/', include('qatrack.parts.urls'))]31if settings.USE_ISSUES:32 urlpatterns += [url(r'^issues/', include('qatrack.issue_tracker.urls'))]33if settings.DEBUG:34 import debug_toolbar35 urlpatterns = [36 url(r'^__debug__/', include(debug_toolbar.urls)),...
Check out the latest blogs from LambdaTest on this topic:
When it comes to UI components, there are two versatile methods that we can use to build it for your website: either we can use prebuilt components from a well-known library or framework, or we can develop our UI components from scratch.
Even though several frameworks are available in the market for automation testing, Selenium is one of the most renowned open-source frameworks used by experts due to its numerous features and benefits.
The purpose of developing test cases is to ensure the application functions as expected for the customer. Test cases provide basic application documentation for every function, feature, and integrated connection. Test case development often detects defects in the design or missing requirements early in the development process. Additionally, well-written test cases provide internal documentation for all application processing. Test case development is an important part of determining software quality and keeping defects away from customers.
Building a website is all about keeping the user experience in mind. Ultimately, it’s about providing visitors with a mind-blowing experience so they’ll keep coming back. One way to ensure visitors have a great time on your site is to add some eye-catching text or image animations.
In addition to the four values, the Agile Manifesto contains twelve principles that are used as guides for all methodologies included under the Agile movement, such as XP, Scrum, and Kanban.
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!!