示例#1
0
 def setCurrentView(self, view, oldView=None):
   if view:
     self.currentView = view
     if oldView:
       viewHelpers.unmaskView(oldView)
     viewHelpers.maskView(self.currentView, 'red', '0.4')
     lldb.debugger.HandleCommand('po (id)' + view)
示例#2
0
 def setCurrentView(self, view, oldView=None):
   if view:
     self.currentView = view
     if oldView:
       viewHelpers.unmaskView(oldView)
     viewHelpers.maskView(self.currentView, 'red', '0.4')
     print fb.describeObject(view)
示例#3
0
 def setCurrentView(self, view, oldView=None):
     if view:
         self.currentView = view
         if oldView:
             viewHelpers.unmaskView(oldView)
         viewHelpers.maskView(self.currentView, 'red', '0.4')
         print(fb.describeObject(view))
示例#4
0
    def inputCallback(self, input):
        oldView = self.currentView

        if input == 'q':
            cmd = 'echo %s | tr -d "\n" | pbcopy' % oldView
            os.system(cmd)

            print(
                '\nI hope ' + oldView +
                ' was what you were looking for. I put it on your clipboard.')
            viewHelpers.unmaskView(oldView)
            self.keepRunning = False

        elif input == 'w':
            v = superviewOfView(self.currentView)
            if not v:
                print('There is no superview. Where are you trying to go?!')
            self.setCurrentView(v, oldView)
        elif input == 's':
            v = firstSubviewOfView(self.currentView)
            if not v:
                print('\nThe view has no subviews.\n')
            self.setCurrentView(v, oldView)
        elif input == 'd':
            v = nthSiblingOfView(self.currentView, -1)
            if v == oldView:
                print('\nThere are no sibling views to this view.\n')
            self.setCurrentView(v, oldView)
        elif input == 'a':
            v = nthSiblingOfView(self.currentView, 1)
            if v == oldView:
                print('\nThere are no sibling views to this view.\n')
            self.setCurrentView(v, oldView)
        elif input == 'p':
            recursionName = 'recursiveDescription'
            isMac = runtimeHelpers.isMacintoshArch()

            if isMac:
                recursionName = '_subtreeDescription'

            print(
                fb.describeObject('[(id){} {}]'.format(oldView,
                                                       recursionName)))
        else:
            print('\nI really have no idea what you meant by \'' + input +
                  '\'... =\\\n')
示例#5
0
    def inputCallback(self, input):
        oldView = self.currentView

        if input == "q":
            cmd = 'echo %s | tr -d "\n" | pbcopy' % oldView
            os.system(cmd)

            print(
                "\nI hope " + oldView +
                " was what you were looking for. I put it on your clipboard.")
            viewHelpers.unmaskView(oldView)
            self.keepRunning = False

        elif input == "w":
            v = superviewOfView(self.currentView)
            if not v:
                print("There is no superview. Where are you trying to go?!")
            self.setCurrentView(v, oldView)
        elif input == "s":
            v = firstSubviewOfView(self.currentView)
            if not v:
                print("\nThe view has no subviews.\n")
            self.setCurrentView(v, oldView)
        elif input == "d":
            v = nthSiblingOfView(self.currentView, -1)
            if v == oldView:
                print("\nThere are no sibling views to this view.\n")
            self.setCurrentView(v, oldView)
        elif input == "a":
            v = nthSiblingOfView(self.currentView, 1)
            if v == oldView:
                print("\nThere are no sibling views to this view.\n")
            self.setCurrentView(v, oldView)
        elif input == "p":
            recursionName = "recursiveDescription"
            isMac = runtimeHelpers.isMacintoshArch()

            if isMac:
                recursionName = "_subtreeDescription"

            print(
                fb.describeObject("[(id){} {}]".format(oldView,
                                                       recursionName)))
        else:
            print("\nI really have no idea what you meant by '" + input +
                  "'... =\\\n")
示例#6
0
  def inputCallback(self, input):
    oldView = self.currentView

    if input == 'q':
      cmd = 'echo %s | tr -d "\n" | pbcopy' % oldView
      os.system(cmd)

      print '\nI hope ' + oldView + ' was what you were looking for. I put it on your clipboard.'
      viewHelpers.unmaskView(oldView)
      self.keepRunning = False

    elif input == 'w':
      v = superviewOfView(self.currentView)
      if not v:
        print 'There is no superview. Where are you trying to go?!'
      self.setCurrentView(v, oldView)
    elif input == 's':
      v = firstSubviewOfView(self.currentView)
      if not v:
        print '\nThe view has no subviews.\n'
      self.setCurrentView(v, oldView)
    elif input == 'd':
      v = nthSiblingOfView(self.currentView, -1)
      if v == oldView:
        print '\nThere are no sibling views to this view.\n'
      self.setCurrentView(v, oldView)
    elif input == 'a':
      v = nthSiblingOfView(self.currentView, 1)
      if v == oldView:
        print '\nThere are no sibling views to this view.\n'
      self.setCurrentView(v, oldView)
    elif input == 'p':
      recusionName = 'recursiveDescription'
      isMac = runtimeHelpers.isMacintoshArch()

      if isMac:
        recursionName = '_subtreeDescription'

      lldb.debugger.HandleCommand('po [(id)' + oldView + ' ' + recusionName + ']')
    else:
      print '\nI really have no idea what you meant by \'' + input + '\'... =\\\n'
示例#7
0
 def run(self, args, options):
     viewOrLayer = fb.evaluateObjectExpression(args[0])
     viewHelpers.unmaskView(viewOrLayer)
示例#8
0
 def run(self, args, options):
   viewOrLayer = fb.evaluateObjectExpression(args[0])
   viewHelpers.unmaskView(viewOrLayer)