Putting everything inside the package dir for publishing

This commit is contained in:
simonwt 2026-04-02 16:24:51 +01:00
parent 636564b873
commit 1bf4246989
38 changed files with 13 additions and 15 deletions

View file

@ -1 +0,0 @@
import apiclient

View file

@ -1,7 +1,7 @@
"""
Demonstrate basic usage
"""
from apiclient import APIClient
from trustcafeapiwrapper import APIClient
import os, simplejson as json
# Handle environment variables
@ -46,9 +46,9 @@ def save_response(response):
# print("-----------Get a user profile----------------")
# profile = API.run_job('userprofile.get', "simon-little")
# print(profile)
print("-----------Get a user profile----------------")
profile = API.run_job('userprofile.get', "simon-little")
print(profile)
# print("-------------- Get a branch -----------------")
# branch = API.run_job('branch.get', "music")
# print(branch)
@ -135,7 +135,7 @@ def save_response(response):
# save_response(API.run_job('post.listall'))
# save_response(API.run_job('post.listpublic'))
from wrappers.post.create_post import create_post
from trustcafeapiwrapper.wrappers.post.create_post import create_post
# save_response(create_post(
# post_text="This is a test post created via the create_post wrapper function.",
@ -156,6 +156,6 @@ from wrappers.post.create_post import create_post
# )
# save_response(API.run_job(**wrapped))
# save_response(API.wrapped(create_post(
# "This is a test post created via the create_post wrapper function.",
# )))
save_response(API.wrapped(create_post(
"This is a test post created via the create_post wrapper function.",
)))

View file

@ -0,0 +1 @@
from .apiclient import APIClient

View file

@ -1,5 +1,3 @@
import os
import token
import requests
import simplejson as json
from urllib.parse import urlencode
@ -140,7 +138,7 @@ class APIClient(BaseModel):
if isinstance(job_function, str):
# Dynamically import the job function from the jobs module
module_name, func_name = job_function.rsplit('.', 1)
module = __import__(f"jobs.{module_name}", fromlist=[func_name])
module = __import__(f"trustcafeapiwrapper.jobs.{module_name}", fromlist=[func_name])
job_func = getattr(module, func_name)
else:
job_func = job_function

View file

@ -1,6 +1,6 @@
from utils.get_parent_pksk_from_path import get_parent_pksk_from_path
from utils.get_post_pksk import get_post_pksk
from trustcafeapiwrapper.utils.get_parent_pksk_from_path import get_parent_pksk_from_path
from trustcafeapiwrapper.utils.get_post_pksk import get_post_pksk
def create_comment(comment_text, post_slug, parent_path, blur_label=None, version=3):
"""
Creates a new comment.

View file

@ -1,4 +1,4 @@
from utils.get_parent_pksk_from_path import get_parent_pksk_from_path
from trustcafeapiwrapper.utils.get_parent_pksk_from_path import get_parent_pksk_from_path
def create_post(post_text, parent_path='/', blur_label=None, card_url=None, collaborative=False):
"""