معرفی شرکت ها


Scarabaeus-0.0.1


Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر

توضیحات

A simple way to manage plugins and events in Python
ویژگی مقدار
سیستم عامل OS Independent
نام فایل Scarabaeus-0.0.1
نام Scarabaeus
نسخه کتابخانه 0.0.1
نگهدارنده []
ایمیل نگهدارنده []
نویسنده -
ایمیل نویسنده Quik <quik@daskju.com>
آدرس صفحه اصلی -
آدرس اینترنتی https://pypi.org/project/Scarabaeus/
مجوز Copyright © 2022 Daskju.com, The Daskju Project Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Scarabaeus Python plugins and events. Done right. ## Plugins & Plugin types ### Example in a program ```py import scarabaeus app_variable = "A text for example" # Defining a new type of plugin and variables that the plugins of this type should have access to plugin_type = scarabaeus.PluginType(name="Plugin", shared={"var":app_variable}, load_path="plugins/") # Loading all plugin files in the load_path directory plugin_type.load_all() ``` ### Example of a plugin A file in the `plugins/` directory ```py import scarabaeus class Plugin(scarabaeus.Plugin): def __init__(self): # This plugin has access to the variable of the app! print(self.var) ``` ## Events ### Events in a program Example: ```py import scarabaeus event_handler = scarabaeus.EventHandler(allow_unregistered_events=False) event_handler.add("on_some_event") @event_handler.event("on_some_event") def some_event_listener(some_parameter): print(some_parameter) event_handler.call("on_some_event", "A text that is going to be printed") ``` ### Events and plugins #### EventManager for PluginType ```py import scarabaeus event_handler = scarabaeus.EventHandler(allow_unregistered_events=False) event_handler.add("on_some_event") app_variable = "A text for example" plugin_type = scarabaeus.PluginType(name="Plugin", shared={"var":app_variable}, load_path="plugins/", event_handler=event_handler) plugin_type.load_all() event_handler.call("on_some_event", "Some text!") ``` #### In plugins ```py import scarabaeus class Plugin(scarabaeus.Plugin): @scarabaeus.Plugin.event("on_some_event") def some_event_listener(self, some_parameter): print(some_parameter) ```


زبان مورد نیاز

مقدار نام
>=3.6 Python


نحوه نصب


نصب پکیج whl Scarabaeus-0.0.1:

    pip install Scarabaeus-0.0.1.whl


نصب پکیج tar.gz Scarabaeus-0.0.1:

    pip install Scarabaeus-0.0.1.tar.gz