Skip to content
This repository was archived by the owner on Feb 22, 2020. It is now read-only.

Commit 3122d84

Browse files
committed
Fixes Issue #5. Makes paths agnostitic to os.
1 parent 9148c52 commit 3122d84

5 files changed

Lines changed: 12 additions & 7 deletions

File tree

tactless-tricksters/ui/screens/listening_training_screen.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Kivy imports
22
import random
33
import time
4+
import os
45

56
from kivy.clock import Clock
67
from kivy.factory import Factory
@@ -98,7 +99,6 @@ def on_short_pause(self, *largs):
9899
99100
Image:
100101
size_hint: 1, 1
101-
source: 'ui\img\morse_code_alphabet.png'
102102
103103
MDLabel:
104104
id: tapping_prompt_label
@@ -169,6 +169,7 @@ class ListeningScreen(Screen):
169169
def __init__(self, **kwargs):
170170
super(ListeningScreen, self).__init__(name=kwargs.get('name'))
171171
self.util = kwargs.get('util')
172+
self.children[0].children[5].source = os.path.join('ui', 'img', 'morse_code_alphabet.png')
172173

173174
def on_enter(self):
174175
Clock.schedule_once(self.init_tapping_screen, 0)

tactless-tricksters/ui/screens/tapping_training_screen.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Kivy imports
22
import random
33
import time
4+
import os
45

56
from kivy.clock import Clock
67
from kivy.factory import Factory
@@ -99,7 +100,6 @@ def on_short_pause(self, *largs):
99100
100101
Image:
101102
size_hint: 1, 1
102-
source: 'ui\img\morse_code_alphabet.png'
103103
104104
MDLabel:
105105
id: tapping_prompt_label
@@ -148,7 +148,7 @@ def on_short_pause(self, *largs):
148148
size: [dp(56), dp(56)]
149149
bg_color: app.theme_cls.primary_color
150150
text_color: [1, 1, 1, 1]
151-
on_short_press: root.tapped('.')
151+
on_short_press: root.tapped('.')
152152
on_long_press: root.tapped('-')
153153
on_short_pause: root.tapped(' ')
154154
on_long_pause: root.tapped('/')
@@ -170,6 +170,7 @@ class TappingScreen(Screen):
170170
def __init__(self, **kwargs):
171171
super(TappingScreen, self).__init__(name=kwargs.get('name'))
172172
self.util = kwargs.get('util')
173+
self.children[0].children[5].source = os.path.join('ui', 'img', 'morse_code_alphabet.png')
173174

174175
def on_enter(self):
175176
Clock.schedule_once(self.init_tapping_screen, 0)

tactless-tricksters/ui/screens/welcome_screen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def __init__(self, **kwargs):
122122
self.add_widget(self.nav_bar_anchor)
123123

124124
Clock.schedule_once(self.texture_init, 0)
125-
Clock.schedule_interval(self.scroll_texture, 1 / 60.)
125+
Clock.schedule_interval(self.scroll_texture, 1 / 20.)
126126

127127
def texture_init(self, *args):
128128
self.canvas.before.children[-1].texture.wrap = 'repeat'

tactless-tricksters/ui/widgets/message_card.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
from kivy.uix.behaviors import ButtonBehavior
22
from kivy.app import App
3-
from kivy.metrics import dp
43
from kivy.clock import Clock
54
from kivy.factory import Factory
65

76
from kivymd.uix.card import MDCardPost
87

8+
import os
9+
910

1011
class LongPressButton(ButtonBehavior):
1112
__events__ = ('on_long_press',)
@@ -34,7 +35,7 @@ def __init__(self, **kwargs):
3435
text_post=kwargs.get('text_post'),
3536
name_data=kwargs.get('name_data'),
3637
swipe=kwargs.get('swipe'),
37-
path_to_avatar=kwargs.get('source'),
38+
path_to_avatar=os.path.join('ui', 'img', 'default_avatar.png'),
3839
)
3940

4041
self.util = kwargs.get('util')

tactless-tricksters/ui/widgets/nav_drawer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import os
2+
13
from kivy.uix.anchorlayout import AnchorLayout
24
from kivy.app import App
35
from kivy.clock import Clock
@@ -11,7 +13,7 @@ def __init__(self, nav_layout):
1113
super(ContentNavigationDrawer, self).__init__()
1214
self.nav_layout = nav_layout
1315
self.use_logo = 'logo'
14-
self.drawer_logo = 'ui/img/nav_drawer_logo.png'
16+
self.drawer_logo = os.path.join('ui', 'img', 'nav_drawer_logo.png')
1517
self.home = NavigationDrawerIconButton(text="Home", icon='home',
1618
on_press=lambda x:
1719
self.scr_chng('welcome', self.home))

0 commit comments

Comments
 (0)