Skip to content

Commit

Permalink
Makes __version__ attribute consistent throughout
Browse files Browse the repository at this point in the history
* Makes __version__ attribute in watchdog/version.py
  a version tuple and updates references to it
  in the documentation.
* Defines the __version__ attribute string as a
  preprocessor constant in the _watchdog_fsevents.h
  header file.

Signed-off-by: Gora Khargosh <gora.khargosh@gmail.com>
  • Loading branch information
gorakhargosh committed Dec 29, 2010
1 parent 7f4edb0 commit 1c87679
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@
# built documents.
#
# The short X.Y version.
version = watchdog.version.__version__
version = watchdog.version.VERSION_STRING
# The full version, including alpha/beta/rc tags.
release = watchdog.version.__version__
release = watchdog.version.VERSION_STRING

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
4 changes: 2 additions & 2 deletions src/_watchdog_fsevents.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ init_watchdog_fsevents(void)
MODULE_CONSTANT_NAME_POLLOUT,
kCFFileDescriptorWriteCallBack);
PyModule_AddObject(module,
"__version__",
MODULE_ATTRIBUTE_NAME_VERSION,
Py_BuildValue("(iii)",
WATCHDOG_VERSION_MAJOR,
WATCHDOG_VERSION_MINOR,
Expand Down Expand Up @@ -258,7 +258,7 @@ PyInit__watchdog_fsevents(void)
MODULE_CONSTANT_NAME_POLLOUT,
kCFFileDescriptorWriteCallBack);
PyModule_AddObject(module,
"__version__",
MODULE_ATTRIBUTE_NAME_VERSION,
Py_BuildValue("(iii)",
WATCHDOG_VERSION_MAJOR,
WATCHDOG_VERSION_MINOR,
Expand Down
1 change: 1 addition & 0 deletions src/_watchdog_fsevents.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ typedef int Py_ssize_t;
#define MODULE_NAME "_watchdog_fsevents"
#define MODULE_CONSTANT_NAME_POLLIN "POLLIN"
#define MODULE_CONSTANT_NAME_POLLOUT "POLLOUT"
#define MODULE_ATTRIBUTE_NAME_VERSION "__version__"

/**
* An information structure that is passed to the callback function registered
Expand Down
2 changes: 1 addition & 1 deletion src/watchdog/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
VERSION_INFO = (VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD)
VERSION_STRING = "%d.%d.%d" % VERSION_INFO

__version__ = VERSION_STRING
__version__ = VERSION_INFO

0 comments on commit 1c87679

Please sign in to comment.