Skip to content

Commit

Permalink
Converting to run from outside package directory
Browse files Browse the repository at this point in the history
  • Loading branch information
linsomniac committed Feb 7, 2024
1 parent e7736a1 commit 725db55
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,21 @@ Then you can prefix the command you want to run with `python3 -m spotify2ytmusic
example:

```shell
python3 -m spotify2ytmusic gui
python3 -m spotify2ytmusic list_playlists
python3 -m spotify2ytmusic load_liked
[etc...]
```

## Graphical UI

On Windows: `python gui.py`
If you have installed via PIP, you should be able to run: `s2yt_gui`

Or on Linux: `python3 gui.py`
Otherwise, if running from source:

On Windows: `python -m spotify2ytmusic gui`

Or on Linux: `python2 -m spotify2ytmusic gui`

### Login to YTMusic - Tab 0

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.scripts]
s2yt_gui = "spotify2ytmusic.gui:main"
s2yt_load_liked = "spotify2ytmusic.cli:load_liked"
s2yt_load_liked_albums = "spotify2ytmusic.cli:load_liked_albums"
s2yt_copy_playlist = "spotify2ytmusic.cli:copy_playlist"
Expand Down
9 changes: 9 additions & 0 deletions spotify2ytmusic/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,3 +266,12 @@ def parse_arguments():
dry_run=args.dry_run,
spotify_playlists_encoding=args.spotify_playlists_encoding,
)


def gui():
"""
Run the Spotify2YTMusic GUI.
"""
from . import gui

gui.main()
12 changes: 8 additions & 4 deletions spotify2ytmusic/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import tkinter as tk
from tkinter import ttk

import cli
import backend
import spotify_backup
from . import cli
from . import backend
from . import spotify_backup
from typing import Callable


Expand Down Expand Up @@ -358,6 +358,10 @@ def load_write_settings(self, action: int) -> None:
self.root.update()


if __name__ == "__main__":
def main() -> None:
ui = Window()
ui.root.mainloop()


if __name__ == "__main__":
main()

0 comments on commit 725db55

Please sign in to comment.