Created
March 10, 2022 15:54
-
-
Save AndrewReitz/2dfc835c7676f511f1ec8fc5445c5504 to your computer and use it in GitHub Desktop.
Python gradle.kts to libs.version.toml script
This file contains 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
import pyperclip | |
import time | |
import re | |
reg = re.compile("\"[A-Za-z0-9:-]+\"") | |
while True: | |
inp = pyperclip.paste() | |
t = reg.findall(inp) | |
if len(t) == 0: | |
time.sleep(1) | |
continue | |
print(t) | |
totalResult = "" | |
for i in t: | |
text = i.replace("\"", "") | |
splits = text.split(":") | |
if len(splits) >= 2: | |
print(splits) | |
fullResult = "projects" | |
for module in splits[1:]: | |
print(module) | |
instacartModule = module.split("-") | |
print(instacartModule) | |
result = instacartModule[0] | |
for x in instacartModule[1:]: | |
result += x.capitalize() | |
fullResult += "." | |
fullResult += result | |
fullResult += "," | |
fullResult += "\n" | |
totalResult += fullResult | |
print(totalResult) | |
if totalResult != "": | |
pyperclip.copy(totalResult) | |
time.sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment