Skip to content

Commit

Permalink
Merge branch 'refactor' into 'main'
Browse files Browse the repository at this point in the history
refactor libtimed

See merge request arthurd/libtimed!1
  • Loading branch information
c0rydoras committed Jul 7, 2023
2 parents 841ee97 + a37aea1 commit ede9187
Show file tree
Hide file tree
Showing 11 changed files with 351 additions and 217 deletions.
6 changes: 3 additions & 3 deletions examples/activities.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
token = oidc_client.authorize()
client = TimedAPIClient(token, URL, API_NAMESPACE)

attributes = {"comment": "made with libtimed"}
relationships = {"task": "3605343"}
r = client.activities.start(attributes, relationships)
r = client.activities.start(attributes={"comment": "Made with libtimed!"})
print(r.json())
time.sleep(7)
r = client.activities.stop()
print(r.json())
13 changes: 12 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ packages = [{ include = "libtimed", from = "src" }]
python = "^3.11"
requests = "^2.31.0"
keyring = "^24.1.0"
inflection = "^0.5.1"


[tool.poetry.group.dev.dependencies]
Expand All @@ -24,6 +25,7 @@ pdbpp = "^0.10.3"



# Dependencies only used in examples
[tool.poetry.group.example.dependencies]
pyfzf = "^0.3.1"

Expand Down
6 changes: 3 additions & 3 deletions src/libtimed/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ def __init__(self, token, url, api_namespace):
self.session.headers["Content-Type"] = "application/vnd.api+json"

# Models
self.users: models.Users = models.Users(self)
self.reports: models.Reports = models.Reports(self)
self.overtime: models.Overtime = models.Overtime(self)
self.users = models.Users(self)
self.reports = models.Reports(self)
self.overtime = models.WorktimeBalances(self)
self.activities = models.Activities(self)
self.customers = models.Customers(self)
self.tasks = models.Tasks(self)
Expand Down
Loading

0 comments on commit ede9187

Please sign in to comment.