Remilia


NameRemilia JSON
Version 2023.3.19.3.18.12 PyPI version JSON
download
home_pagehttps://github.com/IAXRetailer/Remilia
SummaryUse python with dignity,here offer some utils
upload_time2023-03-19 03:18:15
maintainerh2sxxa
docs_urlNone
authorh2sxxa
requires_python
licenseMIT License
keywords
VCS
bugtrack_url
requirements colorama pyyaml
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align=center>
  <img src="https://raw.githubusercontent.com/IAXRetailer/Remilia/main/background.png"  alt="[BG](https://raw.githubusercontent.com/IAXRetailer/Remilia/main/background.png)"/>
  <h1 align="center">Remilia</h1> 
</div>
<div align=center>
  <img src="https://img.shields.io/badge/python-3.8+-blue" alt="python">
  <img src="https://img.shields.io/github/languages/code-size/IAXRetailer/Remilia" alt="size">
  <img src="https://img.shields.io/github/license/IAXRetailer/Remilia" alt="license">
</div>

# Install

```shell
pip install Remilia
```

# Quick start

## LiteLog

```python
from Remilia.lite import LiteLog

logger=LiteLog.Logger(__name__)
logger.info(1,2,3)
logger.newprint(1,2,3)

>>>[ INFO | __main__ | 14:58:50 ] 1,2,3
>>>[ NEWPRINT | __main__ | 14:58:50 ] 1,2,3
```

## LiteEvent

```python
from Remilia.lite.LiteEvent import SubcribeEvent,BaseEvent,TriggerEvent,EventSet

class TestEvent(BaseEvent):pass

@TriggerEvent(TestEvent)
def foo():
    print("I am event")

@SubcribeEvent
def test(event:TestEvent,eset:EventSet):
    print(eset.efunction.__name__)
    print("Cancel it!")
    eset.einstance.cancel()

foo()


>>>foo
>>>Cancel it!
```

## LiteThread

```python
from Remilia.lite import LiteThread

def hello():
    return "hello"

TVManager=LiteThread.ThreadValueManager()
TestThread=LiteThread.RewardThread(target=hello)
TestThread.start()
print(TVManager.waitResult(TestThread))

>>>hello
```

## LiteMixin

```python
from Remilia.lite import LiteMixin
class A:
    def __init__(self) -> None:
        self.hello()
    def hello(self):
        print("hello")
A()
class A_patch:
    def hello(self):
        print("byebye")

LiteMixin.MixInClass(A,A_patch)
A()


>>>hello
>>>byebye
```

## LitePGL

```python

# main.py
# test
#  - plugin1.py
#  - plugin2.py



#main

from Remilia.lite import LitePGL,LiteResource
PGLoader=LitePGL.PluginLoader()
LoadPoint1=LitePGL.PluginLoadPoint(PGLoader,"loadpoint1")
PGLoader.setInterface(globals())
PGLoader.initLoadPlugin(LiteResource.Path("test/plugin2.py"))
PGLoader.initLoadPlugin(LiteResource.Path("test/plugin1.py"))
LoadPoint1.run()

#test/plugin1.py
PluginLoader=self
p2Self=PluginLoader.requestPlugin("p2")

@PluginLoader.registPlugin(PluginLoader.getInterface["LoadPoint1"])
class plugin:
    def __init__(self) -> None:
        global PluginLoader,p2Self
        print("I am p1")
        p2Self.hello("hello")
    def __reference__(self):
        return {
            "pluginid":"p1"
        }

#test/plugin2.py
PluginLoader=self
@PluginLoader.registPlugin(PluginLoader.getInterface["LoadPoint1"])
class plugin2:
    def __init__(self) -> None:
        print("I am p2")

    def hello(self,*args):
        print(*args)

    def __reference__(self):
        return {
            "pluginid":"p2"
        }

>>>I am p2
>>>I am p1
>>>hello



```
# QA

## Q: AttributeError: module 'Remilia' has no attribute '...'

use the function below or see it in Remilia.__init__ to install the required lib,

if it doesn't work,please consider a issue

```python
Remilia.__REQUIREMENTS__()
```
# Learn more in our WIKI

## https://github.com/IAXRetailer/Remilia/wiki



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/IAXRetailer/Remilia",
    "name": "Remilia",
    "maintainer": "h2sxxa",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "H2Sxxa0w0@gmail.com",
    "keywords": "",
    "author": "h2sxxa",
    "author_email": "H2Sxxa0w0@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/5a/b1/ebe391036ce1469cf33567fc4d28d15a1037d6068bd5d1943b444e007ecf/Remilia-2023.3.19.3.18.12.tar.gz",
    "platform": "all",
    "description": "<div align=center>\n  <img src=\"https://raw.githubusercontent.com/IAXRetailer/Remilia/main/background.png\"  alt=\"[BG](https://raw.githubusercontent.com/IAXRetailer/Remilia/main/background.png)\"/>\n  <h1 align=\"center\">Remilia</h1> \n</div>\n<div align=center>\n  <img src=\"https://img.shields.io/badge/python-3.8+-blue\" alt=\"python\">\n  <img src=\"https://img.shields.io/github/languages/code-size/IAXRetailer/Remilia\" alt=\"size\">\n  <img src=\"https://img.shields.io/github/license/IAXRetailer/Remilia\" alt=\"license\">\n</div>\n\n# Install\n\n```shell\npip install Remilia\n```\n\n# Quick start\n\n## LiteLog\n\n```python\nfrom Remilia.lite import LiteLog\n\nlogger=LiteLog.Logger(__name__)\nlogger.info(1,2,3)\nlogger.newprint(1,2,3)\n\n>>>[ INFO | __main__ | 14:58:50 ] 1,2,3\n>>>[ NEWPRINT | __main__ | 14:58:50 ] 1,2,3\n```\n\n## LiteEvent\n\n```python\nfrom Remilia.lite.LiteEvent import SubcribeEvent,BaseEvent,TriggerEvent,EventSet\n\nclass TestEvent(BaseEvent):pass\n\n@TriggerEvent(TestEvent)\ndef foo():\n    print(\"I am event\")\n\n@SubcribeEvent\ndef test(event:TestEvent,eset:EventSet):\n    print(eset.efunction.__name__)\n    print(\"Cancel it!\")\n    eset.einstance.cancel()\n\nfoo()\n\n\n>>>foo\n>>>Cancel it!\n```\n\n## LiteThread\n\n```python\nfrom Remilia.lite import LiteThread\n\ndef hello():\n    return \"hello\"\n\nTVManager=LiteThread.ThreadValueManager()\nTestThread=LiteThread.RewardThread(target=hello)\nTestThread.start()\nprint(TVManager.waitResult(TestThread))\n\n>>>hello\n```\n\n## LiteMixin\n\n```python\nfrom Remilia.lite import LiteMixin\nclass A:\n    def __init__(self) -> None:\n        self.hello()\n    def hello(self):\n        print(\"hello\")\nA()\nclass A_patch:\n    def hello(self):\n        print(\"byebye\")\n\nLiteMixin.MixInClass(A,A_patch)\nA()\n\n\n>>>hello\n>>>byebye\n```\n\n## LitePGL\n\n```python\n\n# main.py\n# test\n#  - plugin1.py\n#  - plugin2.py\n\n\n\n#main\n\nfrom Remilia.lite import LitePGL,LiteResource\nPGLoader=LitePGL.PluginLoader()\nLoadPoint1=LitePGL.PluginLoadPoint(PGLoader,\"loadpoint1\")\nPGLoader.setInterface(globals())\nPGLoader.initLoadPlugin(LiteResource.Path(\"test/plugin2.py\"))\nPGLoader.initLoadPlugin(LiteResource.Path(\"test/plugin1.py\"))\nLoadPoint1.run()\n\n#test/plugin1.py\nPluginLoader=self\np2Self=PluginLoader.requestPlugin(\"p2\")\n\n@PluginLoader.registPlugin(PluginLoader.getInterface[\"LoadPoint1\"])\nclass plugin:\n    def __init__(self) -> None:\n        global PluginLoader,p2Self\n        print(\"I am p1\")\n        p2Self.hello(\"hello\")\n    def __reference__(self):\n        return {\n            \"pluginid\":\"p1\"\n        }\n\n#test/plugin2.py\nPluginLoader=self\n@PluginLoader.registPlugin(PluginLoader.getInterface[\"LoadPoint1\"])\nclass plugin2:\n    def __init__(self) -> None:\n        print(\"I am p2\")\n\n    def hello(self,*args):\n        print(*args)\n\n    def __reference__(self):\n        return {\n            \"pluginid\":\"p2\"\n        }\n\n>>>I am p2\n>>>I am p1\n>>>hello\n\n\n\n```\n# QA\n\n## Q: AttributeError: module 'Remilia' has no attribute '...'\n\nuse the function below or see it in Remilia.__init__ to install the required lib,\n\nif it doesn't work,please consider a issue\n\n```python\nRemilia.__REQUIREMENTS__()\n```\n# Learn more in our WIKI\n\n## https://github.com/IAXRetailer/Remilia/wiki\n\n\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Use python with dignity,here offer some utils",
    "version": "2023.3.19.3.18.12",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "71ada943c970750d197ffd4defe9700ddd48acda37e0968be0ab8060b2f5fd25",
                "md5": "f165e445fe990da7b27c7ff8d27b5dd3",
                "sha256": "5464d8e1f6950d5fe856110479781b5b63ed43cffd122fb73822067cc18fcdd0"
            },
            "downloads": -1,
            "filename": "Remilia-2023.3.19.3.18.12-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f165e445fe990da7b27c7ff8d27b5dd3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 34699,
            "upload_time": "2023-03-19T03:18:14",
            "upload_time_iso_8601": "2023-03-19T03:18:14.091194Z",
            "url": "https://files.pythonhosted.org/packages/71/ad/a943c970750d197ffd4defe9700ddd48acda37e0968be0ab8060b2f5fd25/Remilia-2023.3.19.3.18.12-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5ab1ebe391036ce1469cf33567fc4d28d15a1037d6068bd5d1943b444e007ecf",
                "md5": "2e231ed87ce7961aa79b2b63227e9cbc",
                "sha256": "96fe6f76c3c4c4c723d3282c2e093ae1019592a5a765f23e4b7445255b8e447a"
            },
            "downloads": -1,
            "filename": "Remilia-2023.3.19.3.18.12.tar.gz",
            "has_sig": false,
            "md5_digest": "2e231ed87ce7961aa79b2b63227e9cbc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 25317,
            "upload_time": "2023-03-19T03:18:15",
            "upload_time_iso_8601": "2023-03-19T03:18:15.933839Z",
            "url": "https://files.pythonhosted.org/packages/5a/b1/ebe391036ce1469cf33567fc4d28d15a1037d6068bd5d1943b444e007ecf/Remilia-2023.3.19.3.18.12.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-19 03:18:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "IAXRetailer",
    "github_project": "Remilia",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "colorama",
            "specs": []
        },
        {
            "name": "pyyaml",
            "specs": []
        }
    ],
    "lcname": "remilia"
}
        
Elapsed time: 0.12204s