mirror of
https://github.com/platformio/platformio-core.git
synced 2025-09-27 06:20:54 +02:00
Implement app.get_project_id()
This commit is contained in:
@@ -258,6 +258,10 @@ def get_cid():
|
|||||||
return cid
|
return cid
|
||||||
|
|
||||||
|
|
||||||
|
def get_project_id(project_dir):
|
||||||
|
return hashlib.sha1(hashlib_encode_data(project_dir)).hexdigest()
|
||||||
|
|
||||||
|
|
||||||
def get_user_agent():
|
def get_user_agent():
|
||||||
data = [
|
data = [
|
||||||
"PlatformIO/%s" % __version__,
|
"PlatformIO/%s" % __version__,
|
||||||
|
@@ -13,7 +13,6 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import atexit
|
import atexit
|
||||||
import hashlib
|
|
||||||
import os
|
import os
|
||||||
import queue
|
import queue
|
||||||
import re
|
import re
|
||||||
@@ -27,7 +26,6 @@ import requests
|
|||||||
|
|
||||||
from platformio import __title__, __version__, app, exception, fs, util
|
from platformio import __title__, __version__, app, exception, fs, util
|
||||||
from platformio.cli import PlatformioCLI
|
from platformio.cli import PlatformioCLI
|
||||||
from platformio.compat import hashlib_encode_data
|
|
||||||
from platformio.debug.config.base import DebugConfigBase
|
from platformio.debug.config.base import DebugConfigBase
|
||||||
from platformio.http import HTTPSession, ensure_internet_on
|
from platformio.http import HTTPSession, ensure_internet_on
|
||||||
from platformio.proc import is_ci
|
from platformio.proc import is_ci
|
||||||
@@ -220,7 +218,7 @@ def dump_project_env_params(config, env, platform):
|
|||||||
for option in non_sensitive_data
|
for option in non_sensitive_data
|
||||||
if config.has_option(section, option)
|
if config.has_option(section, option)
|
||||||
}
|
}
|
||||||
params["pid"] = hashlib.sha1(hashlib_encode_data(config.path)).hexdigest()
|
params["pid"] = app.get_project_id(os.path.dirname(config.path))
|
||||||
params["platform_name"] = platform.name
|
params["platform_name"] = platform.name
|
||||||
params["platform_version"] = platform.version
|
params["platform_version"] = platform.version
|
||||||
return params
|
return params
|
||||||
|
Reference in New Issue
Block a user