def save(self):
        tmp_path = self.path + '.tmp'
        with open(tmp_path, 'w') as f:
            f.write(json.dumps(self.body_labels.items()))
        os.rename(tmp_path, self.path)
def render(self, context):
        try:
            if self.params:
                params = template.Variable(self.params).resolve(context)
            else:
                params = {}

            # try matching an address string literal
            email_literal = self.email.strip().lower()
            if EMAIL_RE.match(email_literal):
                email = email_literal
            # treat as a variable
            else:
                email = template.Variable(self.email).resolve(context)
        except template.VariableDoesNotExist:
            return ''

        # now, we generate the gravatar url
        return _build_gravatar_url(email, params)