Skip to content

Commit

Permalink
Bumped version with graceful handling of pyperclip for non-clipboard …
Browse files Browse the repository at this point in the history
…systems
  • Loading branch information
beveradb committed Dec 24, 2024
1 parent 2d8bc4d commit b2d9df8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions karaoke_lyrics_processor/karaoke_lyrics_processor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import re
import logging
import pyperclip
import unicodedata
import docx2txt
from striprtf.striprtf import rtf_to_text
import os
Expand Down Expand Up @@ -308,9 +307,13 @@ def process(self):
processed_lyrics_text = self.clean_punctuation_spacing(processed_lyrics_text)

self.processed_lyrics_text = processed_lyrics_text
pyperclip.copy(processed_lyrics_text)

self.logger.info(f"Processed lyrics copied to clipboard.")

# Try to copy to clipboard, but don't fail if it's not available
try:
pyperclip.copy(processed_lyrics_text)
self.logger.info("Processed lyrics copied to clipboard.")
except pyperclip.PyperclipException as e:
self.logger.warning(f"Could not copy to clipboard: {str(e)}")

return processed_lyrics_text

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "karaoke-lyrics-processor"
version = "0.4.0"
version = "0.4.1"
description = "Process song lyrics to prepare them for karaoke video production, e.g. by splitting long lines"
authors = ["Andrew Beveridge <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit b2d9df8

Please sign in to comment.