82bd109b85
* delete debugger * No need tooltip data as part of interactivity * Fix coloring * delete logging * Fix messaging on interactivity for tooltip data * Delete unused code * Navbar and cursors * Revamp viewer actions * Hide viewer actions * not a css master commit * Toggle projection/orthi * Remove console log * Fix saved objects * Remove console log * Sort performance logging * fix view mode cache * Fix initial isolate issue * Update README.md (#147) * Update README.md * Update README.md * fix typo on conditions * capabilities for object ids * Revert isolating every setDataInput * Fix selection issues * Fix tooltip fckp * Reset filters * Fix reset filter * Ghost hidden on filter * Bring conditional formatting back * Remove ghost hidden context from color card * Disable shadow catcher * Disable camera position persistence for performance reasons * feat (data): sending version and branding info (#157) * get version * adds workspace info * adds hideBranding * adds workspace info --------- Co-authored-by: Oğuzhan Koral <45078678+oguzhankoral@users.noreply.github.com> * Enrich receive info from desktop service * test * fix path * fix path again * file version * correct the version with assembly for file version * sanitize tag * Use version from receive info * Fix clipped zoom extend * Workspace name logo * Add can hide branding logic * Fix tooltip for toggle * Fix capabilities for storing branding * Tooltips * Store is ortho in file * Store camera position and target into file according to selected view * Fix loading bar reactivity * Update connector flow * Fix ghost state * Store is ghost in file * Consider ghost value on reset filter * More * excludes rawencoding (#159) * adds null check for personal (#158) * Progress update and error handling * Call pre get before --------- Co-authored-by: Jonathon Broughton <760691+jsdbroughton@users.noreply.github.com> Co-authored-by: Dogukan Karatas <61163577+dogukankaratas@users.noreply.github.com>
43 lines
1.2 KiB
Python
43 lines
1.2 KiB
Python
import re
|
|
import sys
|
|
import os
|
|
|
|
|
|
def sanitize_version(tag):
|
|
"""Extracts the first three numeric segments from a tag string, because PowerBI is..."""
|
|
parts = re.findall(r"\d+", tag)
|
|
return ".".join(parts[:3]) if len(parts) >= 3 else tag
|
|
|
|
def patch_connector(tag):
|
|
"""Patches the connector version within the data connector file"""
|
|
sanitized_tag = sanitize_version(tag)
|
|
pq_file = os.path.join(os.path.dirname(__file__), "src", "powerbi-data-connector", "Speckle.pq")
|
|
|
|
with open(pq_file, "r") as file:
|
|
lines = file.readlines()
|
|
|
|
for (index, line) in enumerate(lines):
|
|
if '[Version = "3.0.0"]' in line:
|
|
lines[index] = f'[Version = "{sanitized_tag}"]\n'
|
|
print(f"Patched connector version number in {pq_file}")
|
|
break
|
|
|
|
with open(pq_file, "w") as file:
|
|
file.writelines(lines)
|
|
|
|
|
|
def main():
|
|
if len(sys.argv) < 2:
|
|
return
|
|
|
|
tag = sys.argv[1]
|
|
if not re.match(r"([0-9]+)\.([0-9]+)\.([0-9]+)", tag):
|
|
raise ValueError(f"Invalid tag provided: {tag}")
|
|
|
|
print(f"Patching version: {tag}")
|
|
patch_connector(tag)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|