This repository was archived by the owner on Dec 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 50
Disable telemetry for python file with vscode settings #143
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
499b232
adding .po file
99756aa
Merge branch 'dev' of https://github.com/microsoft/vscode-python-embe…
917f0f8
Merge branch 'dev' of https://github.com/microsoft/vscode-python-embe…
1892c02
Merge branch 'dev' of https://github.com/microsoft/vscode-python-embe…
7d26a83
Merge branch 'dev' of https://github.com/microsoft/vscode-python-embe…
d2664a0
adding a telemetry message
d246354
modifying telemetry in python
ecf41f1
impact pixelpy
636d849
changing telemetry in pixels
5a249d1
removed print statement
c8ca169
moving condition
436cbe7
moved telemetry to spwan
982f149
moved function to utils
957bcd6
excalate changed to telemetry class
d93ffb0
removed aikey
70a6783
removed coma
f401b87
removed comment
c4aed4a
Merge branch 'dev' of https://github.com/microsoft/vscode-python-embe…
28e5d83
Merge branch 'dev' into users/t-famoun/telemetry-updates
b88b250
solved typo issue
f388cb5
solved typo issue
37aff2f
Merge branch 'users/t-famoun/telemetry-updates' of https://github.com…
4747563
HOPEFULLY THE LAST one
47e9002
mergd with dev
FMounz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| from . import constants as CONSTANTS | ||
| from applicationinsights import TelemetryClient | ||
|
|
||
|
|
||
| class Telemetry: | ||
| def __init__(self): | ||
| # State of the telemetry | ||
| self.__enable_telemetry = True | ||
| self.telemetry_state = { | ||
| "DETECT_TAPS": False, | ||
| "TAPPED": False, | ||
| "RED_LED": False, | ||
| "ADJUST_THRESHOLD": False, | ||
| "PLAY_FILE": False, | ||
| "PLAY_TONE": False, | ||
| "START_TONE": False, | ||
| "STOP_TONE": False, | ||
| "PIXELS": False | ||
| } | ||
| self.telemetry_client = TelemetryClient('__AIKEY__') | ||
| self.extension_name = '__EXTENSIONNAME__' | ||
|
|
||
| def send_telemetry(self, event_name): | ||
| if self.__enable_telemetry and self.telemetry_available() and not self.telemetry_state[event_name]: | ||
| self.telemetry_client.track_event( | ||
| '{}/{}'.format(self.extension_name, CONSTANTS.TELEMETRY_EVENT_NAMES[event_name])) | ||
| self.telemetry_client.flush() | ||
| self.telemetry_state[event_name] = True | ||
|
|
||
| def telemetry_available(self): | ||
| return self.telemetry_client.context.instrumentation_key != '__AIKEY__' | ||
|
|
||
|
|
||
| telemetry_py = Telemetry() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.