PEP-7: function name in column 1

http://www.python.org/dev/peps/pep-0007/#code-lay-out
This commit is contained in:
J. David Ibáñez
2013-12-02 16:34:30 +01:00
parent 87724370d9
commit d7196e7794
5 changed files with 28 additions and 14 deletions

View File

@@ -89,7 +89,8 @@ PyDoc_STRVAR(Branch_rename__doc__,
"checked for validity.\n" "checked for validity.\n"
"Returns the new branch."); "Returns the new branch.");
PyObject* Branch_rename(Branch *self, PyObject *args) PyObject *
Branch_rename(Branch *self, PyObject *args)
{ {
int err, force = 0; int err, force = 0;
git_reference *c_out; git_reference *c_out;
@@ -111,7 +112,8 @@ PyObject* Branch_rename(Branch *self, PyObject *args)
PyDoc_STRVAR(Branch_branch_name__doc__, PyDoc_STRVAR(Branch_branch_name__doc__,
"The name of the local or remote branch."); "The name of the local or remote branch.");
PyObject* Branch_branch_name__get__(Branch *self) PyObject *
Branch_branch_name__get__(Branch *self)
{ {
int err; int err;
const char *c_name; const char *c_name;
@@ -129,7 +131,8 @@ PyObject* Branch_branch_name__get__(Branch *self)
PyDoc_STRVAR(Branch_remote_name__doc__, PyDoc_STRVAR(Branch_remote_name__doc__,
"The name of the remote that the remote tracking branch belongs to."); "The name of the remote that the remote tracking branch belongs to.");
PyObject* Branch_remote_name__get__(Branch *self) PyObject *
Branch_remote_name__get__(Branch *self)
{ {
int err; int err;
const char *branch_name; const char *branch_name;
@@ -168,7 +171,8 @@ PyDoc_STRVAR(Branch_upstream__doc__,
"The branch supporting the remote tracking branch or None if this is not a " "The branch supporting the remote tracking branch or None if this is not a "
"remote tracking branch. Set to None to unset."); "remote tracking branch. Set to None to unset.");
PyObject* Branch_upstream__get__(Branch *self) PyObject *
Branch_upstream__get__(Branch *self)
{ {
int err; int err;
git_reference *c_reference; git_reference *c_reference;
@@ -218,7 +222,8 @@ int Branch_upstream__set__(Branch *self, Reference *py_ref)
PyDoc_STRVAR(Branch_upstream_name__doc__, PyDoc_STRVAR(Branch_upstream_name__doc__,
"The name of the reference supporting the remote tracking branch."); "The name of the reference supporting the remote tracking branch.");
PyObject* Branch_upstream_name__get__(Branch *self) PyObject *
Branch_upstream_name__get__(Branch *self)
{ {
int err; int err;
const char *branch_name; const char *branch_name;

View File

@@ -29,7 +29,8 @@
PyObject *GitError; PyObject *GitError;
PyObject * Error_type(int type) PyObject *
Error_type(int type)
{ {
const git_error* error; const git_error* error;
/* Expected */ /* Expected */
@@ -79,14 +80,16 @@ PyObject * Error_type(int type)
} }
PyObject* Error_set(int err) PyObject *
Error_set(int err)
{ {
assert(err < 0); assert(err < 0);
return Error_set_exc(Error_type(err)); return Error_set_exc(Error_type(err));
} }
PyObject* Error_set_exc(PyObject* exception) PyObject *
Error_set_exc(PyObject* exception)
{ {
const git_error* error = giterr_last(); const git_error* error = giterr_last();
char* message = (error == NULL) ? char* message = (error == NULL) ?
@@ -97,7 +100,8 @@ PyObject* Error_set_exc(PyObject* exception)
} }
PyObject* Error_set_str(int err, const char *str) PyObject *
Error_set_str(int err, const char *str)
{ {
const git_error* error; const git_error* error;
if (err == GIT_ENOTFOUND) { if (err == GIT_ENOTFOUND) {
@@ -113,7 +117,8 @@ PyObject* Error_set_str(int err, const char *str)
return PyErr_Format(Error_type(err), "%s: %s", str, error->message); return PyErr_Format(Error_type(err), "%s: %s", str, error->message);
} }
PyObject* Error_set_oid(int err, const git_oid *oid, size_t len) PyObject *
Error_set_oid(int err, const git_oid *oid, size_t len)
{ {
char hex[GIT_OID_HEXSZ + 1]; char hex[GIT_OID_HEXSZ + 1];

View File

@@ -49,7 +49,8 @@ void RefLogIter_dealloc(RefLogIter *self)
PyObject_Del(self); PyObject_Del(self);
} }
PyObject* RefLogIter_iternext(RefLogIter *self) PyObject *
RefLogIter_iternext(RefLogIter *self)
{ {
const git_reflog_entry *entry; const git_reflog_entry *entry;
RefLogEntry *py_entry; RefLogEntry *py_entry;

View File

@@ -96,7 +96,8 @@ Remote_name__set__(Remote *self, PyObject* py_name)
} }
PyObject * get_pylist_from_git_strarray(git_strarray *strarray) PyObject *
get_pylist_from_git_strarray(git_strarray *strarray)
{ {
int index; int index;
PyObject *new_list; PyObject *new_list;

View File

@@ -866,7 +866,8 @@ PyDoc_STRVAR(Repository_create_branch__doc__,
"\n" "\n"
" repo.create_branch('foo', repo.head.hex, force=False)"); " repo.create_branch('foo', repo.head.hex, force=False)");
PyObject* Repository_create_branch(Repository *self, PyObject *args) PyObject *
Repository_create_branch(Repository *self, PyObject *args)
{ {
Commit *py_commit; Commit *py_commit;
git_reference *c_reference; git_reference *c_reference;
@@ -1467,7 +1468,8 @@ PyDoc_STRVAR(Repository_blame__doc__,
"\n" "\n"
" repo.blame('foo.c', flags=GIT_BLAME_TRACK_COPIES_SAME_FILE)"); " repo.blame('foo.c', flags=GIT_BLAME_TRACK_COPIES_SAME_FILE)");
PyObject* Repository_blame(Repository *self, PyObject *args, PyObject *kwds) PyObject *
Repository_blame(Repository *self, PyObject *args, PyObject *kwds)
{ {
git_blame_options opts = GIT_BLAME_OPTIONS_INIT; git_blame_options opts = GIT_BLAME_OPTIONS_INIT;
git_blame *blame; git_blame *blame;