diff options
author | CoprDistGit <infra@openeuler.org> | 2023-05-05 12:43:38 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-05-05 12:43:38 +0000 |
commit | 346659d6401b232d44e711fba2ea0a6113f6fb72 (patch) | |
tree | 6b6006074d6fb222143f243ad234ec2ef3880c12 /python-pomice.spec | |
parent | ec4f791bef5430e5362b1b1fa234e45b917351b6 (diff) |
automatic import of python-pomiceopeneuler20.03
Diffstat (limited to 'python-pomice.spec')
-rw-r--r-- | python-pomice.spec | 461 |
1 files changed, 461 insertions, 0 deletions
diff --git a/python-pomice.spec b/python-pomice.spec new file mode 100644 index 0000000..ac3f5ca --- /dev/null +++ b/python-pomice.spec @@ -0,0 +1,461 @@ +%global _empty_manifest_terminate_build 0 +Name: python-pomice +Version: 2.5.1 +Release: 1 +Summary: The modern Lavalink wrapper designed for Discord.py +License: GPL +URL: https://github.com/cloudwithax/pomice +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/b0/cc/4c7e060d3aaf5eeea6c4ae7350e84a3a89c7fb11f60566d12356d5d15c2d/pomice-2.5.1.tar.gz +BuildArch: noarch + +Requires: python3-aiohttp +Requires: python3-orjson + +%description +# Pomice
+
+
+
+
+[](https://github.com/cloudwithax/pomice/blob/main/LICENSE)  [](https://github.com/psf/black)
+[](https://discord.gg/r64qjTSHG8) [](https://pomice.readthedocs.io/en/latest/)
+
+
+Pomice is a fully asynchronous Python library designed for communicating with [Lavalink](https://github.com/freyacodes/Lavalink) seamlessly within the [discord.py](https://github.com/Rapptz/discord.py) library. It features 100% coverage of the [Lavalink](https://github.com/freyacodes/Lavalink) spec that can be accessed with easy-to-understand functions along with Spotify and Apple Music querying capabilities using built-in custom clients, making it easier to develop your next big music bot.
+
+## Quick Links
+- [Discord Server](https://discord.gg/r64qjTSHG8)
+- [Read the Docs](https://pomice.readthedocs.io/en/latest/)
+- [PyPI Homepage](https://pypi.org/project/pomice/)
+
+
+# Install
+To install the library, you need the lastest version of pip and minimum Python 3.8
+
+> Stable version
+```
+pip install pomice
+```
+
+> Unstable version (this one gets more frequent changes)
+```
+pip install git+https://github.com/cloudwithax/pomice
+```
+
+# Support And Documentation
+
+The official documentation is [here](https://pomice.readthedocs.io/en/latest/)
+
+You can join our support server [here](https://discord.gg/r64qjTSHG8)
+
+
+# Examples
+In-depth examples are located in the [examples folder](https://github.com/cloudwithax/pomice/tree/main/examples)
+
+Here's a quick example:
+
+```py
+import pomice
+import discord
+import re
+
+from discord.ext import commands
+
+URL_REG = re.compile(r'https?://(?:www\.)?.+')
+
+class MyBot(commands.Bot):
+
+ def __init__(self) -> None:
+ super().__init__(command_prefix='!', activity=discord.Activity(type=discord.ActivityType.listening, name='to music!'))
+
+ self.add_cog(Music(self))
+
+ async def on_ready(self) -> None:
+ print("I'm online!")
+ await self.cogs["Music"].start_nodes()
+
+
+class Music(commands.Cog):
+
+ def __init__(self, bot) -> None:
+ self.bot = bot
+
+ self.pomice = pomice.NodePool()
+
+ async def start_nodes(self):
+ await self.pomice.create_node(bot=self.bot, host='127.0.0.1', port='3030',
+ password='youshallnotpass', identifier='MAIN')
+ print(f"Node is ready!")
+
+
+
+ @commands.command(name='join', aliases=['connect'])
+ async def join(self, ctx: commands.Context, *, channel: discord.TextChannel = None) -> None:
+
+ if not channel:
+ channel = getattr(ctx.author.voice, 'channel', None)
+ if not channel:
+ raise commands.CheckFailure('You must be in a voice channel to use this command'
+ 'without specifying the channel argument.')
+
+
+ await ctx.author.voice.channel.connect(cls=pomice.Player)
+ await ctx.send(f'Joined the voice channel `{channel}`')
+
+ @commands.command(name='play')
+ async def play(self, ctx, *, search: str) -> None:
+
+ if not ctx.voice_client:
+ await ctx.invoke(self.join)
+
+ player = ctx.voice_client
+
+ results = await player.get_tracks(query=f'{search}')
+
+ if not results:
+ raise commands.CommandError('No results were found for that search term.')
+
+ if isinstance(results, pomice.Playlist):
+ await player.play(track=results.tracks[0])
+ else:
+ await player.play(track=results[0])
+
+
+bot = MyBot()
+bot.run("token here")
+ ```
+
+# FAQ
+Why is it saying "Cannot connect to host"?
+
+- You need to have a Lavalink node setup before you can use this library. Download it [here](https://github.com/freyacodes/Lavalink/releases/latest)
+
+What experience do I need?
+
+- This library requires that you have some experience with Python, asynchronous programming and the discord.py library.
+
+Why is it saying "No module named pomice found"?
+
+- You need to [install](#Install) the package before you can use it
+
+# Contributors
+
+- Thanks to [vveeps](https://github.com/vveeps) for implementing some features I wasn't able to do myself
+ + +%package -n python3-pomice +Summary: The modern Lavalink wrapper designed for Discord.py +Provides: python-pomice +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-pomice +# Pomice
+
+
+
+
+[](https://github.com/cloudwithax/pomice/blob/main/LICENSE)  [](https://github.com/psf/black)
+[](https://discord.gg/r64qjTSHG8) [](https://pomice.readthedocs.io/en/latest/)
+
+
+Pomice is a fully asynchronous Python library designed for communicating with [Lavalink](https://github.com/freyacodes/Lavalink) seamlessly within the [discord.py](https://github.com/Rapptz/discord.py) library. It features 100% coverage of the [Lavalink](https://github.com/freyacodes/Lavalink) spec that can be accessed with easy-to-understand functions along with Spotify and Apple Music querying capabilities using built-in custom clients, making it easier to develop your next big music bot.
+
+## Quick Links
+- [Discord Server](https://discord.gg/r64qjTSHG8)
+- [Read the Docs](https://pomice.readthedocs.io/en/latest/)
+- [PyPI Homepage](https://pypi.org/project/pomice/)
+
+
+# Install
+To install the library, you need the lastest version of pip and minimum Python 3.8
+
+> Stable version
+```
+pip install pomice
+```
+
+> Unstable version (this one gets more frequent changes)
+```
+pip install git+https://github.com/cloudwithax/pomice
+```
+
+# Support And Documentation
+
+The official documentation is [here](https://pomice.readthedocs.io/en/latest/)
+
+You can join our support server [here](https://discord.gg/r64qjTSHG8)
+
+
+# Examples
+In-depth examples are located in the [examples folder](https://github.com/cloudwithax/pomice/tree/main/examples)
+
+Here's a quick example:
+
+```py
+import pomice
+import discord
+import re
+
+from discord.ext import commands
+
+URL_REG = re.compile(r'https?://(?:www\.)?.+')
+
+class MyBot(commands.Bot):
+
+ def __init__(self) -> None:
+ super().__init__(command_prefix='!', activity=discord.Activity(type=discord.ActivityType.listening, name='to music!'))
+
+ self.add_cog(Music(self))
+
+ async def on_ready(self) -> None:
+ print("I'm online!")
+ await self.cogs["Music"].start_nodes()
+
+
+class Music(commands.Cog):
+
+ def __init__(self, bot) -> None:
+ self.bot = bot
+
+ self.pomice = pomice.NodePool()
+
+ async def start_nodes(self):
+ await self.pomice.create_node(bot=self.bot, host='127.0.0.1', port='3030',
+ password='youshallnotpass', identifier='MAIN')
+ print(f"Node is ready!")
+
+
+
+ @commands.command(name='join', aliases=['connect'])
+ async def join(self, ctx: commands.Context, *, channel: discord.TextChannel = None) -> None:
+
+ if not channel:
+ channel = getattr(ctx.author.voice, 'channel', None)
+ if not channel:
+ raise commands.CheckFailure('You must be in a voice channel to use this command'
+ 'without specifying the channel argument.')
+
+
+ await ctx.author.voice.channel.connect(cls=pomice.Player)
+ await ctx.send(f'Joined the voice channel `{channel}`')
+
+ @commands.command(name='play')
+ async def play(self, ctx, *, search: str) -> None:
+
+ if not ctx.voice_client:
+ await ctx.invoke(self.join)
+
+ player = ctx.voice_client
+
+ results = await player.get_tracks(query=f'{search}')
+
+ if not results:
+ raise commands.CommandError('No results were found for that search term.')
+
+ if isinstance(results, pomice.Playlist):
+ await player.play(track=results.tracks[0])
+ else:
+ await player.play(track=results[0])
+
+
+bot = MyBot()
+bot.run("token here")
+ ```
+
+# FAQ
+Why is it saying "Cannot connect to host"?
+
+- You need to have a Lavalink node setup before you can use this library. Download it [here](https://github.com/freyacodes/Lavalink/releases/latest)
+
+What experience do I need?
+
+- This library requires that you have some experience with Python, asynchronous programming and the discord.py library.
+
+Why is it saying "No module named pomice found"?
+
+- You need to [install](#Install) the package before you can use it
+
+# Contributors
+
+- Thanks to [vveeps](https://github.com/vveeps) for implementing some features I wasn't able to do myself
+ + +%package help +Summary: Development documents and examples for pomice +Provides: python3-pomice-doc +%description help +# Pomice
+
+
+
+
+[](https://github.com/cloudwithax/pomice/blob/main/LICENSE)  [](https://github.com/psf/black)
+[](https://discord.gg/r64qjTSHG8) [](https://pomice.readthedocs.io/en/latest/)
+
+
+Pomice is a fully asynchronous Python library designed for communicating with [Lavalink](https://github.com/freyacodes/Lavalink) seamlessly within the [discord.py](https://github.com/Rapptz/discord.py) library. It features 100% coverage of the [Lavalink](https://github.com/freyacodes/Lavalink) spec that can be accessed with easy-to-understand functions along with Spotify and Apple Music querying capabilities using built-in custom clients, making it easier to develop your next big music bot.
+
+## Quick Links
+- [Discord Server](https://discord.gg/r64qjTSHG8)
+- [Read the Docs](https://pomice.readthedocs.io/en/latest/)
+- [PyPI Homepage](https://pypi.org/project/pomice/)
+
+
+# Install
+To install the library, you need the lastest version of pip and minimum Python 3.8
+
+> Stable version
+```
+pip install pomice
+```
+
+> Unstable version (this one gets more frequent changes)
+```
+pip install git+https://github.com/cloudwithax/pomice
+```
+
+# Support And Documentation
+
+The official documentation is [here](https://pomice.readthedocs.io/en/latest/)
+
+You can join our support server [here](https://discord.gg/r64qjTSHG8)
+
+
+# Examples
+In-depth examples are located in the [examples folder](https://github.com/cloudwithax/pomice/tree/main/examples)
+
+Here's a quick example:
+
+```py
+import pomice
+import discord
+import re
+
+from discord.ext import commands
+
+URL_REG = re.compile(r'https?://(?:www\.)?.+')
+
+class MyBot(commands.Bot):
+
+ def __init__(self) -> None:
+ super().__init__(command_prefix='!', activity=discord.Activity(type=discord.ActivityType.listening, name='to music!'))
+
+ self.add_cog(Music(self))
+
+ async def on_ready(self) -> None:
+ print("I'm online!")
+ await self.cogs["Music"].start_nodes()
+
+
+class Music(commands.Cog):
+
+ def __init__(self, bot) -> None:
+ self.bot = bot
+
+ self.pomice = pomice.NodePool()
+
+ async def start_nodes(self):
+ await self.pomice.create_node(bot=self.bot, host='127.0.0.1', port='3030',
+ password='youshallnotpass', identifier='MAIN')
+ print(f"Node is ready!")
+
+
+
+ @commands.command(name='join', aliases=['connect'])
+ async def join(self, ctx: commands.Context, *, channel: discord.TextChannel = None) -> None:
+
+ if not channel:
+ channel = getattr(ctx.author.voice, 'channel', None)
+ if not channel:
+ raise commands.CheckFailure('You must be in a voice channel to use this command'
+ 'without specifying the channel argument.')
+
+
+ await ctx.author.voice.channel.connect(cls=pomice.Player)
+ await ctx.send(f'Joined the voice channel `{channel}`')
+
+ @commands.command(name='play')
+ async def play(self, ctx, *, search: str) -> None:
+
+ if not ctx.voice_client:
+ await ctx.invoke(self.join)
+
+ player = ctx.voice_client
+
+ results = await player.get_tracks(query=f'{search}')
+
+ if not results:
+ raise commands.CommandError('No results were found for that search term.')
+
+ if isinstance(results, pomice.Playlist):
+ await player.play(track=results.tracks[0])
+ else:
+ await player.play(track=results[0])
+
+
+bot = MyBot()
+bot.run("token here")
+ ```
+
+# FAQ
+Why is it saying "Cannot connect to host"?
+
+- You need to have a Lavalink node setup before you can use this library. Download it [here](https://github.com/freyacodes/Lavalink/releases/latest)
+
+What experience do I need?
+
+- This library requires that you have some experience with Python, asynchronous programming and the discord.py library.
+
+Why is it saying "No module named pomice found"?
+
+- You need to [install](#Install) the package before you can use it
+
+# Contributors
+
+- Thanks to [vveeps](https://github.com/vveeps) for implementing some features I wasn't able to do myself
+ + +%prep +%autosetup -n pomice-2.5.1 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-pomice -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Fri May 05 2023 Python_Bot <Python_Bot@openeuler.org> - 2.5.1-1 +- Package Spec generated |