Cleanup: use "filepath" instead of "filename" for full paths

Reserve "filename" when only the name component is used.
This commit is contained in:
2022-03-24 16:33:32 +11:00
parent 5058c4b144
commit 4682a0882f
36 changed files with 196 additions and 191 deletions

View File

@@ -396,41 +396,41 @@ static PyObject *py_blf_shadow_offset(PyObject *UNUSED(self), PyObject *args)
}
PyDoc_STRVAR(py_blf_load_doc,
".. function:: load(filename)\n"
".. function:: load(filepath)\n"
"\n"
" Load a new font.\n"
"\n"
" :arg filename: the filename of the font.\n"
" :type filename: string\n"
" :arg filepath: the filepath of the font.\n"
" :type filepath: string\n"
" :return: the new font's fontid or -1 if there was an error.\n"
" :rtype: integer\n");
static PyObject *py_blf_load(PyObject *UNUSED(self), PyObject *args)
{
const char *filename;
const char *filepath;
if (!PyArg_ParseTuple(args, "s:blf.load", &filename)) {
if (!PyArg_ParseTuple(args, "s:blf.load", &filepath)) {
return NULL;
}
return PyLong_FromLong(BLF_load(filename));
return PyLong_FromLong(BLF_load(filepath));
}
PyDoc_STRVAR(py_blf_unload_doc,
".. function:: unload(filename)\n"
".. function:: unload(filepath)\n"
"\n"
" Unload an existing font.\n"
"\n"
" :arg filename: the filename of the font.\n"
" :type filename: string\n");
" :arg filepath: the filepath of the font.\n"
" :type filepath: string\n");
static PyObject *py_blf_unload(PyObject *UNUSED(self), PyObject *args)
{
const char *filename;
const char *filepath;
if (!PyArg_ParseTuple(args, "s:blf.unload", &filename)) {
if (!PyArg_ParseTuple(args, "s:blf.unload", &filepath)) {
return NULL;
}
BLF_unload(filename);
BLF_unload(filepath);
Py_RETURN_NONE;
}