wsba-hockey 1.1.9__py3-none-any.whl → 1.2.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. wsba_hockey/tools/scraping.py +146 -170
  2. wsba_hockey/tools/utils/__init__.py +0 -1
  3. wsba_hockey/tools/utils/shared.py +14 -389
  4. wsba_hockey/tools/xg_model.py +6 -1
  5. wsba_hockey/wsba_main.py +47 -14
  6. {wsba_hockey-1.1.9.dist-info → wsba_hockey-1.2.1.dist-info}/METADATA +16 -15
  7. wsba_hockey-1.2.1.dist-info/RECORD +15 -0
  8. wsba_hockey/api/api/index.py +0 -162
  9. wsba_hockey/data_pipelines.py +0 -247
  10. wsba_hockey/evidence/weakside-breakout/node_modules/duckdb/vendor.py +0 -146
  11. wsba_hockey/evidence/weakside-breakout/node_modules/flatted/python/flatted.py +0 -149
  12. wsba_hockey/evidence/weakside-breakout/node_modules/flatted/python/test.py +0 -63
  13. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/gyp_main.py +0 -45
  14. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py +0 -367
  15. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py +0 -206
  16. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py +0 -1270
  17. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py +0 -1547
  18. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py +0 -59
  19. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py +0 -153
  20. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py +0 -271
  21. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py +0 -574
  22. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/__init__.py +0 -690
  23. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/common.py +0 -661
  24. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/common_test.py +0 -78
  25. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py +0 -165
  26. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py +0 -109
  27. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py +0 -55
  28. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.py +0 -0
  29. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py +0 -808
  30. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py +0 -1173
  31. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py +0 -1321
  32. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py +0 -120
  33. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py +0 -103
  34. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py +0 -464
  35. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py +0 -89
  36. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py +0 -58
  37. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py +0 -2714
  38. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py +0 -3981
  39. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py +0 -44
  40. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py +0 -2936
  41. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py +0 -55
  42. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py +0 -1394
  43. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py +0 -25
  44. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/input.py +0 -3130
  45. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/input_test.py +0 -98
  46. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py +0 -771
  47. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py +0 -1271
  48. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py +0 -174
  49. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py +0 -61
  50. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py +0 -374
  51. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py +0 -1939
  52. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py +0 -302
  53. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +0 -3197
  54. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py +0 -65
  55. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/test_gyp.py +0 -261
  56. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/tools/graphviz.py +0 -102
  57. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/tools/pretty_gyp.py +0 -156
  58. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/tools/pretty_sln.py +0 -181
  59. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/tools/pretty_vcproj.py +0 -339
  60. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/test/fixtures/test-charmap.py +0 -31
  61. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/update-gyp.py +0 -64
  62. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/gyp_main.py +0 -45
  63. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py +0 -367
  64. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py +0 -206
  65. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py +0 -1270
  66. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py +0 -1547
  67. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py +0 -59
  68. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py +0 -153
  69. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py +0 -271
  70. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py +0 -574
  71. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/__init__.py +0 -666
  72. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/common.py +0 -654
  73. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/common_test.py +0 -78
  74. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py +0 -165
  75. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py +0 -109
  76. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py +0 -55
  77. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.py +0 -0
  78. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py +0 -808
  79. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py +0 -1173
  80. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py +0 -1321
  81. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py +0 -120
  82. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py +0 -103
  83. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py +0 -464
  84. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py +0 -89
  85. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py +0 -58
  86. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py +0 -2518
  87. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py +0 -3978
  88. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py +0 -44
  89. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py +0 -2936
  90. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py +0 -55
  91. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py +0 -1394
  92. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py +0 -25
  93. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/input.py +0 -3137
  94. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/input_test.py +0 -98
  95. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py +0 -771
  96. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py +0 -1271
  97. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py +0 -174
  98. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py +0 -61
  99. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py +0 -374
  100. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py +0 -1939
  101. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py +0 -302
  102. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +0 -3197
  103. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py +0 -65
  104. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/setup.py +0 -42
  105. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/test_gyp.py +0 -260
  106. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/tools/graphviz.py +0 -102
  107. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/tools/pretty_gyp.py +0 -156
  108. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/tools/pretty_sln.py +0 -181
  109. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/tools/pretty_vcproj.py +0 -339
  110. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/test/fixtures/test-charmap.py +0 -31
  111. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/update-gyp.py +0 -46
  112. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/duos/app.py +0 -210
  113. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/duos/calc.py +0 -163
  114. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/game_stats/app.py +0 -401
  115. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/game_stats/name_fix.py +0 -47
  116. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/goalie/app.py +0 -101
  117. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/goalie/plot.py +0 -71
  118. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/goalie/rink_plot.py +0 -245
  119. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/heatmaps/app.py +0 -108
  120. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/heatmaps/plot.py +0 -95
  121. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/heatmaps/rink_plot.py +0 -245
  122. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/line-combos/app.py +0 -245
  123. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/line-combos/plot.py +0 -275
  124. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/line-combos/rink_plot.py +0 -245
  125. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/matchups/app.py +0 -145
  126. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/matchups/plot.py +0 -79
  127. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/matchups/rink_plot.py +0 -245
  128. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/pbp/app.py +0 -406
  129. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/pbp/plot.py +0 -79
  130. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/pbp/rink_plot.py +0 -245
  131. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/skater/app.py +0 -110
  132. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/skater/plot.py +0 -59
  133. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/skater/rink_plot.py +0 -245
  134. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/team_heatmaps/app.py +0 -103
  135. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/team_heatmaps/plot.py +0 -95
  136. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/team_heatmaps/rink_plot.py +0 -245
  137. wsba_hockey/flask/app.py +0 -77
  138. wsba_hockey/tools/utils/config.py +0 -14
  139. wsba_hockey/tools/utils/save_pages.py +0 -133
  140. wsba_hockey/workspace.py +0 -28
  141. wsba_hockey-1.1.9.dist-info/RECORD +0 -148
  142. {wsba_hockey-1.1.9.dist-info → wsba_hockey-1.2.1.dist-info}/WHEEL +0 -0
  143. {wsba_hockey-1.1.9.dist-info → wsba_hockey-1.2.1.dist-info}/licenses/LICENSE +0 -0
  144. {wsba_hockey-1.1.9.dist-info → wsba_hockey-1.2.1.dist-info}/top_level.txt +0 -0
@@ -1,59 +0,0 @@
1
- # Copyright (c) 2012 Google Inc. All rights reserved.
2
- # Use of this source code is governed by a BSD-style license that can be
3
- # found in the LICENSE file.
4
-
5
- """Visual Studio project reader/writer."""
6
-
7
- import gyp.easy_xml as easy_xml
8
-
9
-
10
- class Writer:
11
- """Visual Studio XML tool file writer."""
12
-
13
- def __init__(self, tool_file_path, name):
14
- """Initializes the tool file.
15
-
16
- Args:
17
- tool_file_path: Path to the tool file.
18
- name: Name of the tool file.
19
- """
20
- self.tool_file_path = tool_file_path
21
- self.name = name
22
- self.rules_section = ["Rules"]
23
-
24
- def AddCustomBuildRule(
25
- self, name, cmd, description, additional_dependencies, outputs, extensions
26
- ):
27
- """Adds a rule to the tool file.
28
-
29
- Args:
30
- name: Name of the rule.
31
- description: Description of the rule.
32
- cmd: Command line of the rule.
33
- additional_dependencies: other files which may trigger the rule.
34
- outputs: outputs of the rule.
35
- extensions: extensions handled by the rule.
36
- """
37
- rule = [
38
- "CustomBuildRule",
39
- {
40
- "Name": name,
41
- "ExecutionDescription": description,
42
- "CommandLine": cmd,
43
- "Outputs": ";".join(outputs),
44
- "FileExtensions": ";".join(extensions),
45
- "AdditionalDependencies": ";".join(additional_dependencies),
46
- },
47
- ]
48
- self.rules_section.append(rule)
49
-
50
- def WriteIfChanged(self):
51
- """Writes the tool file."""
52
- content = [
53
- "VisualStudioToolFile",
54
- {"Version": "8.00", "Name": self.name},
55
- self.rules_section,
56
- ]
57
- easy_xml.WriteXmlIfChanged(
58
- content, self.tool_file_path, encoding="Windows-1252"
59
- )
@@ -1,153 +0,0 @@
1
- # Copyright (c) 2012 Google Inc. All rights reserved.
2
- # Use of this source code is governed by a BSD-style license that can be
3
- # found in the LICENSE file.
4
-
5
- """Visual Studio user preferences file writer."""
6
-
7
- import os
8
- import re
9
- import socket # for gethostname
10
-
11
- import gyp.easy_xml as easy_xml
12
-
13
-
14
- # ------------------------------------------------------------------------------
15
-
16
-
17
- def _FindCommandInPath(command):
18
- """If there are no slashes in the command given, this function
19
- searches the PATH env to find the given command, and converts it
20
- to an absolute path. We have to do this because MSVS is looking
21
- for an actual file to launch a debugger on, not just a command
22
- line. Note that this happens at GYP time, so anything needing to
23
- be built needs to have a full path."""
24
- if "/" in command or "\\" in command:
25
- # If the command already has path elements (either relative or
26
- # absolute), then assume it is constructed properly.
27
- return command
28
- else:
29
- # Search through the path list and find an existing file that
30
- # we can access.
31
- paths = os.environ.get("PATH", "").split(os.pathsep)
32
- for path in paths:
33
- item = os.path.join(path, command)
34
- if os.path.isfile(item) and os.access(item, os.X_OK):
35
- return item
36
- return command
37
-
38
-
39
- def _QuoteWin32CommandLineArgs(args):
40
- new_args = []
41
- for arg in args:
42
- # Replace all double-quotes with double-double-quotes to escape
43
- # them for cmd shell, and then quote the whole thing if there
44
- # are any.
45
- if arg.find('"') != -1:
46
- arg = '""'.join(arg.split('"'))
47
- arg = '"%s"' % arg
48
-
49
- # Otherwise, if there are any spaces, quote the whole arg.
50
- elif re.search(r"[ \t\n]", arg):
51
- arg = '"%s"' % arg
52
- new_args.append(arg)
53
- return new_args
54
-
55
-
56
- class Writer:
57
- """Visual Studio XML user user file writer."""
58
-
59
- def __init__(self, user_file_path, version, name):
60
- """Initializes the user file.
61
-
62
- Args:
63
- user_file_path: Path to the user file.
64
- version: Version info.
65
- name: Name of the user file.
66
- """
67
- self.user_file_path = user_file_path
68
- self.version = version
69
- self.name = name
70
- self.configurations = {}
71
-
72
- def AddConfig(self, name):
73
- """Adds a configuration to the project.
74
-
75
- Args:
76
- name: Configuration name.
77
- """
78
- self.configurations[name] = ["Configuration", {"Name": name}]
79
-
80
- def AddDebugSettings(
81
- self, config_name, command, environment={}, working_directory=""
82
- ):
83
- """Adds a DebugSettings node to the user file for a particular config.
84
-
85
- Args:
86
- command: command line to run. First element in the list is the
87
- executable. All elements of the command will be quoted if
88
- necessary.
89
- working_directory: other files which may trigger the rule. (optional)
90
- """
91
- command = _QuoteWin32CommandLineArgs(command)
92
-
93
- abs_command = _FindCommandInPath(command[0])
94
-
95
- if environment and isinstance(environment, dict):
96
- env_list = [f'{key}="{val}"' for (key, val) in environment.items()]
97
- environment = " ".join(env_list)
98
- else:
99
- environment = ""
100
-
101
- n_cmd = [
102
- "DebugSettings",
103
- {
104
- "Command": abs_command,
105
- "WorkingDirectory": working_directory,
106
- "CommandArguments": " ".join(command[1:]),
107
- "RemoteMachine": socket.gethostname(),
108
- "Environment": environment,
109
- "EnvironmentMerge": "true",
110
- # Currently these are all "dummy" values that we're just setting
111
- # in the default manner that MSVS does it. We could use some of
112
- # these to add additional capabilities, I suppose, but they might
113
- # not have parity with other platforms then.
114
- "Attach": "false",
115
- "DebuggerType": "3", # 'auto' debugger
116
- "Remote": "1",
117
- "RemoteCommand": "",
118
- "HttpUrl": "",
119
- "PDBPath": "",
120
- "SQLDebugging": "",
121
- "DebuggerFlavor": "0",
122
- "MPIRunCommand": "",
123
- "MPIRunArguments": "",
124
- "MPIRunWorkingDirectory": "",
125
- "ApplicationCommand": "",
126
- "ApplicationArguments": "",
127
- "ShimCommand": "",
128
- "MPIAcceptMode": "",
129
- "MPIAcceptFilter": "",
130
- },
131
- ]
132
-
133
- # Find the config, and add it if it doesn't exist.
134
- if config_name not in self.configurations:
135
- self.AddConfig(config_name)
136
-
137
- # Add the DebugSettings onto the appropriate config.
138
- self.configurations[config_name].append(n_cmd)
139
-
140
- def WriteIfChanged(self):
141
- """Writes the user file."""
142
- configs = ["Configurations"]
143
- for config, spec in sorted(self.configurations.items()):
144
- configs.append(spec)
145
-
146
- content = [
147
- "VisualStudioUserFile",
148
- {"Version": self.version.ProjectVersion(), "Name": self.name},
149
- configs,
150
- ]
151
- easy_xml.WriteXmlIfChanged(
152
- content, self.user_file_path, encoding="Windows-1252"
153
- )
@@ -1,271 +0,0 @@
1
- # Copyright (c) 2013 Google Inc. All rights reserved.
2
- # Use of this source code is governed by a BSD-style license that can be
3
- # found in the LICENSE file.
4
-
5
- """Utility functions shared amongst the Windows generators."""
6
-
7
- import copy
8
- import os
9
-
10
-
11
- # A dictionary mapping supported target types to extensions.
12
- TARGET_TYPE_EXT = {
13
- "executable": "exe",
14
- "loadable_module": "dll",
15
- "shared_library": "dll",
16
- "static_library": "lib",
17
- "windows_driver": "sys",
18
- }
19
-
20
-
21
- def _GetLargePdbShimCcPath():
22
- """Returns the path of the large_pdb_shim.cc file."""
23
- this_dir = os.path.abspath(os.path.dirname(__file__))
24
- src_dir = os.path.abspath(os.path.join(this_dir, "..", ".."))
25
- win_data_dir = os.path.join(src_dir, "data", "win")
26
- large_pdb_shim_cc = os.path.join(win_data_dir, "large-pdb-shim.cc")
27
- return large_pdb_shim_cc
28
-
29
-
30
- def _DeepCopySomeKeys(in_dict, keys):
31
- """Performs a partial deep-copy on |in_dict|, only copying the keys in |keys|.
32
-
33
- Arguments:
34
- in_dict: The dictionary to copy.
35
- keys: The keys to be copied. If a key is in this list and doesn't exist in
36
- |in_dict| this is not an error.
37
- Returns:
38
- The partially deep-copied dictionary.
39
- """
40
- d = {}
41
- for key in keys:
42
- if key not in in_dict:
43
- continue
44
- d[key] = copy.deepcopy(in_dict[key])
45
- return d
46
-
47
-
48
- def _SuffixName(name, suffix):
49
- """Add a suffix to the end of a target.
50
-
51
- Arguments:
52
- name: name of the target (foo#target)
53
- suffix: the suffix to be added
54
- Returns:
55
- Target name with suffix added (foo_suffix#target)
56
- """
57
- parts = name.rsplit("#", 1)
58
- parts[0] = f"{parts[0]}_{suffix}"
59
- return "#".join(parts)
60
-
61
-
62
- def _ShardName(name, number):
63
- """Add a shard number to the end of a target.
64
-
65
- Arguments:
66
- name: name of the target (foo#target)
67
- number: shard number
68
- Returns:
69
- Target name with shard added (foo_1#target)
70
- """
71
- return _SuffixName(name, str(number))
72
-
73
-
74
- def ShardTargets(target_list, target_dicts):
75
- """Shard some targets apart to work around the linkers limits.
76
-
77
- Arguments:
78
- target_list: List of target pairs: 'base/base.gyp:base'.
79
- target_dicts: Dict of target properties keyed on target pair.
80
- Returns:
81
- Tuple of the new sharded versions of the inputs.
82
- """
83
- # Gather the targets to shard, and how many pieces.
84
- targets_to_shard = {}
85
- for t in target_dicts:
86
- shards = int(target_dicts[t].get("msvs_shard", 0))
87
- if shards:
88
- targets_to_shard[t] = shards
89
- # Shard target_list.
90
- new_target_list = []
91
- for t in target_list:
92
- if t in targets_to_shard:
93
- for i in range(targets_to_shard[t]):
94
- new_target_list.append(_ShardName(t, i))
95
- else:
96
- new_target_list.append(t)
97
- # Shard target_dict.
98
- new_target_dicts = {}
99
- for t in target_dicts:
100
- if t in targets_to_shard:
101
- for i in range(targets_to_shard[t]):
102
- name = _ShardName(t, i)
103
- new_target_dicts[name] = copy.copy(target_dicts[t])
104
- new_target_dicts[name]["target_name"] = _ShardName(
105
- new_target_dicts[name]["target_name"], i
106
- )
107
- sources = new_target_dicts[name].get("sources", [])
108
- new_sources = []
109
- for pos in range(i, len(sources), targets_to_shard[t]):
110
- new_sources.append(sources[pos])
111
- new_target_dicts[name]["sources"] = new_sources
112
- else:
113
- new_target_dicts[t] = target_dicts[t]
114
- # Shard dependencies.
115
- for t in sorted(new_target_dicts):
116
- for deptype in ("dependencies", "dependencies_original"):
117
- dependencies = copy.copy(new_target_dicts[t].get(deptype, []))
118
- new_dependencies = []
119
- for d in dependencies:
120
- if d in targets_to_shard:
121
- for i in range(targets_to_shard[d]):
122
- new_dependencies.append(_ShardName(d, i))
123
- else:
124
- new_dependencies.append(d)
125
- new_target_dicts[t][deptype] = new_dependencies
126
-
127
- return (new_target_list, new_target_dicts)
128
-
129
-
130
- def _GetPdbPath(target_dict, config_name, vars):
131
- """Returns the path to the PDB file that will be generated by a given
132
- configuration.
133
-
134
- The lookup proceeds as follows:
135
- - Look for an explicit path in the VCLinkerTool configuration block.
136
- - Look for an 'msvs_large_pdb_path' variable.
137
- - Use '<(PRODUCT_DIR)/<(product_name).(exe|dll).pdb' if 'product_name' is
138
- specified.
139
- - Use '<(PRODUCT_DIR)/<(target_name).(exe|dll).pdb'.
140
-
141
- Arguments:
142
- target_dict: The target dictionary to be searched.
143
- config_name: The name of the configuration of interest.
144
- vars: A dictionary of common GYP variables with generator-specific values.
145
- Returns:
146
- The path of the corresponding PDB file.
147
- """
148
- config = target_dict["configurations"][config_name]
149
- msvs = config.setdefault("msvs_settings", {})
150
-
151
- linker = msvs.get("VCLinkerTool", {})
152
-
153
- pdb_path = linker.get("ProgramDatabaseFile")
154
- if pdb_path:
155
- return pdb_path
156
-
157
- variables = target_dict.get("variables", {})
158
- pdb_path = variables.get("msvs_large_pdb_path", None)
159
- if pdb_path:
160
- return pdb_path
161
-
162
- pdb_base = target_dict.get("product_name", target_dict["target_name"])
163
- pdb_base = "{}.{}.pdb".format(pdb_base, TARGET_TYPE_EXT[target_dict["type"]])
164
- pdb_path = vars["PRODUCT_DIR"] + "/" + pdb_base
165
-
166
- return pdb_path
167
-
168
-
169
- def InsertLargePdbShims(target_list, target_dicts, vars):
170
- """Insert a shim target that forces the linker to use 4KB pagesize PDBs.
171
-
172
- This is a workaround for targets with PDBs greater than 1GB in size, the
173
- limit for the 1KB pagesize PDBs created by the linker by default.
174
-
175
- Arguments:
176
- target_list: List of target pairs: 'base/base.gyp:base'.
177
- target_dicts: Dict of target properties keyed on target pair.
178
- vars: A dictionary of common GYP variables with generator-specific values.
179
- Returns:
180
- Tuple of the shimmed version of the inputs.
181
- """
182
- # Determine which targets need shimming.
183
- targets_to_shim = []
184
- for t in target_dicts:
185
- target_dict = target_dicts[t]
186
-
187
- # We only want to shim targets that have msvs_large_pdb enabled.
188
- if not int(target_dict.get("msvs_large_pdb", 0)):
189
- continue
190
- # This is intended for executable, shared_library and loadable_module
191
- # targets where every configuration is set up to produce a PDB output.
192
- # If any of these conditions is not true then the shim logic will fail
193
- # below.
194
- targets_to_shim.append(t)
195
-
196
- large_pdb_shim_cc = _GetLargePdbShimCcPath()
197
-
198
- for t in targets_to_shim:
199
- target_dict = target_dicts[t]
200
- target_name = target_dict.get("target_name")
201
-
202
- base_dict = _DeepCopySomeKeys(
203
- target_dict, ["configurations", "default_configuration", "toolset"]
204
- )
205
-
206
- # This is the dict for copying the source file (part of the GYP tree)
207
- # to the intermediate directory of the project. This is necessary because
208
- # we can't always build a relative path to the shim source file (on Windows
209
- # GYP and the project may be on different drives), and Ninja hates absolute
210
- # paths (it ends up generating the .obj and .obj.d alongside the source
211
- # file, polluting GYPs tree).
212
- copy_suffix = "large_pdb_copy"
213
- copy_target_name = target_name + "_" + copy_suffix
214
- full_copy_target_name = _SuffixName(t, copy_suffix)
215
- shim_cc_basename = os.path.basename(large_pdb_shim_cc)
216
- shim_cc_dir = vars["SHARED_INTERMEDIATE_DIR"] + "/" + copy_target_name
217
- shim_cc_path = shim_cc_dir + "/" + shim_cc_basename
218
- copy_dict = copy.deepcopy(base_dict)
219
- copy_dict["target_name"] = copy_target_name
220
- copy_dict["type"] = "none"
221
- copy_dict["sources"] = [large_pdb_shim_cc]
222
- copy_dict["copies"] = [
223
- {"destination": shim_cc_dir, "files": [large_pdb_shim_cc]}
224
- ]
225
-
226
- # This is the dict for the PDB generating shim target. It depends on the
227
- # copy target.
228
- shim_suffix = "large_pdb_shim"
229
- shim_target_name = target_name + "_" + shim_suffix
230
- full_shim_target_name = _SuffixName(t, shim_suffix)
231
- shim_dict = copy.deepcopy(base_dict)
232
- shim_dict["target_name"] = shim_target_name
233
- shim_dict["type"] = "static_library"
234
- shim_dict["sources"] = [shim_cc_path]
235
- shim_dict["dependencies"] = [full_copy_target_name]
236
-
237
- # Set up the shim to output its PDB to the same location as the final linker
238
- # target.
239
- for config_name, config in shim_dict.get("configurations").items():
240
- pdb_path = _GetPdbPath(target_dict, config_name, vars)
241
-
242
- # A few keys that we don't want to propagate.
243
- for key in ["msvs_precompiled_header", "msvs_precompiled_source", "test"]:
244
- config.pop(key, None)
245
-
246
- msvs = config.setdefault("msvs_settings", {})
247
-
248
- # Update the compiler directives in the shim target.
249
- compiler = msvs.setdefault("VCCLCompilerTool", {})
250
- compiler["DebugInformationFormat"] = "3"
251
- compiler["ProgramDataBaseFileName"] = pdb_path
252
-
253
- # Set the explicit PDB path in the appropriate configuration of the
254
- # original target.
255
- config = target_dict["configurations"][config_name]
256
- msvs = config.setdefault("msvs_settings", {})
257
- linker = msvs.setdefault("VCLinkerTool", {})
258
- linker["GenerateDebugInformation"] = "true"
259
- linker["ProgramDatabaseFile"] = pdb_path
260
-
261
- # Add the new targets. They must go to the beginning of the list so that
262
- # the dependency generation works as expected in ninja.
263
- target_list.insert(0, full_copy_target_name)
264
- target_list.insert(0, full_shim_target_name)
265
- target_dicts[full_copy_target_name] = copy_dict
266
- target_dicts[full_shim_target_name] = shim_dict
267
-
268
- # Update the original target to depend on the shim target.
269
- target_dict.setdefault("dependencies", []).append(full_shim_target_name)
270
-
271
- return (target_list, target_dicts)