From 7e7afe9772cb6dd27a9015f6139c6d9269875fa7 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 29 Nov 2019 21:18:01 +0100 Subject: [PATCH] k --- .gitignore | 38 +++++++++--- README.md | 22 ++++++- keipack/stars/api_kei.py | 22 ++++--- keipack/tables/keipeople.py | 19 ++++++ media/cat.png | Bin 0 -> 657 bytes media/cry.png | Bin 0 -> 648 bytes media/disappointed.png | Bin 0 -> 627 bytes media/dootflute.png | Bin 0 -> 665 bytes media/doottrumpet.png | Bin 0 -> 671 bytes media/grin.png | Bin 0 -> 658 bytes media/halflife.png | Bin 0 -> 648 bytes media/happy.png | Bin 0 -> 661 bytes media/key.png | Bin 0 -> 654 bytes media/keyface.png | Bin 0 -> 648 bytes media/neutral.png | Bin 0 -> 651 bytes media/question.png | Bin 0 -> 663 bytes media/smug.png | Bin 0 -> 643 bytes media/surprised.png | Bin 0 -> 648 bytes media/wink.png | Bin 0 -> 657 bytes media/worried.png | Bin 0 -> 661 bytes media/x.png | Bin 0 -> 668 bytes pyproject.toml | 51 ++++++++++++++++ requirements.txt | 3 - sample_config.toml | 112 ++++++++++++++++++++++++++++++++++++ setup.py | 24 -------- to_pypi.bat | 3 - to_pypi.sh | 15 ----- 27 files changed, 246 insertions(+), 63 deletions(-) create mode 100644 keipack/tables/keipeople.py create mode 100644 media/cat.png create mode 100644 media/cry.png create mode 100644 media/disappointed.png create mode 100644 media/dootflute.png create mode 100644 media/doottrumpet.png create mode 100644 media/grin.png create mode 100644 media/halflife.png create mode 100644 media/happy.png create mode 100644 media/key.png create mode 100644 media/keyface.png create mode 100644 media/neutral.png create mode 100644 media/question.png create mode 100644 media/smug.png create mode 100644 media/surprised.png create mode 100644 media/wink.png create mode 100644 media/worried.png create mode 100644 media/x.png create mode 100644 pyproject.toml delete mode 100644 requirements.txt create mode 100644 sample_config.toml delete mode 100644 setup.py delete mode 100644 to_pypi.bat delete mode 100644 to_pypi.sh diff --git a/.gitignore b/.gitignore index 68d69529..15ca555d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,31 @@ -config.ini -.idea/ -.vscode/ -__pycache__ -*.egg-info/ -.pytest_cache/ +# Royalnet ignores +config*.toml +downloads/ + + +# Python ignores +**/__pycache__/ dist/ -build/ -venv/ +*.egg-info/ +**/*.pyc + +# PyCharm ignores +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf +.idea/**/contentModel.xml +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml +.idea/**/gradle.xml +.idea/**/libraries +.idea/**/markdown-navigator.xml +.idea/**/markdown-exported-files.xml +.idea/**/misc.xml +.idea/**/*.iml \ No newline at end of file diff --git a/README.md b/README.md index 6fae0ea8..419c10fa 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,21 @@ -# `{packname}` [![PyPI](https://img.shields.io/pypi/v/{packname}.svg)](https://pypi.org/project/{packname}/) +# `keipack` [![PyPI](https://img.shields.io/pypi/v/keipack.svg)](https://pypi.org/project/keipack/) -{Replace everything surrounded by braces with your own data, including this description!} +## Emotions -{Files to be changed are the package folder, setup.py, to_pypi.sh and this README!} +- ![](./media/cat.png) cat +- ![](./media/cry.png) cry +- ![](./media/disappointed.png) disappointed +- ![](./media/dootflute.png) dootflute +- ![](./media/doottrumpet.png) doottrumpet +- ![](./media/grin.png) grin +- ![](./media/halflife.png) halflife +- ![](./media/happy.png) happy +- ![](./media/key.png) key +- ![](./media/keyface.png) keyface +- ![](./media/neutral.png) neutral +- ![](./media/question.png) question +- ![](./media/smug.png) smug +- ![](./media/surprised.png) surprised +- ![](./media/wink.png) wink +- ![](./media/worried.png) worried +- ![](./media/x.png) x \ No newline at end of file diff --git a/keipack/stars/api_kei.py b/keipack/stars/api_kei.py index 55fa7335..c1e15a79 100644 --- a/keipack/stars/api_kei.py +++ b/keipack/stars/api_kei.py @@ -1,18 +1,26 @@ +import random +import datetime +from typing import * from starlette.requests import Request from starlette.responses import * -from royalnet.web import * +from royalnet.constellation import * from royalnet.utils import * -import royalnet.packs.common.tables as cpt -import royalpack.tables as rpt class ApiKei(PageStar): path = "/api/kei" - tables = {} - - async def _generate(self, request: Request, session) -> typing.Tuple[str, str]: - return "happy", "Ciao!" + async def _generate(self, request, session) -> Tuple[str, str]: + if request.query_params.get("first", "false") == "true": + return random.sample([ + ("happy", "Ciao!"), + ("question", "Come va?"), + ("happy", "Sono al tuo servizio!"), + ("happy", "Attendo ordini!"), + ("happy", "Attendo ordini!"), + ("cat", "Mandami un messaggio :3"), + ], 1)[0] + return "x", "MISSINGNO." async def page(self, request: Request) -> JSONResponse: async with self.session_acm() as session: diff --git a/keipack/tables/keipeople.py b/keipack/tables/keipeople.py new file mode 100644 index 00000000..a26f52fd --- /dev/null +++ b/keipack/tables/keipeople.py @@ -0,0 +1,19 @@ +from sqlalchemy import * +from sqlalchemy.orm import relationship +from sqlalchemy.ext.declarative import declared_attr + + +class KeiPerson: + __tablename__ = "keipeople" + + @declared_attr + def user_id(self): + return Column(Integer, ForeignKey("users.uid"), primary_key=True) + + @declared_attr + def user(self): + return relationship("User", foreign_keys=self.user_id, backref="kei_people") + + @declared_attr + def game_id(self): + return Column(String, unique=True, primary_key=True) diff --git a/media/cat.png b/media/cat.png new file mode 100644 index 0000000000000000000000000000000000000000..fe59c62b24d435c7ef767947b0aaccc204de46d1 GIT binary patch literal 657 zcmV;C0&e|@P)EX>4Tx04R}tkv&MmKpe$iQ>CJn4ptCx$WWauh>AE$6^me@v=v%)FuC*#nlvOS zE{=k0!NHHks)LKOt`4q(Aou~|;_9U6A|?JWDYS_3;J6>}?mh0_0Yam~RI_UWP&La) z#baVNw<-o+(T72V5Qbl3rk+SIX5cx#?&0I>U6f~epZjz4D|wRvK9P8i>4rtTK|Hf* z>74h8!>lAJ#OK8023?T&k?XR{Z=8z`3p_JyWK#3QVPdh^!Ey()lA#h$6Gs$PqkJLj zvch?bvs$UK);;+PgL!Qw&2^e1h+_!}Bq2gZ4P{hdAxf)8iis5M$2|PQjz38*nOtQs zax9<<6_Voz|AXJ%nuV!JHz^ncx?gPjV-yJN0?oQ@e;?a+^91le16NwxUu^)hpQP8@ zTI2`_Z37qAZB5<-E_Z;TCtWfmNAlAY3I*W(jJ_!c4BP^}Yi@6?eVjf38R}~J1~@nb z#)_1^?(y!P&ffk#)9UXBHxY7=J2q%P00006VoOIv00000008+zyMF)x010qNS#tmY zE+YT{E+YYWr9XB6000McNliru;|moMCJuMkj12$)02y>eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{003!8L_t(I%e7Qn4!|G?Yl-*2a`&}F#Rm(le^^p!F%p81 zL<0aYp`cf!I~c$iXRe7|g96+jGT+R@R1;??fNe984{*m3f>u7m!Mg37R?VoLl1$1( r^s%m*q%8x~rM`;XUMqgJll)O0@Shke0mRuD00000NkvXXu0mjfAfF83 literal 0 HcmV?d00001 diff --git a/media/cry.png b/media/cry.png new file mode 100644 index 0000000000000000000000000000000000000000..fa90c1794dd1e2a778a48ef17d5accd290e6c847 GIT binary patch literal 648 zcmV;30(bq1P)EX>4Tx04R}tkv&MmKpe$iQ>CJn4ptCx$WWauh>AE$6^me@v=v%)FuC*#nlvOS zE{=k0!NHHks)LKOt`4q(Aou~|;_9U6A|?JWDYS_3;J6>}?mh0_0Yam~RI_UWP&La) z#baVNw<-o+(T72V5Qbl3rk+SIX5cx#?&0I>U6f~epZjz4D|wRvK9P8i>4rtTK|Hf* z>74h8!>lAJ#OK8023?T&k?XR{Z=8z`3p_JyWK#3QVPdh^!Ey()lA#h$6Gs$PqkJLj zvch?bvs$UK);;+PgL!Qw&2^e1h+_!}Bq2gZ4P{hdAxf)8iis5M$2|PQjz38*nOtQs zax9<<6_Voz|AXJ%nuV!JHz^ncx?gPjV-yJN0?oQ@e;?a+^91le16NwxUu^)hpQP8@ zTI2`_Z37qAZB5<-E_Z;TCtWfmNAlAY3I*W(jJ_!c4BP^}Yi@6?eVjf38R}~J1~@nb z#)_1^?(y!P&ffk#)9UXBHxY7=J2q%P00006VoOIv00000008+zyMF)x010qNS#tmY zE+YT{E+YYWr9XB6000McNliru;|moMCl49RjoJVJ02y>eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{003Y~L_t(I%k7j&4uCKW1IH2n|FStDb)gU`<%W-SI!!F4 z!kD5C08}9Of;0!6l=EULQd8iB*FnaY_0ZMe1sfF0Ogsm;@`Ul-oatcw$v8hG2k{Pw ivRjzp_EX>4Tx04R}tkv&MmKpe$iQ>CJn4ptCx$WWauh>AE$6^me@v=v%)FuC*#nlvOS zE{=k0!NHHks)LKOt`4q(Aou~|;_9U6A|?JWDYS_3;J6>}?mh0_0Yam~RI_UWP&La) z#baVNw<-o+(T72V5Qbl3rk+SIX5cx#?&0I>U6f~epZjz4D|wRvK9P8i>4rtTK|Hf* z>74h8!>lAJ#OK8023?T&k?XR{Z=8z`3p_JyWK#3QVPdh^!Ey()lA#h$6Gs$PqkJLj zvch?bvs$UK);;+PgL!Qw&2^e1h+_!}Bq2gZ4P{hdAxf)8iis5M$2|PQjz38*nOtQs zax9<<6_Voz|AXJ%nuV!JHz^ncx?gPjV-yJN0?oQ@e;?a+^91le16NwxUu^)hpQP8@ zTI2`_Z37qAZB5<-E_Z;TCtWfmNAlAY3I*W(jJ_!c4BP^}Yi@6?eVjf38R}~J1~@nb z#)_1^?(y!P&ffk#)9UXBHxY7=J2q%P00006VoOIv00000008+zyMF)x010qNS#tmY zE+YT{E+YYWr9XB6000McNliru;|moMCnj5Y6}A8X02y>eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{002u#L_t(I%k7jg4geqw0uST=zg$G2Qob{Iw}AF N002ovPDHLkV1o4u{R031 literal 0 HcmV?d00001 diff --git a/media/dootflute.png b/media/dootflute.png new file mode 100644 index 0000000000000000000000000000000000000000..6269673ae0604dd2ffe14ca065fd177d3fb0ef45 GIT binary patch literal 665 zcmV;K0%rY*P)EX>4Tx04R}tkv&MmKpe$iQ>CJn4ptCx$WWauh>AE$6^me@v=v%)FuC*#nlvOS zE{=k0!NHHks)LKOt`4q(Aou~|;_9U6A|?JWDYS_3;J6>}?mh0_0Yam~RI_UWP&La) z#baVNw<-o+(T72V5Qbl3rk+SIX5cx#?&0I>U6f~epZjz4D|wRvK9P8i>4rtTK|Hf* z>74h8!>lAJ#OK8023?T&k?XR{Z=8z`3p_JyWK#3QVPdh^!Ey()lA#h$6Gs$PqkJLj zvch?bvs$UK);;+PgL!Qw&2^e1h+_!}Bq2gZ4P{hdAxf)8iis5M$2|PQjz38*nOtQs zax9<<6_Voz|AXJ%nuV!JHz^ncx?gPjV-yJN0?oQ@e;?a+^91le16NwxUu^)hpQP8@ zTI2`_Z37qAZB5<-E_Z;TCtWfmNAlAY3I*W(jJ_!c4BP^}Yi@6?eVjf38R}~J1~@nb z#)_1^?(y!P&ffk#)9UXBHxY7=J2q%P00006VoOIv00000008+zyMF)x010qNS#tmY zE+YT{E+YYWr9XB6000McNliru;|moMCN;*~Whnpv02y>eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{0041GL_t(I%dJ#f4!|%70<-&HnSCwkV@@{bk4Yieij@$A zW*h(jHWYM;36A0pD8Xm4PK5rXdCX*YIr=gDeTbCOkq zCmNpxN{g#(xl`p-gzx^#$oJi`hpn{=nj7T=H+LK>)f4Bf00000NkvXXu0mjffPN4a literal 0 HcmV?d00001 diff --git a/media/doottrumpet.png b/media/doottrumpet.png new file mode 100644 index 0000000000000000000000000000000000000000..a88e0147a73a5695eb4eda69888482e06d1f8b6e GIT binary patch literal 671 zcmV;Q0$}}#P)EX>4Tx04R}tkv&MmKpe$iQ>CJn4ptCx$WWauh>AE$6^me@v=v%)FuC*#nlvOS zE{=k0!NHHks)LKOt`4q(Aou~|;_9U6A|?JWDYS_3;J6>}?mh0_0Yam~RI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Vjf38R}~J1~@nb z#)_1^?(y!P&ffk#)9UXBHxY7=J2q%P00006VoOIv00000008+zyMF)x010qNS#tmY zE+YT{E+YYWr9XB6000McNliru;|moMB|8d98|?r902y>eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{003%9L_t(I%e7QN4!|G`f@c5!GCM6%YfYOvj?y3nBOwS) zJOBVT6!eJ<2NRg%%nflEP=cF8)|+{7wQzEX>4Tx04R}tkv&MmKpe$iQ>CJn4ptCx$WWauh>AE$6^me@v=v%)FuC*#nlvOS zE{=k0!NHHks)LKOt`4q(Aou~|;_9U6A|?JWDYS_3;J6>}?mh0_0Yam~RI_UWP&La) z#baVNw<-o+(T72V5Qbl3rk+SIX5cx#?&0I>U6f~epZjz4D|wRvK9P8i>4rtTK|Hf* z>74h8!>lAJ#OK8023?T&k?XR{Z=8z`3p_JyWK#3QVPdh^!Ey()lA#h$6Gs$PqkJLj zvch?bvs$UK);;+PgL!Qw&2^e1h+_!}Bq2gZ4P{hdAxf)8iis5M$2|PQjz38*nOtQs zax9<<6_Voz|AXJ%nuV!JHz^ncx?gPjV-yJN0?oQ@e;?a+^91le16NwxUu^)hpQP8@ zTI2`_Z37qAZB5<-E_Z;TCtWfmNAlAY3I*W(jJ_!c4BP^}Yi@6?eVjf38R}~J1~@nb z#)_1^?(y!P&ffk#)9UXBHxY7=J2q%P00006VoOIv00000008+zyMF)x010qNS#tmY zE+YT{E+YYWr9XB6000McNliru;|moMCoH?H{HOo`02y>eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{003Y~L_t(I%iWa03V<*SLtl#j|I6_rC^+NFJek`_cr9(2 zFlJF309qgz>iS5*q!XeLRtD8{IC#}=-)|5f6-QNrSGUlp{p10{_`4M^AKUD3)!9x{ iKZ86ER$a*AkFo~ literal 0 HcmV?d00001 diff --git a/media/happy.png b/media/happy.png new file mode 100644 index 0000000000000000000000000000000000000000..58c0113e9628fa207014a06d2c63896002328013 GIT binary patch literal 661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-yJN0?oQ@e;?a+^91le16NwxUu^)hpQP8@ zTI2`_Z37qAZB5<-E_Z;TCtWfmNAlAY3I*W(jJ_!c4BP^}Yi@6?eVjf38R}~J1~@nb z#)_1^?(y!P&ffk#)9UXBHxY7=J2q%P00006VoOIv00000008+zyMF)x010qNS#tmY zE+YT{E+YYWr9XB6000McNliru;|moMB^pK`3$p+K02y>eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{003r5L_t(I%dON)4!|G?1kf4M`(JswYNAwAM#@^A;S&f! zXvPHqU_;P@6dzA9d>j_QAz3bxOHSnneuy~giB{7&NoEz%z7Mr>iohPpfLvq+d_YkK o?4B6Fdpg`et!1Ng3Yr(?20&aGEc$x@@Bjb+07*qoM6N<$g2opH2mk;8 literal 0 HcmV?d00001 diff --git a/media/keyface.png b/media/keyface.png new file mode 100644 index 0000000000000000000000000000000000000000..c3b66ec77af56f8f5327fec00d02b4b71b4a3833 GIT binary patch literal 648 zcmV;30(bq1P)EX>4Tx04R}tkv&MmKpe$iQ>CJn4ptCx$WWauh>AE$6^me@v=v%)FuC*#nlvOS zE{=k0!NHHks)LKOt`4q(Aou~|;_9U6A|?JWDYS_3;J6>}?mh0_0Yam~RI_UWP&La) z#baVNw<-o+(T72V5Qbl3rk+SIX5cx#?&0I>U6f~epZjz4D|wRvK9P8i>4rtTK|Hf* z>74h8!>lAJ#OK8023?T&k?XR{Z=8z`3p_JyWK#3QVPdh^!Ey()lA#h$6Gs$PqkJLj zvch?bvs$UK);;+PgL!Qw&2^e1h+_!}Bq2gZ4P{hdAxf)8iis5M$2|PQjz38*nOtQs zax9<<6_Voz|AXJ%nuV!JHz^ncx?gPjV-yJN0?oQ@e;?a+^91le16NwxUu^)hpQP8@ zTI2`_Z37qAZB5<-E_Z;TCtWfmNAlAY3I*W(jJ_!c4BP^}Yi@6?eVjf38R}~J1~@nb z#)_1^?(y!P&ffk#)9UXBHxY7=J2q%P00006VoOIv00000008+zyMF)x010qNS#tmY zE+Y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mh0_0Yam~RI_UWP&La) z#baVNw<-o+(T72V5Qbl3rk+SIX5cx#?&0I>U6f~epZjz4D|wRvK9P8i>4rtTK|Hf* z>74h8!>lAJ#OK8023?T&k?XR{Z=8z`3p_JyWK#3QVPdh^!Ey()lA#h$6Gs$PqkJLj zvch?bvs$UK);;+PgL!Qw&2^e1h+_!}Bq2gZ4P{hdAxf)8iis5M$2|PQjz38*nOtQs zax9<<6_Voz|AXJ%nuV!JHz^ncx?gPjV-yJN0?oQ@e;?a+^91le16NwxUu^)hpQP8@ zTI2`_Z37qAZB5<-E_Z;TCtWfmNAlAY3I*W(jJ_!c4BP^}Yi@6?eVjf38R}~J1~@nb z#)_1^?(y!P&ffk#)9UXBHxY7=J2q%P00006VoOIv00000008+zyMF)x010qNS#tmY zE+YT{E+YYWr9XB6000McNliru;|moMCI)#71U~=(02y>eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{003`EL_t(I%e7QN4!|G?Yl;8=a(7yyG6;^1BgFzOkr0Gt z3;+Nd47y3C#1gDw=88BKsDLdbduJw7ZJ6PMuuv0u0V9kM^t5MLSm#b=HLL5ijx8Fw xc!(o?q&JfUXYHD3ZI+X;mbcUWe|D$&qg+f@7cqm=&yxTE002ovPDHLkV1nqW45R=6 literal 0 HcmV?d00001 diff --git a/media/smug.png b/media/smug.png new file mode 100644 index 0000000000000000000000000000000000000000..c0ffa853419ac0b80c964bd301adc25840c114d5 GIT binary patch literal 643 zcmV-}0(||6P)EX>4Tx04R}tkv&MmKpe$iQ>CJn4ptCx$WWauh>AE$6^me@v=v%)FuC*#nlvOS zE{=k0!NHHks)LKOt`4q(Aou~|;_9U6A|?JWDYS_3;J6>}?mh0_0Yam~RI_UWP&La) z#baVNw<-o+(T72V5Qbl3rk+SIX5cx#?&0I>U6f~epZjz4D|wRvK9P8i>4rtTK|Hf* z>74h8!>lAJ#OK8023?T&k?XR{Z=8z`3p_JyWK#3QVPdh^!Ey()lA#h$6Gs$PqkJLj zvch?bvs$UK);;+PgL!Qw&2^e1h+_!}Bq2gZ4P{hdAxf)8iis5M$2|PQjz38*nOtQs zax9<<6_Voz|AXJ%nuV!JHz^ncx?gPjV-yJN0?oQ@e;?a+^91le16NwxUu^)hpQP8@ zTI2`_Z37qAZB5<-E_Z;TCtWfmNAlAY3I*W(jJ_!c4BP^}Yi@6?eVjf38R}~J1~@nb z#)_1^?(y!P&ffk#)9UXBHxY7=J2q%P00006VoOIv00000008+zyMF)x010qNS#tmY zE+YT{E+YYWr9XB6000McNliru;|moMCmwTqttbEh02y>eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{003J_L_t(I%gvNQ4uCKS1ZSK6|I6#egVl&tNaG%XOcnwN zW0L9sC_ykZ3RD8=XKRBrmut60$5@mboJ7Obf|>jk;`s$z(2n1^xGtOaq9>3d$j4(W dyq)An*#PWv5GJLRwrBtV002ovPDHLkV1n@72k-y@ literal 0 HcmV?d00001 diff --git a/media/surprised.png b/media/surprised.png new file mode 100644 index 0000000000000000000000000000000000000000..727d39d5bea97095e81b234d8c4d1e00d213bd69 GIT binary patch literal 648 zcmV;30(bq1P)EX>4Tx04R}tkv&MmKpe$iQ>CJn4ptCx$WWauh>AE$6^me@v=v%)FuC*#nlvOS zE{=k0!NHHks)LKOt`4q(Aou~|;_9U6A|?JWDYS_3;J6>}?mh0_0Yam~RI_UWP&La) z#baVNw<-o+(T72V5Qbl3rk+SIX5cx#?&0I>U6f~epZjz4D|wRvK9P8i>4rtTK|Hf* z>74h8!>lAJ#OK8023?T&k?XR{Z=8z`3p_JyWK#3QVPdh^!Ey()lA#h$6Gs$PqkJLj zvch?bvs$UK);;+PgL!Qw&2^e1h+_!}Bq2gZ4P{hdAxf)8iis5M$2|PQjz38*nOtQs zax9<<6_Voz|AXJ%nuV!JHz^ncx?gPjV-yJN0?oQ@e;?a+^91le16NwxUu^)hpQP8@ zTI2`_Z37qAZB5<-E_Z;TCtWfmNAlAY3I*W(jJ_!c4BP^}Yi@6?eVjf38R}~J1~@nb z#)_1^?(y!P&ffk#)9UXBHxY7=J2q%P00006VoOIv00000008+zyMF)x010qNS#tmY zE+YT{E+YYWr9XB6000McNliru;|moMCKhD76k7lQ02y>eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{003Y~L_t(I%hi!V4gett16$(%zuY}-qN0RE4%#Cn)eeLp z9I62Tc#xn!q#F!k&NH{fZb1oe2$^4I@TEX>4Tx04R}tkv&MmKpe$iQ>CJn4ptCx$WWauh>AE$6^me@v=v%)FuC*#nlvOS zE{=k0!NHHks)LKOt`4q(Aou~|;_9U6A|?JWDYS_3;J6>}?mh0_0Yam~RI_UWP&La) z#baVNw<-o+(T72V5Qbl3rk+SIX5cx#?&0I>U6f~epZjz4D|wRvK9P8i>4rtTK|Hf* z>74h8!>lAJ#OK8023?T&k?XR{Z=8z`3p_JyWK#3QVPdh^!Ey()lA#h$6Gs$PqkJLj zvch?bvs$UK);;+PgL!Qw&2^e1h+_!}Bq2gZ4P{hdAxf)8iis5M$2|PQjz38*nOtQs zax9<<6_Voz|AXJ%nuV!JHz^ncx?gPjV-yJN0?oQ@e;?a+^91le16NwxUu^)hpQP8@ zTI2`_Z37qAZB5<-E_Z;TCtWfmNAlAY3I*W(jJ_!c4BP^}Yi@6?eVjf38R}~J1~@nb z#)_1^?(y!P&ffk#)9UXBHxY7=J2q%P00006VoOIv00000008+zyMF)x010qNS#tmY zE+YT{E+YYWr9XB6000McNliru;|moMCo$NnkZ}M202y>eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{003!8L_t(I%e7L=4!|G?D}?|5@5OI!+hHjwheF2lu)ox2CIb2xfMN=Jj`*a-cF&^aR9y&z rC5jqW73U*jFXZU7@M}BKYUKkLcXAahIf37100000NkvXXu0mjfZ_N$a literal 0 HcmV?d00001 diff --git a/media/worried.png b/media/worried.png new file mode 100644 index 0000000000000000000000000000000000000000..cec081645e95272ad18d0f680ae8ed59976ebbcc GIT binary patch literal 661 zcmV;G0&4wEX>4Tx04R}tkv&MmKpe$iQ>CJn4ptCx$WWauh>AE$6^me@v=v%)FuC*#nlvOS zE{=k0!NHHks)LKOt`4q(Aou~|;_9U6A|?JWDYS_3;J6>}?mh0_0Yam~RI_UWP&La) z#baVNw<-o+(T72V5Qbl3rk+SIX5cx#?&0I>U6f~epZjz4D|wRvK9P8i>4rtTK|Hf* z>74h8!>lAJ#OK8023?T&k?XR{Z=8z`3p_JyWK#3QVPdh^!Ey()lA#h$6Gs$PqkJLj zvch?bvs$UK);;+PgL!Qw&2^e1h+_!}Bq2gZ4P{hdAxf)8iis5M$2|PQjz38*nOtQs zax9<<6_Voz|AXJ%nuV!JHz^ncx?gPjV-yJN0?oQ@e;?a+^91le16NwxUu^)hpQP8@ zTI2`_Z37qAZB5<-E_Z;TCtWfmNAlAY3I*W(jJ_!c4BP^}Yi@6?eVjf38R}~J1~@nb z#)_1^?(y!P&ffk#)9UXBHxY7=J2q%P00006VoOIv00000008+zyMF)x010qNS#tmY zE+YT{E+YYWr9XB6000McNliru;|moMCLQx>&C>t?02y>eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{003=CL_t(I%dJ$=4gettg4X~4GWT>_WjZ$VQ5Xd}2|;Mq z1OTw1pkHKZY()DqacNo!-1 vO>`~IRDgc}zVR^L6r6{_HZRHtbj=ts$<2u-00000NkvXXu0mjf|2PkU literal 0 HcmV?d00001 diff --git a/media/x.png b/media/x.png new file mode 100644 index 0000000000000000000000000000000000000000..c9074ff3efaaf699bebb6cd839c5f2d7f21a00fc GIT binary patch literal 668 zcmV;N0%QG&P)EX>4Tx04R}tkv&MmKpe$iQ>CJn4ptCx$WWauh>AE$6^me@v=v%)FuC*#nlvOS zE{=k0!NHHks)LKOt`4q(Aou~|;_9U6A|?JWDYS_3;J6>}?mh0_0Yam~RI_UWP&La) z#baVNw<-o+(T72V5Qbl3rk+SIX5cx#?&0I>U6f~epZjz4D|wRvK9P8i>4rtTK|Hf* z>74h8!>lAJ#OK8023?T&k?XR{Z=8z`3p_JyWK#3QVPdh^!Ey()lA#h$6Gs$PqkJLj zvch?bvs$UK);;+PgL!Qw&2^e1h+_!}Bq2gZ4P{hdAxf)8iis5M$2|PQjz38*nOtQs zax9<<6_Voz|AXJ%nuV!JHz^ncx?gPjV-yJN0?oQ@e;?a+^91le16NwxUu^)hpQP8@ zTI2`_Z37qAZB5<-E_Z;TCtWfmNAlAY3I*W(jJ_!c4BP^}Yi@6?eVjf38R}~J1~@nb z#)_1^?(y!P&ffk#)9UXBHxY7=J2q%P00006VoOIv00000008+zyMF)x010qNS#tmY zE+YT{E+YYWr9XB6000McNliru;|moMCkThH7eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{004AJL_t(I%dJ#f4!|%70@M3nnSCwkL#>PBvsj8~N(e#| z0|3B=f?kp7U;%5K9Yvf9RNxko{beSuHqP(^EX+h_fDuOs^7"] + license = "AGPL-3.0+" + readme = "README.md" + homepage = "https://github.com/Steffo99/keipack" + classifiers = [ + "Development Status :: 3 - Alpha", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3.8", + "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)" + ] + +# Library dependencies +[tool.poetry.dependencies] + python = "^3.8" + + riotwatcher = "^2.7.1" + + [tool.poetry.dependencies.royalnet] + git = "https://github.com/Steffo99/royalnet/" + # Maybe... there is a way to make these selectable? + extras = [ + "telegram", + "discord", + "alchemy_easy", + "bard", + "constellation", + "sentry", + "herald", + "coloredlogs" + ] + +# Development dependencies +[tool.poetry.dev-dependencies] + + + +# Optional dependencies +[tool.poetry.extras] + + + + +[build-system] + requires = ["poetry>=0.12"] + build-backend = "poetry.masonry.api" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index faa4e12f..00000000 --- a/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -starlette -royalnet -royalpack \ No newline at end of file diff --git a/sample_config.toml b/sample_config.toml new file mode 100644 index 00000000..fc2feb99 --- /dev/null +++ b/sample_config.toml @@ -0,0 +1,112 @@ +# ROYALNET CONFIGURATION FILE + +[Herald] +# Enable the herald module, allowing different parts of Royalnet to talk to each other +# Requires the `herald` extra to be installed +enabled = true + +[Herald.Local] +# Run locally a Herald web server (websocket) that other parts of Royalnet can connect to +enabled = true +# The address of the network interface on which the Herald server should listen for connections +# If 0.0.0.0, listen for connections on all interfaces +# If 127.0.0.1, listen only for connections coming from the local machine +address = "0.0.0.0" +# The port on which the Herald server should run +port = 44444 +# A password required to connect to the local Herald server +secret = "CHANGE-ME" +# Use HTTPS instead of HTTP for Herald connections +secure = false # Not supported yet! +# Use a different HTTP path for Herald connections +path = "/" # Different values aren't supported yet + +[Herald.Remote] +# Connect to a remote Herald web server (websocket) +# Requires the `herald` extra to be installed +enabled = false +# The address of the remote Herald server +address = "0.0.0.0" +# The port of the remote Herald server +port = 44444 +# The password required to connect to the remote Herald server +secret = "CHANGE-ME" +# Use HTTPS instead of HTTP for Herald connections +secure = false # Not supported yet! +# Use a different HTTP path for Herald connections +path = "/" # Different values aren't supported yet + + +[Alchemy] +# Use the Alchemy module of Royalnet to connect to a PostgreSQL server +# Requires either the `alchemy_easy` or the `alchemy_hard` extras to be installed +enabled = true +# The URL of the database you want to connect to, in sqlalchemy format: +# https://docs.sqlalchemy.org/en/13/core/engines.html#database-urls +database_url = "postgresql://username:password@host:port/database" + +[Constellation] +# Run locally a Constellation web server (uvicorn+starlette) serving the Stars contained in the enabled Packs +# Requires the `constellation` extra to be installed +enabled = true +# The address of the network interface on which the Constellation should listen for requests +# If 0.0.0.0, listen for requests on all interfaces +# If 127.0.0.1, listen only for requests coming from the local machine +address = "0.0.0.0" +# The port on which the Constellation should run +port = 44445 + +[Serfs] + +[Serfs.Telegram] +# Use the Telegram Serf (python-telegram-bot) included in Royalnet +# Requires the `telegram` extra to be installed +enabled = true +# The Bot API Token of the bot you want to use for Royalnet +# Obtain one at https://t.me/BotFather +token = "0000000000:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" +# The size of the Connection Pool used by python-telegram-bot +# 8 should be fine, but if you start getting `TimeoutError: QueuePool limit of size X overflow Y reached" errors, +# increasing this number should fix them +pool_size = 8 +# The maximum amount of time to wait for a response from Telegram before raising a `TimeoutError` +# It also is the time that python-telegram-bot will wait before sending a new request if no updates are being received. +read_timeout = 60 + +[Serfs.Discord] +# Use the Discord Serf (discord.py) included in Royalnet +# Requires the `discord` extra to be installed +enabled = true +# The Discord Bot Token of the bot you want to use for Royalnet +# Obtain one at https://discordapp.com/developers/applications/ > Bot > Token +token = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" + +[Logging] +# Print to stderr all logging events of an equal or greater level than this +# Possible values are "DEBUG", "INFO", "WARNING", "ERROR", "FATAL" +log_level = "INFO" +# Optional: install the `coloredlogs` extra for colored output! + +[Sentry] +# Connect Royalnet to a https://sentry.io/ project for error logging +# Requires the `sentry` extra to be installed +enabled = false +# Get one at https://sentry.io/settings/YOUR-ORG/projects/YOUR-PROJECT/keys/ +dsn = "https://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@sentry.io/1111111" + +[Packs] +# The Python package name of the Packs you want to be usable in Royalnet +# Please note that the `royalnet.backpack` Pack should always be available! +active = [ + "royalnet.backpack", # DO NOT REMOVE THIS OR THINGS WILL BREAK + # "yourpack", + +] + +# Configuration settings for specific packs +[Packs."royalnet.backpack"] +# Enable exception debug commands and stars +exc_debug = false + +# Add your packs config here! +# [Packs."yourpack"] diff --git a/setup.py b/setup.py deleted file mode 100644 index ea6869cf..00000000 --- a/setup.py +++ /dev/null @@ -1,24 +0,0 @@ -import setuptools - -with open("README.md", "r") as f: - long_description = f.read() - -with open("requirements.txt", "r") as f: - install_requires = f.readlines() - -setuptools.setup( - name="keipack", - version="0.1", - author="Stefano Pigozzi", - author_email="ste.pigozzi@gmail.com", - description="A mysterious AI assistant", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/Steffo99/keipack", - packages=setuptools.find_packages(), - install_requires=install_requires, - python_requires=">=3.7", - classifiers=[ - "Programming Language :: Python :: 3.7", - ], -) diff --git a/to_pypi.bat b/to_pypi.bat deleted file mode 100644 index beb035bc..00000000 --- a/to_pypi.bat +++ /dev/null @@ -1,3 +0,0 @@ -del /f /q /s dist\*.* -python setup.py sdist bdist_wheel -twine upload dist/* diff --git a/to_pypi.sh b/to_pypi.sh deleted file mode 100644 index 253edea9..00000000 --- a/to_pypi.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# Set me to your pack name! -PACKNAME="{packname}" - -# Royalnet must be installed with `develop` -VERSION=$(python3.7 -m "$PACKNAME.version") - -rm -rf dist -python setup.py sdist bdist_wheel -twine upload "dist/$PACKNAME-$VERSION"* -git add * -git commit -m "$VERSION" -git push -hub release create --message "Version $VERSION" --prerelease "$VERSION"