From 28dd32070f7046c9cc70493219b17e5f87e0edfd Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 23 May 2015 14:23:55 +0300 Subject: [PATCH] Pass to API requests information about Continuous Integration system --- HISTORY.rst | 2 ++ platformio/util.py | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 5d03f055..0c0b5a3b 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,8 @@ Release History 2.0.1 (2015-??-??) ------------------ +* Pass to API requests information about Continuous Integration system. This + information will be used by PlatformIO-API. * Fixed bug with converting ``*.ino`` to ``*.cpp`` 2.0.0 (2015-05-22) diff --git a/platformio/util.py b/platformio/util.py index 6dbad199..94f3f93f 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -246,8 +246,11 @@ def get_logicaldisks(): def get_request_defheaders(): - return {"User-Agent": "PlatformIO/%s %s" % ( - __version__, requests.utils.default_user_agent())} + return {"User-Agent": "PlatformIO/%s CI/%d %s" % ( + __version__, + 1 if os.environ.get("CI", "").lower() == "true" else 0, + requests.utils.default_user_agent() + )} def get_api_result(path, params=None, data=None):