From c3bcbc2681748a4daea803dfed20fdb83b7a3546 Mon Sep 17 00:00:00 2001 From: retoor Date: Tue, 3 Dec 2024 18:49:12 +0100 Subject: [PATCH] Update comment. --- dist/devranta-1.0.0-py3-none-any.whl | Bin 4005 -> 4024 bytes dist/devranta-1.0.0.tar.gz | Bin 3249 -> 3337 bytes src/devranta/api.py | 22 +++++++++++++++------- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/dist/devranta-1.0.0-py3-none-any.whl b/dist/devranta-1.0.0-py3-none-any.whl index 991dda92f367ca51852818b526cf5f2a4cf68c64..ff6f93956a1613e0237e6e461b36187be8ab4bc8 100644 GIT binary patch delta 2041 zcmZuyc{CJy8=l3^Sj#fjn8`%4b=4#-7^a43+|o?QF1gn1n#N4)wZs@&5KYETG}eeK zWhtUzjKWx=P^K)+XheOZd(QXu-E)8EyyrRRJksPFaY`6i9c0Iwx6ea{toHU%#^B-1eV_CdJ9si!t)hXs<6TQl>ZQd`k*cCM;XU{cjT;Sx? z%tW395w{SygW#|wXM3APfQZ(;yB~Y~eCb0o8?XbTy4+@~o3Om&Lw@jEsS>=PIs-@X-gWffz46KDFYc}`3@4_@b59nf{jl@VNh`BAb2i5N*iuoi7ZqFr z9}V1)e3Y*LxG$Bde1e{G)oj_Vq5C;d&nnNEceL?%T|({XW?H223x))oJ*0PT#Tk5aj7dT4Q#x z5$ip){EE{p-%9#{!dz%38QY|pD6KnBuatywRGhAJl1Z*?t5Os`mM0Hfv8j-8U}^M* z>w&_k+JOH4?k*?=7-v8PW4cFGjjcnR7Md?VHuHI|w$OAhUz#VK?g1Y0R0A1Fyf55v zNUR@hMEw|A9=@6SB)d@eA?UN(jvN}SWVENOz2=pNC^Y)>$GV&M7PWdj` z@61_iH^SnUb?HzePxyMjR1JsgVEkH4`Q+0HiACE{M6|zi3qo;Pv@(RUKT3pyiqm>i zui$K{EnBhZtD%51RC-rA&7yg|==z0po<)8yxY$%>Ve`ibK}$MIk^?U22V} zcr!?d)ON|6n}C;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66|2N%|VcS!=Co&n8YI5CCu0fho=OpH0OA(JwVy4qdModRmZyw6@HE(Z= zuHnBrE_y^^fx#FyyIju$O$(I9oS0mXbDaX%f36am-3=b zIiN4yFpD6$krt_uY4xOe;>jqZ{BdZ4GbyHj6^@y|w?kdS=c62Azrdr#b~P83+cix! zS<0?;tw;x#=1A;dD(tmT)Js~_HO>W0Vn}>IU_8`{p1^x`5LgEC-zK9d!{k9!iYZJT z#HCz;9fnYoO>!LITK}^BU&--$?)#!rI$;Rj=DSsD#)*&*Z7%;)>wDzg4IROy_^qe~0lu_u+*z PS(1_@ZX~cPdcge!dQ5(W diff --git a/dist/devranta-1.0.0.tar.gz b/dist/devranta-1.0.0.tar.gz index 16cd308f8ba470f1d747b214cd65827f7b1fddf6..cd76c72a963062917c1ab15b32c814f58bb21ac1 100644 GIT binary patch literal 3337 zcmaKtX*d*o+r}-)PDzLuYqBeQmbp=u@+8^Uu_m&Ibd#|al15JrA3W(7D~yFLMP0!8Zuob%>KJDm}=a0lgG2R&?G(IeMg6e zZ)Cr~YnmK#RXfB1ADw36N@%d#)r%1G2`k@!7D&P5H96An3o#(3I}-&BAMd zCm5i~oq_cYh<2q5IM``L05|laCx~oyo2Q-ZEpH~x{z)MwX`oXDzHbOXVv%^#mm53w zZwYg-!y6OLZoI({P2W8Gwl;1)?Q!f>_T@@VE0g*$Wk^n)oslc!UeL8&@&4hDkZy1L zbh}=nbvR#?JO2>yuDufU^`~n;BUco_)5~9-LKn)! zu2`+YE=>zwS$ulqUc6*{bC^rF#rZqW7Ah~9d>~-T*pWJUef(qBNGGxVRdrBXC(q9! zxzqI`Z*UiNRNe%JTE6HSwUxgxi1=7370WR3u*oEzW4oIn39;^XvB>Nv%#_hCE)#+5 zGs9hXs!bwl*?#hlZgM5W(L)@|K3_Q`xuunRxy;VqtwJvOoYR#u zY9|!7r|E-g?kDOg67LG+`sHpRuf!io6e~zt-_h6Qfrszsg-rdOd(I!DOcSb{;c#eT z$-l5PsG8Uw-Z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cp)WHx3s@IZY~({ZTdq z+J?cQAr;nUQf9i1RAup8C~!F4PfTlLoi7iOc=zzIj-`SiXCIQnf13OHcV%LcvYYGbZn$gJ|qoV$=nGwqCm6SrdbW)NC6l(kuZ1`T1)K zTmh><9BtS;ER1lv@Dxy250GxRe@~{t&bqoe4=nNcPDhtA{ZIIfzMxPSR7Bg}ngS!4 czy3lGx>V!0|BuclR=^yq@q>xs8w10C0F17^{Qv*} diff --git a/src/devranta/api.py b/src/devranta/api.py index 3b314fc..0e1b876 100644 --- a/src/devranta/api.py +++ b/src/devranta/api.py @@ -15,8 +15,6 @@ class Api: self.token_Key = None self.session = None - - def patch_auth(self, request_dict=None): auth_dict = {"app": self.app_id} if self.auth: @@ -70,7 +68,7 @@ class Api: async def get_comments_from_user(self, username): user_id = await self.get_user_id(username) profile = await self.get_profile(user_id) - return profile.get('content',{}).get('content',{}).get('comments',[]) + return profile.get("content", {}).get("content", {}).get("comments", []) async def post_comment(self, rant_id, comment): response = None @@ -92,7 +90,6 @@ class Api: ) obj = await response.json() - print(obj) if not obj.get("success"): return None @@ -140,7 +137,6 @@ class Api: if not obj.get("success"): return return obj.get("rants", []) - async def get_user_id(self, username): response = None @@ -156,7 +152,20 @@ class Api: @property async def mentions(self): - return [notif for notif in (await self.notifs) if notif['type'] == "comment_mention"] + return [ + notif for notif in (await self.notifs) if notif["type"] == "comment_mention" + ] + + async def update_comment(self, comment_id, comment): + response = None + if not await self.ensure_login(): + return None + async with self as session: + response = await session.get( + url=self.patch_url(f"comments/{comment_id}"), + data=self.patch_auth({"comment": comment}), + ) + return await response.get("success", False) @property async def notifs(self): @@ -168,4 +177,3 @@ class Api: url=self.patch_url("users/me/notif-feed"), params=self.patch_auth() ) return (await response.json()).get("data", {}).get("items", []) -