MCPcopy Create free account
hub / github.com/libgit2/pygit2 / Signature__repr__

Function Signature__repr__

src/signature.c:243–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

241}
242
243static PyObject *
244Signature__repr__(Signature *self)
245{
246 PyObject *name, *email, *encoding, *str;
247 name = to_unicode_safe(self->signature->name, self->encoding);
248 email = to_unicode_safe(self->signature->email, self->encoding);
249
250 if (self->encoding) {
251 encoding = to_unicode_safe(self->encoding, self->encoding);
252 } else {
253 encoding = Py_None;
254 Py_INCREF(Py_None);
255 }
256
257 assert(name);
258 assert(email);
259 assert(encoding);
260
261 str = PyUnicode_FromFormat(
262 "pygit2.Signature(%R, %R, %lld, %ld, %R)",
263 name,
264 email,
265 self->signature->when.time,
266 self->signature->when.offset,
267 encoding);
268 Py_DECREF(name);
269 Py_DECREF(email);
270 Py_DECREF(encoding);
271 return str;
272}
273
274
275PyDoc_STRVAR(Signature__doc__, "Signature.");

Callers

nothing calls this directly

Calls 1

to_unicode_safeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…