mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-28 15:53:55 -04:00
dtoolutil: Fix Filename division operator in Python 3
This commit is contained in:
parent
601ca323f5
commit
9d9337dc4d
@ -122,6 +122,7 @@ PUBLISHED:
|
|||||||
INLINE Filename operator + (const std::string &other) const;
|
INLINE Filename operator + (const std::string &other) const;
|
||||||
|
|
||||||
INLINE Filename operator / (const Filename &other) const;
|
INLINE Filename operator / (const Filename &other) const;
|
||||||
|
EXTENSION(Filename __truediv__(const Filename &other) const);
|
||||||
|
|
||||||
// Or, you can use any of these.
|
// Or, you can use any of these.
|
||||||
INLINE std::string get_fullpath() const;
|
INLINE std::string get_fullpath() const;
|
||||||
|
@ -184,6 +184,15 @@ __fspath__() const {
|
|||||||
return PyUnicode_FromWideChar(filename.data(), (Py_ssize_t)filename.size());
|
return PyUnicode_FromWideChar(filename.data(), (Py_ssize_t)filename.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a new Filename that is composed of the other filename added to the
|
||||||
|
* end of this filename, with an intervening slash added if necessary.
|
||||||
|
*/
|
||||||
|
Filename Extension<Filename>::
|
||||||
|
__truediv__(const Filename &other) const {
|
||||||
|
return Filename(*_this, other);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This variant on scan_directory returns a Python list of strings on success,
|
* This variant on scan_directory returns a Python list of strings on success,
|
||||||
* or None on failure.
|
* or None on failure.
|
||||||
|
@ -34,6 +34,9 @@ public:
|
|||||||
PyObject *__reduce__(PyObject *self) const;
|
PyObject *__reduce__(PyObject *self) const;
|
||||||
PyObject *__repr__() const;
|
PyObject *__repr__() const;
|
||||||
PyObject *__fspath__() const;
|
PyObject *__fspath__() const;
|
||||||
|
|
||||||
|
Filename __truediv__(const Filename &other) const;
|
||||||
|
|
||||||
PyObject *scan_directory() const;
|
PyObject *scan_directory() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user