draftomen 0.3.0__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.
- draftomen/__init__.py +17 -0
- draftomen/assets/draftomen.icns +0 -0
- draftomen/assets/draftomen.ico +0 -0
- draftomen/assets/draftomen_logo.png +0 -0
- draftomen/audit.py +606 -0
- draftomen/backtest.py +449 -0
- draftomen/benchmark.py +834 -0
- draftomen/carddb.py +1869 -0
- draftomen/cardimages.py +313 -0
- draftomen/cli.py +891 -0
- draftomen/config.py +133 -0
- draftomen/deckbuilder.py +2723 -0
- draftomen/events.py +772 -0
- draftomen/logfollow.py +451 -0
- draftomen/mock_session.py +745 -0
- draftomen/paths.py +120 -0
- draftomen/pickengine.py +1117 -0
- draftomen/pool.py +1259 -0
- draftomen/preferences.py +289 -0
- draftomen/qml/AboutDialog.qml +156 -0
- draftomen/qml/AppBar.qml +120 -0
- draftomen/qml/BacktestView.qml +316 -0
- draftomen/qml/BuildView.qml +1151 -0
- draftomen/qml/CardPreview.qml +434 -0
- draftomen/qml/DimensionalButton.qml +42 -0
- draftomen/qml/DimensionalComboBox.qml +182 -0
- draftomen/qml/DimensionalSurface.qml +118 -0
- draftomen/qml/DimensionalTabButton.qml +41 -0
- draftomen/qml/LiveDraftView.qml +468 -0
- draftomen/qml/Main.qml +175 -0
- draftomen/qml/NavigationRail.qml +226 -0
- draftomen/qml/PoolSummaryPanel.qml +322 -0
- draftomen/qml/PrivacyDialog.qml +96 -0
- draftomen/qml/RecentPickThumbnail.qml +83 -0
- draftomen/qml/RecentPicksGallery.qml +333 -0
- draftomen/qml/RecommendationRow.qml +404 -0
- draftomen/qml/SettingsSwitch.qml +141 -0
- draftomen/qml/SettingsView.qml +531 -0
- draftomen/qml/StateBanner.qml +189 -0
- draftomen/qml/StatusStrip.qml +84 -0
- draftomen/qml/Theme.qml +71 -0
- draftomen/qml/qmldir +23 -0
- draftomen/qt_adapter.py +884 -0
- draftomen/qt_gui.py +338 -0
- draftomen/qt_mock.py +63 -0
- draftomen/ranking.py +126 -0
- draftomen/replay.py +480 -0
- draftomen/session.py +3668 -0
- draftomen/setinfo.py +26 -0
- draftomen/seventeen.py +2766 -0
- draftomen/splash.py +617 -0
- draftomen/tui.py +4007 -0
- draftomen/watch.py +336 -0
- draftomen-0.3.0.dist-info/METADATA +156 -0
- draftomen-0.3.0.dist-info/RECORD +59 -0
- draftomen-0.3.0.dist-info/WHEEL +5 -0
- draftomen-0.3.0.dist-info/entry_points.txt +6 -0
- draftomen-0.3.0.dist-info/licenses/LICENSE +21 -0
- draftomen-0.3.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import QtQuick 2.15
|
|
2
|
+
import QtQuick.Controls 2.15
|
|
3
|
+
import QtQuick.Layouts 1.15
|
|
4
|
+
|
|
5
|
+
Rectangle {
|
|
6
|
+
id: root
|
|
7
|
+
|
|
8
|
+
required property var sessionState
|
|
9
|
+
|
|
10
|
+
readonly property bool hasError: sessionState.errors && sessionState.errors.length > 0
|
|
11
|
+
readonly property bool hasProgress: sessionState.progress !== null && sessionState.progress !== undefined
|
|
12
|
+
readonly property bool determinateProgress: hasProgress
|
|
13
|
+
&& sessionState.progress.total !== null
|
|
14
|
+
&& sessionState.progress.total !== undefined
|
|
15
|
+
readonly property bool hasWarning: sessionState.ratings && sessionState.ratings.phase === "missing"
|
|
16
|
+
readonly property bool shown: hasError || hasProgress || hasWarning
|
|
17
|
+
readonly property var activeError: hasError ? sessionState.errors[0] : null
|
|
18
|
+
readonly property string bannerTitle: {
|
|
19
|
+
if (root.activeError)
|
|
20
|
+
return root.activeError.recoverable ? "Recoverable error" : "Application error"
|
|
21
|
+
if (root.hasWarning)
|
|
22
|
+
return "Ratings unavailable"
|
|
23
|
+
if (root.hasProgress)
|
|
24
|
+
return root.sessionState.progress.message
|
|
25
|
+
return ""
|
|
26
|
+
}
|
|
27
|
+
readonly property string bannerMessage: {
|
|
28
|
+
if (root.activeError)
|
|
29
|
+
return root.activeError.message
|
|
30
|
+
if (root.hasWarning)
|
|
31
|
+
return root.sessionState.ratings.message
|
|
32
|
+
return "The current view remains available while work continues."
|
|
33
|
+
}
|
|
34
|
+
readonly property color bannerColor: {
|
|
35
|
+
if (root.hasError)
|
|
36
|
+
return Theme.errorDark
|
|
37
|
+
if (root.hasWarning)
|
|
38
|
+
return Theme.warningDark
|
|
39
|
+
return Theme.surfaceHigh
|
|
40
|
+
}
|
|
41
|
+
readonly property color bannerBorderColor: {
|
|
42
|
+
if (root.hasError)
|
|
43
|
+
return Theme.error
|
|
44
|
+
if (root.hasWarning)
|
|
45
|
+
return Theme.warning
|
|
46
|
+
return Theme.outline
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
visible: shown
|
|
50
|
+
implicitHeight: shown ? content.implicitHeight + 20 : 0
|
|
51
|
+
color: root.bannerColor
|
|
52
|
+
border.color: root.bannerBorderColor
|
|
53
|
+
border.width: 1
|
|
54
|
+
radius: Theme.radius
|
|
55
|
+
|
|
56
|
+
RowLayout {
|
|
57
|
+
id: content
|
|
58
|
+
anchors.fill: parent
|
|
59
|
+
anchors.margins: 10
|
|
60
|
+
spacing: 12
|
|
61
|
+
|
|
62
|
+
ColumnLayout {
|
|
63
|
+
Layout.fillWidth: true
|
|
64
|
+
spacing: 3
|
|
65
|
+
|
|
66
|
+
Label {
|
|
67
|
+
Layout.fillWidth: true
|
|
68
|
+
text: root.bannerTitle
|
|
69
|
+
color: Theme.text
|
|
70
|
+
font.bold: true
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
Label {
|
|
74
|
+
Layout.fillWidth: true
|
|
75
|
+
text: root.bannerMessage
|
|
76
|
+
color: Theme.textMuted
|
|
77
|
+
wrapMode: Text.WordWrap
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
Label {
|
|
81
|
+
Layout.fillWidth: true
|
|
82
|
+
visible: root.hasError
|
|
83
|
+
&& root.sessionState.ratings.phase === "failed"
|
|
84
|
+
text: root.sessionState.ratings.message
|
|
85
|
+
color: Theme.textMuted
|
|
86
|
+
wrapMode: Text.WordWrap
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
ProgressBar {
|
|
90
|
+
Layout.fillWidth: true
|
|
91
|
+
visible: root.hasProgress
|
|
92
|
+
indeterminate: root.hasProgress && !root.determinateProgress
|
|
93
|
+
from: 0
|
|
94
|
+
to: root.determinateProgress ? root.sessionState.progress.total : 1
|
|
95
|
+
value: root.determinateProgress
|
|
96
|
+
&& root.sessionState.progress.completed !== null
|
|
97
|
+
&& root.sessionState.progress.completed !== undefined
|
|
98
|
+
? root.sessionState.progress.completed : 0
|
|
99
|
+
Accessible.name: root.hasProgress ? root.sessionState.progress.message : ""
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
DimensionalButton {
|
|
104
|
+
id: ratingsDownloadButton
|
|
105
|
+
visible: root.hasWarning
|
|
106
|
+
&& root.sessionState.ratings.set_code !== null
|
|
107
|
+
&& root.sessionState.ratings.set_code !== undefined
|
|
108
|
+
text: "Download ratings"
|
|
109
|
+
Accessible.name: "Download ratings"
|
|
110
|
+
objectName: "ratingsDownloadButton"
|
|
111
|
+
onClicked: {
|
|
112
|
+
ratingsDownloadDialog.returnFocusItem = ratingsDownloadButton
|
|
113
|
+
ratingsDownloadDialog.open()
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
DimensionalButton {
|
|
118
|
+
objectName: "sessionErrorRetryButton"
|
|
119
|
+
visible: root.activeError && root.activeError.recoverable
|
|
120
|
+
text: "Retry"
|
|
121
|
+
Accessible.name: "Retry failed operation"
|
|
122
|
+
Accessible.description: "Retries the published recoverable error."
|
|
123
|
+
onClicked: {
|
|
124
|
+
const error = root.activeError
|
|
125
|
+
if (error)
|
|
126
|
+
sessionProvider.retryError(error.error_id)
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
DimensionalButton {
|
|
131
|
+
objectName: "sessionErrorDismissButton"
|
|
132
|
+
visible: root.activeError
|
|
133
|
+
text: "Dismiss"
|
|
134
|
+
accented: false
|
|
135
|
+
Accessible.name: "Dismiss error"
|
|
136
|
+
Accessible.description: "Dismisses the published error."
|
|
137
|
+
onClicked: {
|
|
138
|
+
const error = root.activeError
|
|
139
|
+
if (error)
|
|
140
|
+
sessionProvider.dismissError(error.error_id)
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
Dialog {
|
|
146
|
+
id: ratingsDownloadDialog
|
|
147
|
+
objectName: "ratingsDownloadDialog"
|
|
148
|
+
property var returnFocusItem: null
|
|
149
|
+
implicitWidth: 400
|
|
150
|
+
modal: true
|
|
151
|
+
focus: true
|
|
152
|
+
parent: Overlay.overlay
|
|
153
|
+
title: "Download ratings?"
|
|
154
|
+
onClosed: {
|
|
155
|
+
if (returnFocusItem)
|
|
156
|
+
returnFocusItem.forceActiveFocus()
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
Label {
|
|
160
|
+
width: 360
|
|
161
|
+
text: "Download 17Lands ratings for "
|
|
162
|
+
+ root.sessionState.ratings.set_code
|
|
163
|
+
+ "? Neutral-prior recommendations remain available while it loads."
|
|
164
|
+
color: Theme.text
|
|
165
|
+
wrapMode: Text.WordWrap
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
footer: DialogButtonBox {
|
|
169
|
+
DimensionalButton {
|
|
170
|
+
objectName: "ratingsDownloadCancelButton"
|
|
171
|
+
text: "Not now"
|
|
172
|
+
accented: false
|
|
173
|
+
Accessible.name: "Cancel ratings download"
|
|
174
|
+
onClicked: ratingsDownloadDialog.close()
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
DimensionalButton {
|
|
178
|
+
objectName: "ratingsDownloadConfirmButton"
|
|
179
|
+
text: "Download ratings"
|
|
180
|
+
Accessible.name: "Confirm ratings download"
|
|
181
|
+
onClicked: {
|
|
182
|
+
sessionProvider.requestRatings()
|
|
183
|
+
ratingsDownloadDialog.close()
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import QtQuick 2.15
|
|
2
|
+
import QtQuick.Controls 2.15
|
|
3
|
+
import QtQuick.Layouts 1.15
|
|
4
|
+
|
|
5
|
+
Rectangle {
|
|
6
|
+
id: root
|
|
7
|
+
objectName: "statusStrip"
|
|
8
|
+
|
|
9
|
+
required property var sessionState
|
|
10
|
+
required property var displayPreferences
|
|
11
|
+
required property string applicationVersion
|
|
12
|
+
property bool narrow: false
|
|
13
|
+
|
|
14
|
+
color: Theme.surfaceLow
|
|
15
|
+
implicitHeight: 34
|
|
16
|
+
|
|
17
|
+
RowLayout {
|
|
18
|
+
anchors.fill: parent
|
|
19
|
+
anchors.leftMargin: 16
|
|
20
|
+
anchors.rightMargin: 16
|
|
21
|
+
spacing: 12
|
|
22
|
+
|
|
23
|
+
Rectangle {
|
|
24
|
+
Layout.preferredWidth: 8
|
|
25
|
+
Layout.preferredHeight: 8
|
|
26
|
+
radius: 4
|
|
27
|
+
color: root.sessionState.errors && root.sessionState.errors.length > 0
|
|
28
|
+
? Theme.error
|
|
29
|
+
: root.sessionState.progress ? Theme.warning : Theme.primary
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
Label {
|
|
33
|
+
Layout.fillWidth: true
|
|
34
|
+
text: root.sessionState.status ? root.sessionState.status.message : "Starting"
|
|
35
|
+
color: Theme.textMuted
|
|
36
|
+
font.pixelSize: Theme.textPixelSize(11)
|
|
37
|
+
elide: Text.ElideRight
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
Label {
|
|
41
|
+
objectName: "statusPersistenceMessage"
|
|
42
|
+
Layout.fillWidth: true
|
|
43
|
+
Layout.minimumWidth: 0
|
|
44
|
+
text: root.displayPreferences.persistenceMessage
|
|
45
|
+
color: root.displayPreferences.persistenceMessage === "Saved"
|
|
46
|
+
? Theme.primary
|
|
47
|
+
: Theme.warning
|
|
48
|
+
font.pixelSize: Theme.textPixelSize(11)
|
|
49
|
+
elide: Text.ElideRight
|
|
50
|
+
Accessible.name: text
|
|
51
|
+
Accessible.description: text
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
Label {
|
|
55
|
+
text: root.sessionState.ratings ? root.sessionState.ratings.message : "Ratings unavailable"
|
|
56
|
+
color: Theme.textMuted
|
|
57
|
+
font.pixelSize: Theme.textPixelSize(11)
|
|
58
|
+
elide: Text.ElideRight
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
Label {
|
|
62
|
+
objectName: "applicationVersionLabel"
|
|
63
|
+
text: "v" + root.applicationVersion
|
|
64
|
+
color: Theme.textMuted
|
|
65
|
+
font.pixelSize: Theme.textPixelSize(11)
|
|
66
|
+
Accessible.name: "Draft Omen version " + root.applicationVersion
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
Label {
|
|
70
|
+
visible: !root.narrow
|
|
71
|
+
text: "Data from 17Lands"
|
|
72
|
+
color: Theme.primary
|
|
73
|
+
font.pixelSize: Theme.textPixelSize(11)
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
Rectangle {
|
|
78
|
+
anchors.top: parent.top
|
|
79
|
+
width: parent.width
|
|
80
|
+
height: 1
|
|
81
|
+
color: Theme.outline
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
draftomen/qml/Theme.qml
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
pragma Singleton
|
|
2
|
+
|
|
3
|
+
import QtQuick 2.15
|
|
4
|
+
|
|
5
|
+
QtObject {
|
|
6
|
+
readonly property color background: "#050714"
|
|
7
|
+
readonly property color surfaceLow: "#0b0d1c"
|
|
8
|
+
readonly property color surface: "#11142a"
|
|
9
|
+
readonly property color surfaceHigh: "#191d3b"
|
|
10
|
+
readonly property color surfaceHighest: "#242950"
|
|
11
|
+
readonly property color text: "#f5f1e8"
|
|
12
|
+
readonly property color textMuted: "#c8c2b8"
|
|
13
|
+
readonly property color textDisabled: "#77757d"
|
|
14
|
+
readonly property color outline: "#8b7b70"
|
|
15
|
+
readonly property color outlineDisabled: "#3e4051"
|
|
16
|
+
readonly property color primary: "#a78bfa"
|
|
17
|
+
readonly property color primaryContent: "#160c2c"
|
|
18
|
+
readonly property color secondary: "#6ea8fe"
|
|
19
|
+
readonly property color secondaryContent: "#08162f"
|
|
20
|
+
readonly property color neutral: "#202d47"
|
|
21
|
+
readonly property color neutralContent: "#edf2ff"
|
|
22
|
+
readonly property color primaryDark: "#29275d"
|
|
23
|
+
readonly property color warning: "#e7c993"
|
|
24
|
+
readonly property color warningDark: "#4a3822"
|
|
25
|
+
readonly property color error: "#ffb4ab"
|
|
26
|
+
readonly property color errorDark: "#690005"
|
|
27
|
+
readonly property color focus: "#f4c77a"
|
|
28
|
+
readonly property color controlDisabled: "#2a3040"
|
|
29
|
+
readonly property color controlDisabledContent: "#a7adbd"
|
|
30
|
+
readonly property color controlNeutralBorder: "#536484"
|
|
31
|
+
readonly property color controlHighlight: "#f6f3ff"
|
|
32
|
+
readonly property color controlEdge: "#080b16"
|
|
33
|
+
readonly property color whiteMana: "#f9fafb"
|
|
34
|
+
readonly property color blueMana: "#0ea5e9"
|
|
35
|
+
readonly property color blackMana: "#4b5563"
|
|
36
|
+
readonly property color redMana: "#ef4444"
|
|
37
|
+
readonly property color greenMana: "#22c55e"
|
|
38
|
+
|
|
39
|
+
readonly property int radius: 4
|
|
40
|
+
readonly property int controlRadius: 12
|
|
41
|
+
readonly property int controlDepth: 3
|
|
42
|
+
readonly property int controlPressOffset: 2
|
|
43
|
+
readonly property int controlFocusGap: 2
|
|
44
|
+
readonly property int gutter: 12
|
|
45
|
+
readonly property int panelPadding: 16
|
|
46
|
+
readonly property int targetHeight: 42
|
|
47
|
+
readonly property int narrowBreakpoint: 980
|
|
48
|
+
|
|
49
|
+
readonly property real baseFontPixelSize: 13
|
|
50
|
+
|
|
51
|
+
readonly property real textScale: {
|
|
52
|
+
if (!guiPreferences.systemTextScaling)
|
|
53
|
+
return 1
|
|
54
|
+
const applicationPixelSize = guiPreferences.applicationFontPixelSize
|
|
55
|
+
return applicationPixelSize > 0 ? applicationPixelSize / baseFontPixelSize : 1
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function textPixelSize(basePixelSize) {
|
|
59
|
+
return Math.round(basePixelSize * textScale)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function colorForMana(symbol) {
|
|
63
|
+
if (symbol === "W") return whiteMana
|
|
64
|
+
if (symbol === "U") return blueMana
|
|
65
|
+
if (symbol === "B") return blackMana
|
|
66
|
+
if (symbol === "R") return redMana
|
|
67
|
+
if (symbol === "G") return greenMana
|
|
68
|
+
return textMuted
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
draftomen/qml/qmldir
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module Draftomen
|
|
2
|
+
AboutDialog 1.0 AboutDialog.qml
|
|
3
|
+
PrivacyDialog 1.0 PrivacyDialog.qml
|
|
4
|
+
singleton Theme 1.0 Theme.qml
|
|
5
|
+
AppBar 1.0 AppBar.qml
|
|
6
|
+
NavigationRail 1.0 NavigationRail.qml
|
|
7
|
+
StatusStrip 1.0 StatusStrip.qml
|
|
8
|
+
StateBanner 1.0 StateBanner.qml
|
|
9
|
+
RecommendationRow 1.0 RecommendationRow.qml
|
|
10
|
+
CardPreview 1.0 CardPreview.qml
|
|
11
|
+
RecentPickThumbnail 1.0 RecentPickThumbnail.qml
|
|
12
|
+
RecentPicksGallery 1.0 RecentPicksGallery.qml
|
|
13
|
+
PoolSummaryPanel 1.0 PoolSummaryPanel.qml
|
|
14
|
+
LiveDraftView 1.0 LiveDraftView.qml
|
|
15
|
+
BuildView 1.0 BuildView.qml
|
|
16
|
+
BacktestView 1.0 BacktestView.qml
|
|
17
|
+
SettingsView 1.0 SettingsView.qml
|
|
18
|
+
SettingsSwitch 1.0 SettingsSwitch.qml
|
|
19
|
+
DimensionalSurface 1.0 DimensionalSurface.qml
|
|
20
|
+
DimensionalButton 1.0 DimensionalButton.qml
|
|
21
|
+
DimensionalTabButton 1.0 DimensionalTabButton.qml
|
|
22
|
+
DimensionalComboBox 1.0 DimensionalComboBox.qml
|
|
23
|
+
|