Publishing is about sharing, so let's have a look at how to publish something other than by printing.

import os
import datetime
import pyblish.api

class CollectUserDir(pyblish.api.ContextPlugin):
  order = 0

  def process(self, context):["userDir"] = os.path.expanduser("~")

class WriteTime(pyblish.api.ContextPlugin):
  order = 1

  def process(self, context):
    user_dir =["userDir"]
    destination_path = os.path.join(user_dir, "time.txt")

    print("Writing time to %s" % destination_path)
    with open(destination_path, "w") as f:
      f.write("The time is %s" %


import pyblish.util
# Writing time to C:\Users\marcus\Documents\time.txt

And here's what time.txt looks like.

The time is Thu Jan 21 16:34:58 2016

results matching ""

    No results matching ""