File tree Expand file tree Collapse file tree
addons/source-python/packages/source-python/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222from core import core_logger
2323from core import SOURCE_ENGINE_BRANCH
2424from core .version import VERSION
25+ from core .version import GIT_COMMIT
2526# Engines
2627from engines .server import execute_server_command
2728from engines .server import queue_command_string
@@ -132,6 +133,7 @@ def print_info(info):
132133 result += '\n OS : {}' .format (platform .platform ())
133134 result += '\n Game : {}' .format (SOURCE_ENGINE_BRANCH )
134135 result += '\n SP version : {}' .format (VERSION )
136+ result += '\n Github commit : {}' .format (GIT_COMMIT )
135137 result += '\n Server plugins:'
136138 for index , plugin in enumerate (server_plugin_manager .loaded_plugins ):
137139 result += '\n {:02d}: {}' .format (index , plugin .name )
Original file line number Diff line number Diff line change 1616# >> ALL DECLARATION
1717# =============================================================================
1818__all__ = ('VERSION' ,
19+ 'GIT_COMMIT' ,
1920 'get_last_successful_build_number' ,
2021 'is_unversioned' ,
2122 )
2425# =============================================================================
2526# >> CONSTANTS
2627# =============================================================================
27- VERSION = 'unversioned'
28+ #: Version of the Source.Python intallation.
29+ VERSION = None
30+
31+ #: The Github commit this Source.Python version was built with.
32+ GIT_COMMIT = None
2833
2934LAST_SUCCESSFUL_BUILD_NUMBER_URL = (
3035 'http://builds.sourcepython.com/job/Source.Python' +
@@ -53,8 +58,13 @@ def get_last_successful_build_number(timeout=3):
5358
5459
5560def is_unversioned ():
56- """Return True if the current version is set to 'unversioned'.
61+ """Return ``True`` if this Source.Python installation has no version.
62+
63+ This can happen in multiple cases:
64+
65+ * This is an unofficial build (not a build from the build server).
66+ * The Python files have been updated directly from the repository.
5767
5868 :rtype: bool
5969 """
60- return VERSION == 'unversioned'
70+ return VERSION is None
You can’t perform that action at this time.
0 commit comments