Jump to content


P4Python Label Views

P4Python Label

  • Please log in to reply
2 replies to this topic

#1 mlussier

mlussier

    Member

  • Members
  • PipPip
  • 19 posts

Posted 18 February 2014 - 04:16 PM

I am trying to set the View field of a label using P4Python:

label_name = 'test-label-view'
label_view = '//playground/...'
release_label = p4Instance.run_label('-o', label_name)[0]
release_label['View'] = label_view
release_label['Options'] = 'locked noautoreload'
release_label['Revision'] = '@' + changelist['change']
p4Instance.input = release_label # set the input for the next command to be the label
p4Instance.run_label('-i')

The label is successfully created, with all the proper settings, except for the View field, which is blank.  I also tried getting the newly created label and setting the view again:

release_label = p4Instance.fetch_label(label_name)
release_label['View'] = label_view
p4Instance.input = release_label # set the input for the next command to be the label
p4Instance.run_label('-i')

That was unsuccessful as well.  Am I missing something?  I can successfully set the view using P4V.

#2 P4Matt

P4Matt

    Advanced Member

  • Members
  • PipPipPip
  • 1383 posts

Posted 19 February 2014 - 12:19 AM

Try:

release_label['View'] = [label_view]

The view is an array of lines I believe.

#3 mlussier

mlussier

    Member

  • Members
  • PipPip
  • 19 posts

Posted 19 February 2014 - 03:30 PM

That works, thanks for the help!





Also tagged with one or more of these keywords: P4Python, Label

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users