diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-05-18 05:09:16 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-05-18 05:09:16 +0000 |
| commit | 86432009e398c00166440515d184ba2d38da25d4 (patch) | |
| tree | 92f3258cafacf37e3a97677d1f7268a6b0879a06 /python-csgoinvshuffle.spec | |
| parent | f7a574ad387a57fd0b1a33040fecfe675b0ded97 (diff) | |
automatic import of python-csgoinvshuffle
Diffstat (limited to 'python-csgoinvshuffle.spec')
| -rw-r--r-- | python-csgoinvshuffle.spec | 339 |
1 files changed, 339 insertions, 0 deletions
diff --git a/python-csgoinvshuffle.spec b/python-csgoinvshuffle.spec new file mode 100644 index 0000000..dbe7b00 --- /dev/null +++ b/python-csgoinvshuffle.spec @@ -0,0 +1,339 @@ +%global _empty_manifest_terminate_build 0 +Name: python-csgoinvshuffle +Version: 1.3.10 +Release: 1 +Summary: A package for creating CS:GO inventory shuffle config files +License: MIT +URL: https://csgoinvshuffle.kreyoo.dev +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/45/b7/b26cb2b24a6c3de5fe7323d3dee64c27996c423e71543ace79bb713cb1a8/csgoinvshuffle-1.3.10.tar.gz +BuildArch: noarch + +Requires: python3-Deprecated +Requires: python3-requests +Requires: python3-typing-extensions + +%description +# csgoinvshuffle + +[](https://badge.fury.io/py/csgoinvshuffle) +[](https://github.com/kreyoo/csgo-inv-shuffle/blob/master/LICENSE) +[](https://github.com/kreyoo/csgo-inv-shuffle/issues) + + + + +# Description + +csgoinvshuffle is a Python package designed to generate inventory shuffle config files for the game CS:GO. + +With this package you can easily shuffle between different weapon types (e.g. M4A4 and M4A1-S) and have less limits in customizing the shuffle experience than with the in-game settings. + +## Note: + +CS:GO never really queues your items in a random order. +The items are arranged in one simple, predefined cycle. +This package aims to creating shuffles to your liking with ease + +You can use the config file it creates and replace `<path_to_your_steam>/userdata/<your_steam_3id>/730/remote/cfg/csgo_saved_item_shuffles.txt` with it to apply your config. + +#### HINT: + +CS:GO needs to be closed while replacing the file + +# How to install + +`pip install csgoinvshuffle` + +# Basic usage + +## Your steam inventory needs to be public! + +### Basic shuffle for everything in your inventory with randomness + +```python +from csgoinvshuffle import ShuffleConfig, get_inventory + +with ShuffleConfig() as sc: + sc.add_items(get_inventory("YOUR_STEAM_ID_64")) + sc.randomize() +``` + +### Give items a certain order in the cycle + +```python +from csgoinvshuffle import ShuffleConfig, get_inventory +from csgoinvshuffle.enums import TagsInternalName + +# This example only works if you have at least 4 music kits in your inventory +sc = ShuffleConfig() +inv = get_inventory("YOUR_STEAM_ID_64") +music_kits = inv.filter(TagsInternalName.MUSIC_KITS) +sc.set_item(0 , music_kits[3]) +sc.set_item(1, music_kits[1]) +sc.save() +``` + +As you can see in the last example, an inventory is equipped with a filter attribute and can be handled like a list. +You can filter for enums and the filter uses the TagsInternalName by default, as it is the most useful one. +Otherwise using the built-in filter() function on the Inventory Object is suggested. +To get an overview of what values the attributes of an Item can have, you can lookup https://steamcommunity.com/inventory/<YOUR_STEAM_ID_64>/730/2 +or lookup the typing definitions inside the item class. +As mentioned, typical values for the property `tags_internal_name` are provided by the TagsInternalName enum. + +### Create a shuffle cycle for only one team side + +```python +from csgoinvshuffle import ShuffleConfig, get_inventory +from csgoinvshuffle.enums import TagsInternalName, TeamSide + +with ShuffleConfig() as sc: + inv = get_inventory("YOUR_STEAM_ID_64") + knives = inv.filter(TagsInternalName.KNIVES) + classic_knife = knives.filter(TagsInternalName.CLASSIC_KNIFE)[0] + karambit = knives.filter(TagsInternalName.KARAMBIT_KNIFE)[0] + butterfly = filter(lambda x: x.custom_name == "crypto is for n00bs", knives)[0] + # First map karambit, second map classic knife, third map butterfly, next map karambit again... + # On T side only + my_shuffle_cycle = [karambit, classic_knife, butterfly] + sc.add_items(my_shuffle_cycle, TeamSide.T) +``` + +By default, the attribute methods from `ShuffleConfig` do everything for both teams. +If you want to have different shuffle cycles on the opposing sides, you have to state it with a parameter. + + + +%package -n python3-csgoinvshuffle +Summary: A package for creating CS:GO inventory shuffle config files +Provides: python-csgoinvshuffle +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-csgoinvshuffle +# csgoinvshuffle + +[](https://badge.fury.io/py/csgoinvshuffle) +[](https://github.com/kreyoo/csgo-inv-shuffle/blob/master/LICENSE) +[](https://github.com/kreyoo/csgo-inv-shuffle/issues) + + + + +# Description + +csgoinvshuffle is a Python package designed to generate inventory shuffle config files for the game CS:GO. + +With this package you can easily shuffle between different weapon types (e.g. M4A4 and M4A1-S) and have less limits in customizing the shuffle experience than with the in-game settings. + +## Note: + +CS:GO never really queues your items in a random order. +The items are arranged in one simple, predefined cycle. +This package aims to creating shuffles to your liking with ease + +You can use the config file it creates and replace `<path_to_your_steam>/userdata/<your_steam_3id>/730/remote/cfg/csgo_saved_item_shuffles.txt` with it to apply your config. + +#### HINT: + +CS:GO needs to be closed while replacing the file + +# How to install + +`pip install csgoinvshuffle` + +# Basic usage + +## Your steam inventory needs to be public! + +### Basic shuffle for everything in your inventory with randomness + +```python +from csgoinvshuffle import ShuffleConfig, get_inventory + +with ShuffleConfig() as sc: + sc.add_items(get_inventory("YOUR_STEAM_ID_64")) + sc.randomize() +``` + +### Give items a certain order in the cycle + +```python +from csgoinvshuffle import ShuffleConfig, get_inventory +from csgoinvshuffle.enums import TagsInternalName + +# This example only works if you have at least 4 music kits in your inventory +sc = ShuffleConfig() +inv = get_inventory("YOUR_STEAM_ID_64") +music_kits = inv.filter(TagsInternalName.MUSIC_KITS) +sc.set_item(0 , music_kits[3]) +sc.set_item(1, music_kits[1]) +sc.save() +``` + +As you can see in the last example, an inventory is equipped with a filter attribute and can be handled like a list. +You can filter for enums and the filter uses the TagsInternalName by default, as it is the most useful one. +Otherwise using the built-in filter() function on the Inventory Object is suggested. +To get an overview of what values the attributes of an Item can have, you can lookup https://steamcommunity.com/inventory/<YOUR_STEAM_ID_64>/730/2 +or lookup the typing definitions inside the item class. +As mentioned, typical values for the property `tags_internal_name` are provided by the TagsInternalName enum. + +### Create a shuffle cycle for only one team side + +```python +from csgoinvshuffle import ShuffleConfig, get_inventory +from csgoinvshuffle.enums import TagsInternalName, TeamSide + +with ShuffleConfig() as sc: + inv = get_inventory("YOUR_STEAM_ID_64") + knives = inv.filter(TagsInternalName.KNIVES) + classic_knife = knives.filter(TagsInternalName.CLASSIC_KNIFE)[0] + karambit = knives.filter(TagsInternalName.KARAMBIT_KNIFE)[0] + butterfly = filter(lambda x: x.custom_name == "crypto is for n00bs", knives)[0] + # First map karambit, second map classic knife, third map butterfly, next map karambit again... + # On T side only + my_shuffle_cycle = [karambit, classic_knife, butterfly] + sc.add_items(my_shuffle_cycle, TeamSide.T) +``` + +By default, the attribute methods from `ShuffleConfig` do everything for both teams. +If you want to have different shuffle cycles on the opposing sides, you have to state it with a parameter. + + + +%package help +Summary: Development documents and examples for csgoinvshuffle +Provides: python3-csgoinvshuffle-doc +%description help +# csgoinvshuffle + +[](https://badge.fury.io/py/csgoinvshuffle) +[](https://github.com/kreyoo/csgo-inv-shuffle/blob/master/LICENSE) +[](https://github.com/kreyoo/csgo-inv-shuffle/issues) + + + + +# Description + +csgoinvshuffle is a Python package designed to generate inventory shuffle config files for the game CS:GO. + +With this package you can easily shuffle between different weapon types (e.g. M4A4 and M4A1-S) and have less limits in customizing the shuffle experience than with the in-game settings. + +## Note: + +CS:GO never really queues your items in a random order. +The items are arranged in one simple, predefined cycle. +This package aims to creating shuffles to your liking with ease + +You can use the config file it creates and replace `<path_to_your_steam>/userdata/<your_steam_3id>/730/remote/cfg/csgo_saved_item_shuffles.txt` with it to apply your config. + +#### HINT: + +CS:GO needs to be closed while replacing the file + +# How to install + +`pip install csgoinvshuffle` + +# Basic usage + +## Your steam inventory needs to be public! + +### Basic shuffle for everything in your inventory with randomness + +```python +from csgoinvshuffle import ShuffleConfig, get_inventory + +with ShuffleConfig() as sc: + sc.add_items(get_inventory("YOUR_STEAM_ID_64")) + sc.randomize() +``` + +### Give items a certain order in the cycle + +```python +from csgoinvshuffle import ShuffleConfig, get_inventory +from csgoinvshuffle.enums import TagsInternalName + +# This example only works if you have at least 4 music kits in your inventory +sc = ShuffleConfig() +inv = get_inventory("YOUR_STEAM_ID_64") +music_kits = inv.filter(TagsInternalName.MUSIC_KITS) +sc.set_item(0 , music_kits[3]) +sc.set_item(1, music_kits[1]) +sc.save() +``` + +As you can see in the last example, an inventory is equipped with a filter attribute and can be handled like a list. +You can filter for enums and the filter uses the TagsInternalName by default, as it is the most useful one. +Otherwise using the built-in filter() function on the Inventory Object is suggested. +To get an overview of what values the attributes of an Item can have, you can lookup https://steamcommunity.com/inventory/<YOUR_STEAM_ID_64>/730/2 +or lookup the typing definitions inside the item class. +As mentioned, typical values for the property `tags_internal_name` are provided by the TagsInternalName enum. + +### Create a shuffle cycle for only one team side + +```python +from csgoinvshuffle import ShuffleConfig, get_inventory +from csgoinvshuffle.enums import TagsInternalName, TeamSide + +with ShuffleConfig() as sc: + inv = get_inventory("YOUR_STEAM_ID_64") + knives = inv.filter(TagsInternalName.KNIVES) + classic_knife = knives.filter(TagsInternalName.CLASSIC_KNIFE)[0] + karambit = knives.filter(TagsInternalName.KARAMBIT_KNIFE)[0] + butterfly = filter(lambda x: x.custom_name == "crypto is for n00bs", knives)[0] + # First map karambit, second map classic knife, third map butterfly, next map karambit again... + # On T side only + my_shuffle_cycle = [karambit, classic_knife, butterfly] + sc.add_items(my_shuffle_cycle, TeamSide.T) +``` + +By default, the attribute methods from `ShuffleConfig` do everything for both teams. +If you want to have different shuffle cycles on the opposing sides, you have to state it with a parameter. + + + +%prep +%autosetup -n csgoinvshuffle-1.3.10 + +%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-csgoinvshuffle -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Thu May 18 2023 Python_Bot <Python_Bot@openeuler.org> - 1.3.10-1 +- Package Spec generated |
