boris-behav-obs 8.27.10__py2.py3-none-any.whl → 9.0.1__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.
Files changed (105) hide show
  1. boris/about.py +7 -5
  2. boris/add_modifier.py +35 -35
  3. boris/add_modifier_ui.py +229 -129
  4. boris/advanced_event_filtering.py +3 -3
  5. boris/analysis_plugins/__init__.py +0 -0
  6. boris/analysis_plugins/number_of_occurences.py +60 -0
  7. boris/analysis_plugins/number_of_occurences_by_independent_variable.py +72 -0
  8. boris/analysis_plugins/time_budget.py +95 -0
  9. boris/behav_coding_map_creator.py +103 -108
  10. boris/behavior_binary_table.py +1 -1
  11. boris/behaviors_coding_map.py +8 -8
  12. boris/coding_pad.py +6 -6
  13. boris/config.py +6 -0
  14. boris/config_file.py +1 -1
  15. boris/connections.py +4 -2
  16. boris/converters.py +2 -3
  17. boris/converters_ui.py +187 -110
  18. boris/cooccurence.py +2 -2
  19. boris/core.py +340 -94
  20. boris/core_qrc.py +16088 -13246
  21. boris/core_ui.py +922 -812
  22. boris/dialog.py +14 -13
  23. boris/duration_widget.py +5 -5
  24. boris/edit_event.py +1 -1
  25. boris/edit_event_ui.py +162 -88
  26. boris/event_operations.py +4 -25
  27. boris/events_cursor.py +17 -9
  28. boris/events_snapshots.py +5 -5
  29. boris/exclusion_matrix.py +1 -1
  30. boris/export_events.py +38 -28
  31. boris/export_observation.py +1 -1
  32. boris/external_processes.py +3 -5
  33. boris/geometric_measurement.py +49 -26
  34. boris/gui_utilities.py +31 -30
  35. boris/import_observations.py +2 -4
  36. boris/irr.py +1 -1
  37. boris/latency.py +1 -1
  38. boris/map_creator.py +77 -89
  39. boris/measurement_widget.py +4 -4
  40. boris/media_file.py +2 -4
  41. boris/menu_options.py +1 -3
  42. boris/modifiers_coding_map.py +4 -4
  43. boris/mpv2.py +0 -2
  44. boris/observation.py +124 -29
  45. boris/observation_operations.py +18 -40
  46. boris/observation_ui.py +566 -374
  47. boris/observations_list.py +6 -6
  48. boris/param_panel.py +2 -2
  49. boris/param_panel_ui.py +246 -141
  50. boris/player_dock_widget.py +16 -21
  51. boris/plot_data_module.py +6 -6
  52. boris/plot_events_rt.py +7 -8
  53. boris/plot_spectrogram_rt.py +7 -8
  54. boris/plot_waveform_rt.py +6 -7
  55. boris/plugins.py +79 -0
  56. boris/preferences.py +127 -17
  57. boris/preferences_ui.py +464 -240
  58. boris/project.py +69 -72
  59. boris/project_functions.py +233 -31
  60. boris/project_import_export.py +59 -67
  61. boris/project_ui.py +672 -440
  62. boris/qrc_boris.py +6 -3
  63. boris/qrc_boris5.py +6 -3
  64. boris/select_modifiers.py +2 -2
  65. boris/select_observations.py +2 -2
  66. boris/select_subj_behav.py +3 -3
  67. boris/state_events.py +1 -1
  68. boris/subjects_pad.py +5 -5
  69. boris/synthetic_time_budget.py +2 -2
  70. boris/time_budget_functions.py +15 -0
  71. boris/time_budget_widget.py +4 -4
  72. boris/transitions.py +34 -25
  73. boris/utilities.py +95 -2
  74. boris/version.py +2 -2
  75. boris/video_equalizer.py +4 -4
  76. boris/video_equalizer_ui.py +199 -130
  77. boris/video_operations.py +1 -1
  78. boris/view_df.py +106 -0
  79. boris/view_df_ui.py +75 -0
  80. boris/write_event.py +9 -1
  81. {boris_behav_obs-8.27.10.dist-info → boris_behav_obs-9.0.1.dist-info}/METADATA +5 -5
  82. boris_behav_obs-9.0.1.dist-info/RECORD +103 -0
  83. {boris_behav_obs-8.27.10.dist-info → boris_behav_obs-9.0.1.dist-info}/WHEEL +1 -1
  84. boris/qdarkstyle/__init__.py +0 -479
  85. boris/qdarkstyle/__main__.py +0 -66
  86. boris/qdarkstyle/colorsystem.py +0 -38
  87. boris/qdarkstyle/dark/__init__.py +0 -1
  88. boris/qdarkstyle/dark/darkstyle_rc.py +0 -11379
  89. boris/qdarkstyle/dark/palette.py +0 -38
  90. boris/qdarkstyle/example/__init__.py +0 -4
  91. boris/qdarkstyle/example/__main__.py +0 -386
  92. boris/qdarkstyle/example/ui/__init__.py +0 -4
  93. boris/qdarkstyle/light/__init__.py +0 -1
  94. boris/qdarkstyle/light/lightstyle_rc.py +0 -11305
  95. boris/qdarkstyle/light/palette.py +0 -37
  96. boris/qdarkstyle/palette.py +0 -102
  97. boris/qdarkstyle/utils/__init__.py +0 -73
  98. boris/qdarkstyle/utils/__main__.py +0 -96
  99. boris/qdarkstyle/utils/images.py +0 -449
  100. boris/qdarkstyle/utils/scss.py +0 -318
  101. boris/vlc_local.py +0 -83
  102. boris_behav_obs-8.27.10.dist-info/RECORD +0 -114
  103. {boris_behav_obs-8.27.10.dist-info → boris_behav_obs-9.0.1.dist-info}/LICENSE.TXT +0 -0
  104. {boris_behav_obs-8.27.10.dist-info → boris_behav_obs-9.0.1.dist-info}/entry_points.txt +0 -0
  105. {boris_behav_obs-8.27.10.dist-info → boris_behav_obs-9.0.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,103 @@
1
+ boris/__init__.py,sha256=vEqzYsbV0DwIWYPXIv3OXrBBFW71dpYRSL63Dedv4xE,773
2
+ boris/__main__.py,sha256=_cKab_aODdiWYjyf6mWu57D-84izlVDPAm13QxH-cCg,764
3
+ boris/about.py,sha256=3QDMrGZnhJZYLKKaoLp22uPduWjsqWAOHRYVWWkaNR4,5366
4
+ boris/add_modifier.py,sha256=YP8F5lhrNA6mPHgpcKgXb9TUDsBaiFte5OcFZnTbMM4,26340
5
+ boris/add_modifier_ui.py,sha256=1kvUH64js2TS7tzp1ioaytTZt0bDKZo5BcMqU6Ju0eY,11470
6
+ boris/advanced_event_filtering.py,sha256=WOEwS5LgInG3mIqzYVZHSJr2rxLZCbearThxV03wnyM,15184
7
+ boris/behav_coding_map_creator.py,sha256=A-wn9-3uA8p0hVkYgq7VD2_-jMUENx-NdahbavNJuOI,37443
8
+ boris/behavior_binary_table.py,sha256=ahrNQK4Uc-j948c625e2O7pyavu-Mzkp3Y2LM7a9vu8,11677
9
+ boris/behaviors_coding_map.py,sha256=FMdn_Q8pjFWeeHR093uqPp0AnE5sbipU4DYvz52CNeg,7291
10
+ boris/boris_cli.py,sha256=CeUr_QKKySu9v-Gw5fkeQPjA3y_dGv7_Y4tCY41OeoA,13196
11
+ boris/cmd_arguments.py,sha256=dNMEvMgTRMadC1Oz5IXw4JEBJw8Tq4yCo4yuRCnNfXc,1848
12
+ boris/coding_pad.py,sha256=ptY4DRLJb4Ny06ZOdbCh_E12xiKatOwFWCGac1atKJE,10986
13
+ boris/config.py,sha256=wKdmsHsJfg1VoWZh3EVywMaQI9D8tq9Ai7P9CqhhI78,16938
14
+ boris/config_file.py,sha256=Hc1z-E4Pk_ediWe3rtZDi2YgNwky821laxh_IuK2TvY,13521
15
+ boris/connections.py,sha256=23tolOXp7-RJbikxGaO8Wjdvb0_tCMoakInrULDP7dg,19294
16
+ boris/converters.py,sha256=6ibgXkXIm3lv9mRez9VjFm-NiEZLGX9snGIPekTsXPg,11722
17
+ boris/converters_ui.py,sha256=uu7LOBV_fKv2DBdOqsqPwjGsjgONr5ODBoscAA-EP48,9900
18
+ boris/cooccurence.py,sha256=O1Usid6RrP6OTyt99FM_6WTKRpsUM9h_SC6hQJV9O78,9826
19
+ boris/core.py,sha256=SO_yplMLrQgUYEceaA9nPCOYQSk8RtK1gpoQhmAQDQg,233905
20
+ boris/core_qrc.py,sha256=T3ki5e2Pj0I0QBGz63MPUgZzl8F_VHZwSq074mRNBDU,650669
21
+ boris/core_ui.py,sha256=SeC26uveDCjrCBLsRPuQ6FaapKfON_HIRcQStEDLhl4,76384
22
+ boris/db_functions.py,sha256=4BTRXxAeXYOFsBpnHhtdZ5HC7MaNjWLdkcM-kmlY0ng,13352
23
+ boris/dev.py,sha256=9pUElbjl9g17rFUJXX5aVSu55_iIKIuDxNdrB0DI_d0,3671
24
+ boris/dialog.py,sha256=MOSLiRxa8DnFiV1_23GjqO1-VX5RA7_5FY8oDoA8Seo,41231
25
+ boris/duration_widget.py,sha256=GjZgCAMGOcsNjoPiRImEVe6yMkH2vuNoh44ulpd5nlg,6924
26
+ boris/edit_event.py,sha256=8csLHLmdQco5apKRQHNkKcyTKBS-ZyGWPCWCpodWKAI,7580
27
+ boris/edit_event_ui.py,sha256=vhglQrhkF9tt0HVlkXnkG7symW0eOFA7nhbk6l_qn3k,7772
28
+ boris/event_operations.py,sha256=rzsO2fAi9q1xmkhgQ5wCWPf19y4aV-7fMNcBMwy_D_I,37830
29
+ boris/events_cursor.py,sha256=aSRR2XtlILvCoXWRQIKAjQfq4KZGD65_cGmkg0MehHw,2078
30
+ boris/events_snapshots.py,sha256=2haL-WRGBcguq9uwJjWoJRa9wJw1zzuP76uZifQHK00,27561
31
+ boris/exclusion_matrix.py,sha256=4s0rosJyuwizUeeY4pesamjm0pY8ZaQvdPw25z8KRKE,5272
32
+ boris/export_events.py,sha256=1MCuO212_o52HqkbAiURqhfd21M8lKXyDrOfaWpWAn0,38282
33
+ boris/export_observation.py,sha256=LvAkIWdtT4dHl_jYzexkXys6jm3zGXD7vqE2m1pyXCA,49827
34
+ boris/external_processes.py,sha256=A99mR74lTqkAYbGBf8phaVlpcYtoXOdLMnKWCxr78Gc,11927
35
+ boris/geometric_measurement.py,sha256=iVrsSH_tWfumzJXgZAySBPP93PHv4JiTPSzh108WTuE,35049
36
+ boris/gui_utilities.py,sha256=GZjH5TnjDtvXZieGi6qybjqmkflSY1p209ADhWS5m5I,4170
37
+ boris/image_overlay.py,sha256=bxEHEr5p6nH_sgXRSGEWlJZJF7R07ItgHNM4_3kXTJA,2527
38
+ boris/import_observations.py,sha256=oBx8nExbcp2DYpy0L7XYrTZhfOyVR9OmhOiWa4ie9JQ,8798
39
+ boris/irr.py,sha256=8_4oU32zK-7IeqbckCx_-jx-On1H4VnQuZ6cmzrRsB8,22472
40
+ boris/latency.py,sha256=8zTw3STVC1UaqmePy9kngn7HTyNvGbXREuHZ99vZGr0,9739
41
+ boris/map_creator.py,sha256=3oHsSkM_BrsfmlrJuPoPwXWrmCB2ZgoJqjd91eqHroQ,29053
42
+ boris/measurement_widget.py,sha256=UjSEBGvEyhF7yrZ4xUGb9wwjp_H9RHs-3gjxEWiTLQg,4480
43
+ boris/media_file.py,sha256=6cpEgP1jGF34l1Czr6xYst7tQdVuF9zHhR1yfLilnuA,4722
44
+ boris/menu_options.py,sha256=ihBWtBJMxCFRxC1H3OKQeNIBMQC1S6GIMUDxB76vC8I,7062
45
+ boris/modifiers_coding_map.py,sha256=9rYhDKD6Jd8AwUH52fpC1zTlPClO6AVzH0workGEQGQ,4564
46
+ boris/mpv-1.0.3.py,sha256=EXRtzQqFjOn4wMC6482Ilq3fNQ9N1GRP1VxwLzdeaBY,88077
47
+ boris/mpv.py,sha256=EfzIHjPbgewG4w3smEtqEUPZoVwYmMQkL4Q8ZyW-a58,76410
48
+ boris/mpv2.py,sha256=IUI4t4r9GYX7G5OXTjd3RhMMOkDdfal_15buBgksLsk,92152
49
+ boris/observation.py,sha256=_uxVJ-4VfOkFzbKOLrGL1cC-TFcavAtgR6uRjyWA7RQ,57176
50
+ boris/observation_operations.py,sha256=AK_obGAgqm92UMyP-rEMRB6KxfnoekGfScoxFgRR-KY,99532
51
+ boris/observation_ui.py,sha256=DAnU94QBNvkLuHT6AxTwqSk_D_n6VUhSl8PexZv_dUk,33309
52
+ boris/observations_list.py,sha256=KjKxkAF1pHdZyF6tVicVwnKEgP0AHfXGszCd6iQ57NU,10587
53
+ boris/otx_parser.py,sha256=Ul5GokK46azx60P6-pk8wbSPUqUR9O4WLV42z3rE40s,16367
54
+ boris/param_panel.py,sha256=3suLHQr1B9XVss4VZmCnb-_etkflfBIQ5_AxHgw_9Gg,7872
55
+ boris/param_panel_ui.py,sha256=ggV5jM4aq1pOmPLNg7J-2r5gsjrq9zSnXtxoLqIZ76g,12963
56
+ boris/player_dock_widget.py,sha256=o2P25s7TocdBlF3oNqkt0DD-er5zVX4WGt3aWLFSfg8,5881
57
+ boris/plot_data_module.py,sha256=Tb0wNdy9e1087w4J9dsZxCM2nO5wmJkxyTS6Rj0I43k,16562
58
+ boris/plot_events.py,sha256=HAKrdS3qf0A_PG1pGo0FRyk62femDxfxGss3w8CrlUw,23541
59
+ boris/plot_events_rt.py,sha256=m7sDd-52zFlHfn4ohMp2zjRr22UOdiTqrHXMT2yWek0,8327
60
+ boris/plot_spectrogram_rt.py,sha256=D6hh9NLNFteVM2WVqENvALfzgHlRjvNgTipGPV1-EdA,8361
61
+ boris/plot_waveform_rt.py,sha256=L5JTpfMoH2nydRbrbQ3TSPQt0kT83towDiJVI6CqNs4,7474
62
+ boris/plugins.py,sha256=Ru6ht4QwI8Bgj7mxeZDbfRVY-d1OHabAFiMmhiSSp8A,2809
63
+ boris/preferences.py,sha256=XJ8APhbyW8CKRU-43v73vC7XwaOurCW2VewZA4A3VwU,16552
64
+ boris/preferences_ui.py,sha256=TIcQsF4Ttrj6RAFB4HNsyHoy4bjiaAOFd8jNBzZecuM,25878
65
+ boris/project.py,sha256=pWdMvW0GGhCTbFOg9J-mrv3hTm2FTVMXhysBR0RWJwE,84377
66
+ boris/project_functions.py,sha256=kxuLc87nS-ILUdhtV3dyI8-XFZEvBmrtuHZjCU5SWS4,79156
67
+ boris/project_import_export.py,sha256=-kqeNskGuBbpp80czdlPjRuOcIam-NMti3Us5F10CnM,38387
68
+ boris/project_ui.py,sha256=yB-ewhHt8S8DTTRIk-dNK2tPMNU24lNji9fDW_Xazu8,38805
69
+ boris/qrc_boris.py,sha256=aH-qUirYY1CGxmTK1SFCPvuZfazIHX4DdUKF1gxZeYM,675008
70
+ boris/qrc_boris5.py,sha256=prnOw7VGXWXRuVCYp_yIrmWhrlG1F9rx-3BQvkPenjY,161608
71
+ boris/select_modifiers.py,sha256=T1GG8AAL0v-DNSSssPDXREsxun2dkZW7VRLIfl2kX7I,13319
72
+ boris/select_observations.py,sha256=md0QSIvElfPkTAq_B9hlshLHkaT9380GENaUpGRxz0o,7944
73
+ boris/select_subj_behav.py,sha256=y2a91S4X3yUWjRuCgt8AegYLf915Aj9ro1Fjwqiz36c,10930
74
+ boris/state_events.py,sha256=KD5TTyLqxla-NHnIteb9ec5EegIXEeUMCwknLuUpGRk,7770
75
+ boris/subjects_pad.py,sha256=R5hpS6ONHi4L3THz-mUKc7MkTI9ZBTPkH4UvWpfUbfU,3541
76
+ boris/synthetic_time_budget.py,sha256=AYVEMRZ7O3UdPMak-nHn-P9wDT9__nX4YT5DXIhUKpE,9956
77
+ boris/time_budget_functions.py,sha256=pTPYnDO6t4tKn2MWAvvsDSzcljhcN-7ORzcx0Sipcuo,52022
78
+ boris/time_budget_widget.py,sha256=zjKb14JGrOU7FeE1lq_ICYhUxmoGZGUVSkPqVTSDkSs,42460
79
+ boris/transitions.py,sha256=JvtxwQr1ijuPMqtPQcpDFDcdMAP6dfXTa2u7OlmtAPE,12250
80
+ boris/utilities.py,sha256=IaoPCIpt4rSRrWjEWDN8jnSczVZPEHlZvyAqBilo6G8,52708
81
+ boris/version.py,sha256=5ttC1vVs4mDC25RJfQRYwwunfUWQTieAb4G-KXMFq08,787
82
+ boris/video_equalizer.py,sha256=CRqPm2WcS4037ffLeMiguZQKq9tltLvPHzOMJjf_6MM,5854
83
+ boris/video_equalizer_ui.py,sha256=1CG3s79eM4JAbaCx3i1ILZXLceb41_gGXlOLNfpBgnw,10142
84
+ boris/video_operations.py,sha256=IoMoUvZx39JtooFfYAQ9bgYOXusD04gDMDCjCtXhj0k,9381
85
+ boris/view_df.py,sha256=AKScLASX2Uatw7rqPbsnio83eVT4GZYCFhL091eMvlY,3370
86
+ boris/view_df_ui.py,sha256=CaMeRH_vQ00CTDDFQn73ZZaS-r8BSTWpL-dMCFqzJ_Q,2775
87
+ boris/write_event.py,sha256=BH2_TAP1J-szygEenoIfgVJ8jM2Iezya0rodXFL-JyQ,23835
88
+ boris/analysis_plugins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
89
+ boris/analysis_plugins/number_of_occurences.py,sha256=5gjdibPEvGU8bfYMaM2IJ-zCy2_IBRYDfbetwPc0Qew,1929
90
+ boris/analysis_plugins/number_of_occurences_by_independent_variable.py,sha256=UR9N3OBAGHbSAcGGJm2yi4CGgHt1oGYCB5sDLkAOxRI,2192
91
+ boris/analysis_plugins/time_budget.py,sha256=oVTFUrAvhND9WX-hLMlYTi2yI3MMKg1hRwvpGkJ1k0Q,3441
92
+ boris/portion/__init__.py,sha256=ZBUG4I7YWhRkeWdP-JEpxhxldJlUYQkeaJseTjdhtJE,602
93
+ boris/portion/const.py,sha256=hEp26BKcEg1Js4DfZsBHmDtJJts83Tl1HWQ0CNJNwEc,1588
94
+ boris/portion/dict.py,sha256=SyHxc7PfDw2ufNLFQycwJtzmRfL48rDp4UrM2KN7IWc,11282
95
+ boris/portion/func.py,sha256=3TkQtFKLfsqntwd27HSGHceFhnXHmT-EbNMqktElC5Q,2174
96
+ boris/portion/interval.py,sha256=bAdUiJjGeUAPgsBAImwNeviiwfQq5odfhFZccAWzOTA,20299
97
+ boris/portion/io.py,sha256=ppNeRpiLNrocF1yzGeuEUIhYMf2LfsR-cji3d0nmvUs,6371
98
+ boris_behav_obs-9.0.1.dist-info/LICENSE.TXT,sha256=WJ7YI-moTFb-uVrFjnzzhGJrnL9P2iqQe8NuED3hutI,35141
99
+ boris_behav_obs-9.0.1.dist-info/METADATA,sha256=Q-scOhsoMA1ZEt2GghCXF1CeTpCT5_TxhX-jaaQdTyA,42102
100
+ boris_behav_obs-9.0.1.dist-info/WHEEL,sha256=9Hm2OB-j1QcCUq9Jguht7ayGIIZBRTdOXD1qg9cCgPM,109
101
+ boris_behav_obs-9.0.1.dist-info/entry_points.txt,sha256=-Vl37ZFjZYK5wTSDf5LAzd2cVLON1Pfy1xkx490Wxak,47
102
+ boris_behav_obs-9.0.1.dist-info/top_level.txt,sha256=fJSgm62S7WesiwTorGbOO4nNN0yzgZ3klgfGi3Px4qI,6
103
+ boris_behav_obs-9.0.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.1.0)
2
+ Generator: setuptools (75.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any
@@ -1,479 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
-
3
- """The most complete dark/light style sheet for Qt applications (Qt4, Qt5,
4
- PySide, PySide2, PyQt4, PySide6, PyQt5, PyQt6, QtPy, PyQtGraph, Qt.Py) for
5
- Python 2/3 and C++.
6
-
7
- Python 2, as well as Qt4 (PyQt4 and PySide), will not be supported anymore.
8
- They are still there as it is, but no back-compatibility, fixes, nor features
9
- will be implemented.
10
-
11
-
12
- Check the `documentation <https://qdarkstylesheet.readthedocs.io/en/stable>`__
13
- to see how to set the desirable theme palette.
14
-
15
- This module provides a function to load the stylesheets transparently
16
- with the right resources file.
17
-
18
- First, start importing our module
19
-
20
- .. code-block:: python
21
-
22
- import qdarkstyle
23
-
24
- Then you can get the stylesheet provided by QDarkStyle for various Qt wrappers
25
- as shown below
26
-
27
- .. code-block:: python
28
-
29
- # PySide 2
30
- dark_stylesheet = qdarkstyle.load_stylesheet_pyside2()
31
- # PyQt5
32
- dark_stylesheet = qdarkstyle.load_stylesheet_pyqt5()
33
- # PySide 6
34
- dark_stylesheet = qdarkstyle.load_stylesheet_pyside6()
35
- # PyQt6
36
- dark_stylesheet = qdarkstyle.load_stylesheet_pyqt6()
37
-
38
- Alternatively, from environment variables provided by QtPy, PyQtGraph, Qt.Py
39
-
40
- .. code-block:: python
41
-
42
- # QtPy
43
- dark_stylesheet = qdarkstyle.load_stylesheet()
44
- # PyQtGraph
45
- dark_stylesheet = qdarkstyle.load_stylesheet(qt_api=os.environ('PYQTGRAPH_QT_LIB'))
46
- # Qt.Py
47
- dark_stylesheet = qdarkstyle.load_stylesheet(qt_api=Qt.__binding__)
48
-
49
- Finally, set your QApplication with it
50
-
51
- .. code-block:: python
52
-
53
- app.setStyleSheet(dark_stylesheet)
54
-
55
- Enjoy!
56
-
57
- """
58
-
59
- # Standard library imports
60
- import logging
61
- import os
62
- import platform
63
- import sys
64
- import warnings
65
-
66
- # Local imports
67
- from qdarkstyle.dark.palette import DarkPalette
68
- from qdarkstyle.light.palette import LightPalette
69
- from qdarkstyle.palette import Palette
70
-
71
- __version__ = "3.2.3"
72
-
73
- _logger = logging.getLogger(__name__)
74
-
75
- # Base directory paths
76
- REPO_PATH = os.path.dirname(os.path.abspath(os.path.dirname(__file__)))
77
- EXAMPLE_PATH = os.path.join(REPO_PATH, "example")
78
- IMAGES_PATH = os.path.join(REPO_PATH, "docs", "images")
79
- PACKAGE_PATH = os.path.join(REPO_PATH, "qdarkstyle")
80
- QSS_PATH = os.path.join(PACKAGE_PATH, "qss")
81
- SVG_PATH = os.path.join(PACKAGE_PATH, "svg")
82
-
83
- # File names
84
- MAIN_SCSS_FILE = "main.scss"
85
- STYLES_SCSS_FILE = "_styles.scss"
86
- VARIABLES_SCSS_FILE = "_variables.scss"
87
-
88
- # Prefixes and suffixes
89
- RESOURCE_PREFIX = "qss_icons"
90
- STYLE_PREFIX = "qdarkstyle"
91
- QSS_FILE_SUFFIX = "style.qss"
92
- QRC_FILE_SUFFIX = "style.qrc"
93
-
94
- DEPRECATION_MSG = """This function will be deprecated in v4.0.
95
- Please, set the wanted binding by using QtPy environment variable QT_API,
96
- then use load_stylesheet() passing the argument qt_api='wanted_binding'."""
97
-
98
- DEPRECATION_MSG_UNSUPPORTED = """PyQt4/PySide use will be deprecated in v4.0,
99
- by the lack of support. We will follow the minimum requirements given by QtPy,
100
- project since QDarkStyle is dependent on it."""
101
-
102
-
103
- def _apply_os_patches(palette):
104
- """
105
- Apply OS-only specific stylesheet patches.
106
-
107
- Returns:
108
- str: stylesheet string (css).
109
- """
110
- os_fix = ""
111
-
112
- if platform.system().lower() == "darwin":
113
- # See issue #12, #267
114
- os_fix = """
115
- QDockWidget::title
116
- {{
117
- background-color: {color};
118
- text-align: center;
119
- height: 12px;
120
- }}
121
- QTabBar::close-button {{
122
- padding: 2px;
123
- }}
124
- """.format(color=palette.COLOR_BACKGROUND_4)
125
-
126
- # Only open the QSS file if any patch is needed
127
- if os_fix:
128
- _logger.info("Found OS patches to be applied.")
129
-
130
- return os_fix
131
-
132
-
133
- def _apply_binding_patches():
134
- """
135
- Apply binding-only specific stylesheet patches for the same OS.
136
-
137
- Returns:
138
- str: stylesheet string (css).
139
- """
140
- binding_fix = ""
141
-
142
- if binding_fix:
143
- _logger.info("Found binding patches to be applied.")
144
-
145
- return binding_fix
146
-
147
-
148
- def _apply_version_patches(qt_version):
149
- """
150
- Apply version-only specific stylesheet patches for the same binding.
151
-
152
- Args:
153
- qt_version (str): Qt string version.
154
-
155
- Returns:
156
- str: stylesheet string (css).
157
- """
158
- version_fix = ""
159
-
160
- major, minor, patch = qt_version.split(".")
161
- major, minor, patch = int(major), int(minor), int(patch)
162
-
163
- if major == 5 and minor >= 14:
164
- # See issue #214
165
- version_fix = """
166
- QMenu::item {
167
- padding: 4px 24px 4px 6px;
168
- }
169
- """
170
-
171
- if version_fix:
172
- _logger.info("Found version patches to be applied.")
173
-
174
- return version_fix
175
-
176
-
177
- def _apply_application_patches(QCoreApplication, QPalette, QColor, palette):
178
- """
179
- Apply application-level fixes on the QPalette.
180
-
181
- The import names args must be passed here because the import is done
182
- inside the load_stylesheet() function, as QtPy is only imported in
183
- that moment for setting reasons.
184
- """
185
- # See issue #139
186
- color = palette.COLOR_ACCENT_3
187
- qcolor = QColor(color)
188
-
189
- # Todo: check if it is qcoreapplication indeed
190
- app = QCoreApplication.instance()
191
-
192
- _logger.info("Found application patches to be applied.")
193
-
194
- if app:
195
- app_palette = app.palette()
196
- app_palette.setColor(QPalette.Normal, QPalette.Link, qcolor)
197
- app.setPalette(app_palette)
198
- else:
199
- _logger.warning(
200
- "No QCoreApplication instance found. "
201
- "Application patches not applied. "
202
- "You have to call load_stylesheet function after "
203
- "instantiation of QApplication to take effect. "
204
- )
205
-
206
-
207
- def _load_stylesheet(qt_api="", palette=None):
208
- """
209
- Load the stylesheet based on QtPy abstraction layer environment variable.
210
-
211
- If the argument is not passed, it uses the current QT_API environment
212
- variable to make the imports of Qt bindings. If passed, it sets this
213
- variable and then makes the imports.
214
-
215
- Args:
216
- qt_api (str): qt binding name to set QT_API environment variable.
217
- Default is ''. Possible values are pyside, pyside2
218
- pyqt4, pyqt5. Not case sensitive.
219
- palette (Palette): Palette class that inherits from Palette.
220
-
221
- Note:
222
- - Note that the variable QT_API is read when first imported. So,
223
- pay attention to the import order.
224
- - If you are using another abstraction layer, i.e PyQtGraph to do
225
- imports on Qt things you must set both to use the same Qt
226
- binding (PyQt, PySide).
227
- - OS, binding and binding version number, and application-specific
228
- patches are applied in this order.
229
-
230
- Returns:
231
- str: stylesheet string (css).
232
- """
233
-
234
- if qt_api:
235
- os.environ["QT_API"] = qt_api
236
-
237
- # Import is made after setting QT_API
238
- """ OF: Removed to remove the QtPy dependance
239
- from qtpy.QtCore import QCoreApplication, QFile, QTextStream
240
- from qtpy.QtGui import QColor, QPalette
241
- from qtpy import QT_VERSION
242
- """
243
- from PyQt5.QtCore import QCoreApplication, QFile, QTextStream
244
- from PyQt5.QtGui import QColor, QPalette
245
- from PyQt5.QtCore import QT_VERSION_STR as QT_VERSION
246
-
247
- # Then we import resources - binary qrc content
248
- if palette is None:
249
- from qdarkstyle.dark import darkstyle_rc # noqa
250
-
251
- palette = DarkPalette
252
- elif palette.ID == "dark":
253
- from qdarkstyle.dark import darkstyle_rc # noqa
254
-
255
- palette = DarkPalette
256
- elif palette.ID == "light":
257
- from qdarkstyle.light import lightstyle_rc # noqa
258
-
259
- palette = LightPalette
260
- else:
261
- print("Not recognized ID for palette! Exiting!")
262
- sys.exit(1)
263
-
264
- # Thus, by importing the binary we can access the resources
265
- package_dir = os.path.basename(PACKAGE_PATH)
266
- palette_dir = os.path.join(package_dir, palette.ID)
267
- qss_rc_path = ":" + os.path.join(palette_dir, palette.ID + QSS_FILE_SUFFIX)
268
-
269
- _logger.debug(f"Reading QSS file in: {qss_rc_path}")
270
-
271
- # It gets the qss file from compiled style_rc that was imported,
272
- # not from the file QSS as we are using resources
273
- qss_file = QFile(qss_rc_path)
274
-
275
- if qss_file.exists():
276
- qss_file.open(QFile.ReadOnly | QFile.Text)
277
- text_stream = QTextStream(qss_file)
278
- stylesheet = text_stream.readAll()
279
- _logger.info("QSS file successfully loaded.")
280
- else:
281
- stylesheet = ""
282
- # Todo: check this raise type and add to docs
283
- raise FileNotFoundError("Unable to find QSS file '{}' " "in resources.".format(qss_rc_path))
284
-
285
- _logger.debug("Checking patches for being applied.")
286
-
287
- # Todo: check execution order for these functions
288
- # 1. Apply OS specific patches
289
- stylesheet += _apply_os_patches(palette)
290
-
291
- # 2. Apply binding specific patches
292
- stylesheet += _apply_binding_patches()
293
-
294
- # 3. Apply binding version specific patches
295
- stylesheet += _apply_version_patches(QT_VERSION)
296
-
297
- # 4. Apply palette fix. See issue #139
298
- _apply_application_patches(QCoreApplication, QPalette, QColor, palette)
299
-
300
- return stylesheet
301
-
302
-
303
- def load_stylesheet(*args, **kwargs):
304
- """
305
- Load the stylesheet. Takes care of importing the rc module.
306
-
307
- Args:
308
- pyside (bool): True to load the PySide (or PySide2) rc file,
309
- False to load the PyQt4 (or PyQt5) rc file.
310
- Default is False.
311
- or
312
-
313
- qt_api (str): Qt binding name to set QT_API environment variable.
314
- Default is '', i.e PyQt5 the default QtPy binding.
315
- Possible values are pyside, pyside2 pyqt4, pyqt5.
316
- Not case sensitive.
317
-
318
- or
319
-
320
- palette (Palette): Class (not instance) that inherits from Palette.
321
-
322
- Raises:
323
- TypeError: If arguments do not match: type, keyword name nor quantity.
324
-
325
- Returns:
326
- str: the stylesheet string.
327
- """
328
-
329
- stylesheet = ""
330
- arg = None
331
-
332
- try:
333
- arg = args[0]
334
- except IndexError:
335
- # It is already none
336
- pass
337
-
338
- # Get palette
339
- palette = kwargs.get("palette", None)
340
-
341
- # Number of arguments are wrong
342
- if (kwargs and args) or len(args) > 2 or len(kwargs) > 2:
343
- raise TypeError(
344
- "load_stylesheet() takes zero, one or two arguments: "
345
- "(new) string type qt_api='pyqt5' or "
346
- "(old) boolean type pyside='False' or "
347
- "(new) palette type palette=Palette."
348
- )
349
-
350
- # No arguments
351
- if not kwargs and not args:
352
- stylesheet = _load_stylesheet(qt_api="pyqt5")
353
-
354
- # Old API arguments
355
- elif "pyside" in kwargs or isinstance(arg, bool):
356
- pyside = kwargs.get("pyside", arg)
357
-
358
- if pyside:
359
- stylesheet = _load_stylesheet(qt_api="pyside2", palette=palette)
360
- if not stylesheet:
361
- stylesheet = _load_stylesheet(qt_api="pyside", palette=palette)
362
-
363
- else:
364
- stylesheet = _load_stylesheet(qt_api="pyqt5", palette=palette)
365
- if not stylesheet:
366
- stylesheet = _load_stylesheet(qt_api="pyqt4", palette=palette)
367
-
368
- # Deprecation warning only for old API
369
- warnings.warn(DEPRECATION_MSG, DeprecationWarning)
370
-
371
- # New API arguments
372
- elif "qt_api" in kwargs or isinstance(arg, str):
373
- qt_api = kwargs.get("qt_api", arg)
374
- stylesheet = _load_stylesheet(qt_api=qt_api, palette=palette)
375
-
376
- # Palette arg
377
- elif "palette" in kwargs or issubclass(arg, Palette):
378
- palette_arg = kwargs.get("palette", arg)
379
- stylesheet = _load_stylesheet(palette=palette_arg)
380
-
381
- # Wrong API arguments name or type
382
- else:
383
- raise TypeError(
384
- "load_stylesheet() takes only zero, one or two arguments: "
385
- "(new) string type qt_api='pyqt5' or "
386
- "(new) palette type palette=Palette or "
387
- "(old) boolean type pyside='False'."
388
- )
389
-
390
- return stylesheet
391
-
392
-
393
- def load_stylesheet_pyside():
394
- """
395
- Load the stylesheet for use in a PySide application.
396
-
397
- Returns:
398
- str: the stylesheet string.
399
- """
400
- return _load_stylesheet(qt_api="pyside")
401
-
402
-
403
- def load_stylesheet_pyside2():
404
- """
405
- Load the stylesheet for use in a PySide2 application.
406
-
407
- Returns:
408
- str: the stylesheet string.
409
- """
410
- return _load_stylesheet(qt_api="pyside2")
411
-
412
-
413
- def load_stylesheet_pyside6():
414
- """
415
- Load the stylesheet for use in a PySide6 application.
416
-
417
- Returns:
418
- str: the stylesheet string.
419
- """
420
- return _load_stylesheet(qt_api="pyside6")
421
-
422
-
423
- def load_stylesheet_pyqt():
424
- """
425
- Load the stylesheet for use in a PyQt4 application.
426
-
427
- Returns:
428
- str: the stylesheet string.
429
- """
430
- return _load_stylesheet(qt_api="pyqt4")
431
-
432
-
433
- def load_stylesheet_pyqt5():
434
- """
435
- Load the stylesheet for use in a PyQt5 application.
436
-
437
- Returns:
438
- str: the stylesheet string.
439
- """
440
- return _load_stylesheet(qt_api="pyqt5")
441
-
442
-
443
- def load_stylesheet_pyqt6():
444
- """
445
- Load the stylesheet for use in a PyQt6 application.
446
-
447
- Returns:
448
- str: the stylesheet string.
449
- """
450
- return _load_stylesheet(qt_api="pyqt6")
451
-
452
-
453
- # Deprecation Warning --------------------------------------------------------
454
-
455
-
456
- def load_stylesheet_from_environment(is_pyqtgraph=False):
457
- """
458
- Load the stylesheet from QT_API (or PYQTGRAPH_QT_LIB) environment variable.
459
-
460
- Args:
461
- is_pyqtgraph (bool): True if it is to be set using PYQTGRAPH_QT_LIB.
462
-
463
- Raises:
464
- KeyError: if PYQTGRAPH_QT_LIB does not exist.
465
-
466
- Returns:
467
- str: the stylesheet string.
468
- """
469
- warnings.warn(DEPRECATION_MSG, DeprecationWarning)
470
-
471
- if is_pyqtgraph:
472
- stylesheet = _load_stylesheet(qt_api=os.environ.get("PYQTGRAPH_QT_LIB", None))
473
- else:
474
- stylesheet = _load_stylesheet()
475
-
476
- return stylesheet
477
-
478
-
479
- # Deprecated ----------------------------------------------------------------
@@ -1,66 +0,0 @@
1
- #!/usr/bin/env python3
2
- # -*- coding: utf-8 -*-
3
-
4
- # Standard library imports
5
- import argparse
6
- import sys
7
- from os.path import abspath, dirname
8
-
9
- # Local imports
10
- import qdarkstyle
11
-
12
- sys.path.insert(0, abspath(dirname(abspath(__file__)) + '/..'))
13
-
14
-
15
- def main():
16
- """Execute QDarkStyle helper."""
17
- parser = argparse.ArgumentParser(description="QDarkStyle helper. Use the option --all to report bugs (requires 'helpdev')",
18
- formatter_class=argparse.RawDescriptionHelpFormatter)
19
- parser.add_argument('-i', '--information', action='store_true',
20
- help="Show information about environment")
21
- parser.add_argument('-b', '--bindings', action='store_true',
22
- help="Show available bindings for Qt")
23
- parser.add_argument('-a', '--abstractions', action='store_true',
24
- help="Show available abstraction layers for Qt bindings")
25
- parser.add_argument('-d', '--dependencies', action='store_true',
26
- help="Show information about dependencies")
27
-
28
- parser.add_argument('--all', action='store_true',
29
- help="Show all information options at once")
30
-
31
- parser.add_argument('--version', '-v', action='version',
32
- version='v{}'.format(qdarkstyle.__version__))
33
-
34
- # parsing arguments from command line
35
- args = parser.parse_args()
36
- no_args = not len(sys.argv) > 1
37
- info = {}
38
-
39
- if no_args:
40
- parser.print_help()
41
-
42
- try:
43
- import helpdev
44
-
45
- except (ModuleNotFoundError, ImportError):
46
- print("You need to install the package helpdev to retrieve detailed information (e.g pip install helpdev)")
47
-
48
- else:
49
- if args.information or args.all:
50
- info.update(helpdev.check_os())
51
- info.update(helpdev.check_python())
52
-
53
- if args.bindings or args.all:
54
- info.update(helpdev.check_qt_bindings())
55
-
56
- if args.abstractions or args.all:
57
- info.update(helpdev.check_qt_abstractions())
58
-
59
- if args.dependencies or args.all:
60
- info.update(helpdev.check_python_packages(packages='helpdev,qdarkstyle'))
61
-
62
- helpdev.print_output(info)
63
-
64
-
65
- if __name__ == "__main__":
66
- sys.exit(main())
@@ -1,38 +0,0 @@
1
- # colorsystem.py is the full list of colors that can be used to easily create themes.
2
-
3
- class Gray:
4
- B0 = '#000000'
5
- B10 = '#19232D'
6
- B20 = '#293544'
7
- B30 = '#37414F'
8
- B40 = '#455364'
9
- B50 = '#54687A'
10
- B60 = '#60798B'
11
- B70 = '#788D9C'
12
- B80 = '#9DA9B5'
13
- B90 = '#ACB1B6'
14
- B100 = '#B4B8BC'
15
- B110 = '#C0C4C8'
16
- B120 = '#D2D5D8'
17
- B130 = '#DFE1E2'
18
- B140 = '#FAFAFA'
19
- B150 = '#FFFFFF'
20
-
21
-
22
- class Blue:
23
- B0 = '#000000'
24
- B10 = '#062647'
25
- B20 = '#26486B'
26
- B30 = '#375A7F'
27
- B40 = '#346792'
28
- B50 = '#1A72BB'
29
- B60 = '#057DCE'
30
- B70 = '#259AE9'
31
- B80 = '#37AEFE'
32
- B90 = '#73C7FF'
33
- B100 = '#9FCBFF'
34
- B110 = '#C2DFFA'
35
- B120 = '#CEE8FF'
36
- B130 = '#DAEDFF'
37
- B140 = '#F5FAFF'
38
- B150 = '#FFFFFF'
@@ -1 +0,0 @@
1
- # -*- coding: utf-8 -*-