gazu 1.0.1__py2.py3-none-any.whl → 1.0.2__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
gazu/user.py CHANGED
@@ -352,3 +352,319 @@ def update_filter(filter, client=default):
352
352
  return raw.put(
353
353
  "data/user/filters/%s" % filter["id"], filter, client=client
354
354
  )
355
+
356
+
357
+ @cache
358
+ def get_context(client=default):
359
+ """
360
+ Get user context.
361
+
362
+ Returns:
363
+ dict: User context information.
364
+ """
365
+ return raw.get("data/user/context", client=client)
366
+
367
+
368
+ @cache
369
+ def all_project_assets(project, client=default):
370
+ """
371
+ Get assets for which user has tasks assigned for given project.
372
+
373
+ Args:
374
+ project (dict / ID): The project dict or id.
375
+
376
+ Returns:
377
+ list: Assets for the project.
378
+ """
379
+ project = normalize_model_parameter(project)
380
+ path = "user/projects/%s/assets" % project["id"]
381
+ return raw.fetch_all(path, client=client)
382
+
383
+
384
+ @cache
385
+ def all_tasks_requiring_feedback(client=default):
386
+ """
387
+ Get tasks requiring feedback from the current user.
388
+
389
+ Returns:
390
+ list: Tasks requiring feedback.
391
+ """
392
+ return raw.fetch_all("user/tasks-requiring-feedback", client=client)
393
+
394
+
395
+ @cache
396
+ def all_filter_groups(client=default):
397
+ """
398
+ Get all filter groups for current user.
399
+
400
+ Returns:
401
+ list: Filter groups.
402
+ """
403
+ return raw.fetch_all("user/filter-groups", client=client)
404
+
405
+
406
+ def new_filter_group(name, project=None, client=default):
407
+ """
408
+ Create a new filter group for current user.
409
+
410
+ Args:
411
+ name (str): The filter group name.
412
+ project (dict / ID): The project dict or id.
413
+
414
+ Returns:
415
+ dict: Created filter group.
416
+ """
417
+ project_id = (
418
+ normalize_model_parameter(project)["id"]
419
+ if project is not None
420
+ else None
421
+ )
422
+ return raw.post(
423
+ "data/user/filter-groups",
424
+ {"name": name, "project_id": project_id},
425
+ client=client,
426
+ )
427
+
428
+
429
+ @cache
430
+ def get_filter_group(filter_group, client=default):
431
+ """
432
+ Get a filter group.
433
+
434
+ Args:
435
+ filter_group (dict / ID): The filter group dict or id.
436
+
437
+ Returns:
438
+ dict: Filter group.
439
+ """
440
+ filter_group = normalize_model_parameter(filter_group)
441
+ return raw.fetch_one(
442
+ "user/filter-groups", filter_group["id"], client=client
443
+ )
444
+
445
+
446
+ def update_filter_group(filter_group, client=default):
447
+ """
448
+ Update a filter group.
449
+
450
+ Args:
451
+ filter_group (dict): Filter group to save.
452
+
453
+ Returns:
454
+ dict: Updated filter group.
455
+ """
456
+ return raw.put(
457
+ "data/user/filter-groups/%s" % filter_group["id"],
458
+ filter_group,
459
+ client=client,
460
+ )
461
+
462
+
463
+ def remove_filter_group(filter_group, client=default):
464
+ """
465
+ Remove given filter group from database.
466
+
467
+ Args:
468
+ filter_group (dict / ID): The filter group dict or id.
469
+ """
470
+ filter_group = normalize_model_parameter(filter_group)
471
+ return raw.delete(
472
+ "data/user/filter-groups/%s" % filter_group["id"], client=client
473
+ )
474
+
475
+
476
+ @cache
477
+ def all_desktop_login_logs(client=default):
478
+ """
479
+ Get desktop login logs for current user.
480
+
481
+ Returns:
482
+ list: Desktop login logs.
483
+ """
484
+ return raw.fetch_all("user/desktop-login-logs", client=client)
485
+
486
+
487
+ @cache
488
+ def get_time_spents_by_date(date, client=default):
489
+ """
490
+ Get time spents for a specific date.
491
+
492
+ Args:
493
+ date (str): Date in YYYY-MM-DD format.
494
+
495
+ Returns:
496
+ list: Time spents for the date.
497
+ """
498
+ return raw.get("data/user/time-spents/by-date", params={"date": date}, client=client)
499
+
500
+
501
+ @cache
502
+ def get_task_time_spent(task, client=default):
503
+ """
504
+ Get time spent for a specific task.
505
+
506
+ Args:
507
+ task (dict / ID): The task dict or id.
508
+
509
+ Returns:
510
+ dict: Time spent information for the task.
511
+ """
512
+ task = normalize_model_parameter(task)
513
+ path = "data/user/tasks/%s/time-spent" % task["id"]
514
+ return raw.get(path, client=client)
515
+
516
+
517
+ @cache
518
+ def get_day_off(client=default):
519
+ """
520
+ Get day off information for current user.
521
+
522
+ Returns:
523
+ dict: Day off information.
524
+ """
525
+ return raw.get("data/user/day-off", client=client)
526
+
527
+
528
+ @cache
529
+ def all_notifications(client=default):
530
+ """
531
+ Get all notifications for current user.
532
+
533
+ Returns:
534
+ list: Notifications.
535
+ """
536
+ return raw.fetch_all("user/notifications", client=client)
537
+
538
+
539
+ @cache
540
+ def get_notification(notification, client=default):
541
+ """
542
+ Get a specific notification.
543
+
544
+ Args:
545
+ notification (dict / ID): The notification dict or id.
546
+
547
+ Returns:
548
+ dict: Notification.
549
+ """
550
+ notification = normalize_model_parameter(notification)
551
+ return raw.fetch_one(
552
+ "user/notifications", notification["id"], client=client
553
+ )
554
+
555
+
556
+ def update_notification(notification, client=default):
557
+ """
558
+ Update a notification.
559
+
560
+ Args:
561
+ notification (dict): Notification to save.
562
+
563
+ Returns:
564
+ dict: Updated notification.
565
+ """
566
+ return raw.put(
567
+ "data/user/notifications/%s" % notification["id"],
568
+ notification,
569
+ client=client,
570
+ )
571
+
572
+
573
+ @cache
574
+ def check_task_subscription(task, client=default):
575
+ """
576
+ Check if user is subscribed to a task.
577
+
578
+ Args:
579
+ task (dict / ID): The task dict or id.
580
+
581
+ Returns:
582
+ dict: Subscription status.
583
+ """
584
+ task = normalize_model_parameter(task)
585
+ path = "data/user/tasks/%s/subscription" % task["id"]
586
+ return raw.get(path, client=client)
587
+
588
+
589
+ def subscribe_to_task(task, client=default):
590
+ """
591
+ Subscribe to a task.
592
+
593
+ Args:
594
+ task (dict / ID): The task dict or id.
595
+
596
+ Returns:
597
+ dict: Subscription information.
598
+ """
599
+ task = normalize_model_parameter(task)
600
+ path = "data/user/tasks/%s/subscribe" % task["id"]
601
+ return raw.post(path, {}, client=client)
602
+
603
+
604
+ def unsubscribe_from_task(task, client=default):
605
+ """
606
+ Unsubscribe from a task.
607
+
608
+ Args:
609
+ task (dict / ID): The task dict or id.
610
+ """
611
+ task = normalize_model_parameter(task)
612
+ path = "data/user/tasks/%s/unsubscribe" % task["id"]
613
+ return raw.delete(path, client=client)
614
+
615
+
616
+ @cache
617
+ def all_chats(client=default):
618
+ """
619
+ Get all chats for current user.
620
+
621
+ Returns:
622
+ list: Chats.
623
+ """
624
+ return raw.fetch_all("user/chats", client=client)
625
+
626
+
627
+ def join_chat(chat, client=default):
628
+ """
629
+ Join a chat.
630
+
631
+ Args:
632
+ chat (dict / ID): The chat dict or id.
633
+
634
+ Returns:
635
+ dict: Chat information.
636
+ """
637
+ chat = normalize_model_parameter(chat)
638
+ path = "data/user/chats/%s/join" % chat["id"]
639
+ return raw.post(path, {}, client=client)
640
+
641
+
642
+ def leave_chat(chat, client=default):
643
+ """
644
+ Leave a chat.
645
+
646
+ Args:
647
+ chat (dict / ID): The chat dict or id.
648
+ """
649
+ chat = normalize_model_parameter(chat)
650
+ path = "data/user/chats/%s/leave" % chat["id"]
651
+ return raw.delete(path, client=client)
652
+
653
+
654
+ def clear_avatar(client=default):
655
+ """
656
+ Clear user avatar.
657
+
658
+ Returns:
659
+ Response: Request response object.
660
+ """
661
+ return raw.delete("data/user/avatar", client=client)
662
+
663
+ def mark_all_notifications_as_read(client=default):
664
+ """
665
+ Mark all notifications as read for current user.
666
+
667
+ Returns:
668
+ dict: Response information.
669
+ """
670
+ return raw.post("data/user/notifications/read-all", {}, client=client)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gazu
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: Gazu is a client for Zou, the API to store the data of your CG production.
5
5
  Home-page: https://gazu.cg-wire.com/
6
6
  Author: CG Wire
@@ -12,8 +12,6 @@ Classifier: Environment :: Web Environment
12
12
  Classifier: Framework :: Flask
13
13
  Classifier: Intended Audience :: Developers
14
14
  Classifier: Natural Language :: English
15
- Classifier: Programming Language :: Python :: 2.7
16
- Classifier: Programming Language :: Python :: 3.6
17
15
  Classifier: Programming Language :: Python :: 3.7
18
16
  Classifier: Programming Language :: Python :: 3.8
19
17
  Classifier: Programming Language :: Python :: 3.9
@@ -26,10 +24,10 @@ Classifier: Programming Language :: Python :: Implementation :: PyPy
26
24
  Classifier: Topic :: Multimedia :: Graphics
27
25
  Requires-Python: >= 2.7, != 3.0.*, != 3.1.*, != 3.2.*, != 3.3.*, != 3.4.*, != 3.5.*, != 3.6.1, != 3.6.2
28
26
  License-File: LICENSE
29
- Requires-Dist: python-socketio[client]<6,>=5.11.0; python_version != "2.7"
27
+ Requires-Dist: python-socketio[client]<6,>=5.11.0
30
28
  Requires-Dist: requests>=2.25.1
31
29
  Requires-Dist: Deprecated==1.3.1
32
- Requires-Dist: pywin32>=308; sys_platform == "win32" and python_version != "2.7"
30
+ Requires-Dist: pywin32>=308; sys_platform == "win32"
33
31
  Provides-Extra: dev
34
32
  Requires-Dist: wheel; extra == "dev"
35
33
  Provides-Extra: test
@@ -1,5 +1,5 @@
1
1
  gazu/__init__.py,sha256=KPAVnFOSbzZnd24ItkZEOv7yQ5w0Pv7k1TFmL8saiqY,2594
2
- gazu/__version__.py,sha256=d4QHYmS_30j0hPN8NmNPnQ_Z0TphDRbu4MtQj9cT9e8,22
2
+ gazu/__version__.py,sha256=Y3LSfRioSl2xch70pq_ULlvyECXyEtN3krVaWeGyaxk,22
3
3
  gazu/asset.py,sha256=ZAc8F-7GPQTU_nVcUpH_xSVf58k6TXudlP6XnFc_LJk,14686
4
4
  gazu/cache.py,sha256=MnxrnfYN7wHNTTL7qzkEpYCYzWcolT56fqQ0_RegMbE,5879
5
5
  gazu/casting.py,sha256=0LTdsHaCTHSKEflBWFeuraSaYNYetGkMHAIdg6Lv81U,5059
@@ -8,22 +8,23 @@ gazu/concept.py,sha256=GcOPEmkbtZcSwlX8tnUj9Q5DTPBprSxtmXhlq7ioPwk,3727
8
8
  gazu/context.py,sha256=iUyug8EUz3kkF-kmYlH5JuLp66TUqR3uhAq7CouVd_U,4349
9
9
  gazu/edit.py,sha256=v6Zqbk2tiZlwjHhlzPPbR8GJwfWn7X3GU9LzN-cpHSw,4623
10
10
  gazu/encoder.py,sha256=dj8U5mlGVy0GeaA7HIIdPSRdKswUQ8h4DzjFKLhwvR0,394
11
- gazu/entity.py,sha256=Pbc_sbgo8RhQV88nksP1whHyWL4hVyHR3CZ0sVplPY4,3670
12
- gazu/events.py,sha256=6TFd2ZVPI4IujLU_GlwEcNbPaEisD6i2nnyt44U3Jr8,2215
11
+ gazu/entity.py,sha256=p0ZvvRvAjj_B7dOn-pi8_zot_23L9YCsuCsDLPD9d4M,4007
12
+ gazu/events.py,sha256=4j8wbF4K-f5Kyu_jI4bklS12huzAN0cjCdY4hcKyhuk,2221
13
13
  gazu/exception.py,sha256=Y0kVNm6h-uXLEU1sNIbMSUep7Zxk738uYHOIVs2waM8,1880
14
14
  gazu/files.py,sha256=tEKXY43JRNb00W6IPSt8SWlKtFtk3LI3FfbKTe26aao,40702
15
15
  gazu/helpers.py,sha256=Qa4JlZitiXsfYMJGGuwVaedLvHQVMbIwcqEZ099EjMw,3916
16
- gazu/person.py,sha256=Heqi3BRPheNXtvP8DRy4QJNPboAQwOrwUe_OrPtc-nQ,11434
17
- gazu/playlist.py,sha256=fzrhVY0fhxp5rSlvrowZPWEOqdl4rEYD4TKmnuvyKHg,6740
18
- gazu/project.py,sha256=wqA3-C1LeS3MsMP198pSapH-47FA8V9ciIaq0Q_OBNw,12662
16
+ gazu/person.py,sha256=jmJ1fdtJKIUqAzTv-wngxSJ_fpbiyTLYu5w9rGATaKw,16480
17
+ gazu/playlist.py,sha256=JntIAJf9-cqF5fV85VU-J15fC9aladQx_77qg3XU8W0,10928
18
+ gazu/project.py,sha256=teHqfJldOO6pJWKm6_dkO-JpPdSmKbj0i4jYxCipL8o,23945
19
19
  gazu/scene.py,sha256=Q4AVmiMfGhSZfaXwOceyR-taTlpx1WCELe0UBSiHm8o,5357
20
+ gazu/search.py,sha256=ZUeRChEMgnOTnNV_xIhXQia3xXcWG3ro1Sl9ZbYnLtY,1045
20
21
  gazu/shot.py,sha256=_cSqm_TvvDnezA5gZTrMf5_RqVLic39bp0IGFwewuy8,18937
21
22
  gazu/sorting.py,sha256=qSIO0pOHkj0Tl4gm9BJrYrcifWGGGmsW68Pl86zB_bg,266
22
23
  gazu/sync.py,sha256=3clThVFC9pSIQiCyVkNRPnlbYQDA2kfR-lxaWxHbeUk,21611
23
- gazu/task.py,sha256=CsWS5II9b4Pbe4fcLt3HmUTvUD1hvZw7Uulqcp4W2_Y,38645
24
- gazu/user.py,sha256=wu99hYgrv6ZbE7EgIku2fZP-IX_sVoXxSj0hXqzEZS0,9557
25
- gazu-1.0.1.dist-info/licenses/LICENSE,sha256=2n6rt7r999OuXp8iOqW9we7ORaxWncIbOwN1ILRGR2g,7651
26
- gazu-1.0.1.dist-info/METADATA,sha256=jMwXx91Jrr3lO1vBAucO6Kdd2E_m2tEdE0UVl3sXssc,5491
27
- gazu-1.0.1.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
28
- gazu-1.0.1.dist-info/top_level.txt,sha256=nv7fRIVpYYyIlk_66hBmMyvWcSC7UU-r-GE8uC1u1Go,5
29
- gazu-1.0.1.dist-info/RECORD,,
24
+ gazu/task.py,sha256=hCGWz2T323s-E_v70_dfv4vWC-faIG_2lW6ifi08JgM,48217
25
+ gazu/user.py,sha256=NxHVzmX3KrVqai3WDHzvYlR97ME7tOpYYr99l_WRsck,16502
26
+ gazu-1.0.2.dist-info/licenses/LICENSE,sha256=2n6rt7r999OuXp8iOqW9we7ORaxWncIbOwN1ILRGR2g,7651
27
+ gazu-1.0.2.dist-info/METADATA,sha256=_AXERmqlGCHGS-anUqemJkVXmvuWhfFL-0jIQJVJHC4,5338
28
+ gazu-1.0.2.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
29
+ gazu-1.0.2.dist-info/top_level.txt,sha256=nv7fRIVpYYyIlk_66hBmMyvWcSC7UU-r-GE8uC1u1Go,5
30
+ gazu-1.0.2.dist-info/RECORD,,
File without changes