Skip to content

Commit 90c2af4

Browse files
committed
store settings
1 parent 53a26d2 commit 90c2af4

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

eventsapp/data/devsprint.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"0.0.1":
33
{
4-
"image": "https://kushaldas.in/images/pyconin15-3.jpg",
4+
"image": "https://blogs.sap.com/wp-content/uploads/2017/10/DMe_R3iXcAAuugG.jpg",
55
"text1": "A sprint is a get-together of people involved in a project to further a focused development of the project. Sprints typically last from one week up to three weeks. Sprints have become popular events in some open-source projects.",
66
"text2": "Have you tried contributing to any Open Source project but lost because of not getting mentorship? Or Start contributing to any Open source project is still in your TODO list? If so, Dev sprint is the best place for you. During Dev sprint, Mentors/Contributors of Open source projects guides participants from generating development build to submit a patch for a bug. It is best opportunity to experience the culture of Open source. People from newbie to experienced together contribute to project. During the session if you are stuck you can solve your confusions instantly from the mentors. From past experience, we found dev sprint projects are not limited for conference days but participants are still active contributor from past year's Devsprint."
77
}

eventsapp/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
__version__ = '0.0.2'
88

99
# setup error reporting
10-
import sentry_sdk
11-
sentry_sdk.init(
12-
"https://[email protected]/1284618",
13-
debug=True)
10+
# import sentry_sdk
11+
# sentry_sdk.init(
12+
# "https://[email protected]/1284618",
13+
# debug=True)
1414
# That's all for error reporting
1515

1616
import os

eventsapp/uix/screens/screenregister.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88

99

1010
app = App.get_running_app()
11+
from kivy.config import ConfigParser
12+
13+
config = ConfigParser()
14+
config.read('myconfig.ini')
15+
16+
config.adddefaultsection('pycon2018')
17+
config.setdefault('pycon2018', 'register_data_dir', 'data')
1118

1219

1320
class ScreenRegister(Factory.Screen):
@@ -17,7 +24,8 @@ class ScreenRegister(Factory.Screen):
1724
:attr:`_data` is a :type:`String`, defaults to False.
1825
'''
1926

20-
data_file_dir = StringProperty('data')
27+
data_file_dir = StringProperty(config.get(
28+
'pycon2018', 'register_data_dir'))
2129
'''This is the data dir where the registeration data is stored.
2230
All csv files should be present in this folder.
2331
@@ -191,7 +199,8 @@ def show_file_chooser(self):
191199
FileChooserIconView
192200
id: fl
193201
filters: ['*.']
194-
dirselect: True
202+
path: '/mnt/sdcard/'
203+
# dirselect: True
195204
#filter_dirs: True
196205
BoxLayout
197206
spacing: dp(9)
@@ -200,19 +209,21 @@ def show_file_chooser(self):
200209
ActiveButton
201210
text: 'Select'
202211
on_release:
203-
app.screenregister.data_file_dir = fl.selection[0]
212+
app.screenregister.data_file_dir = fl.path
204213
root.dismiss()
205214
ActiveButton
206215
text: 'Cancel'
207216
on_release: root.dismiss()
208217
''')
218+
pop.ids.fl.path = self.data_file_dir
209219
pop.open()
210220

211221
def on_data_file_dir(self, instance, data_file_dir):
212222
# read csv file here
213223
if not os.path.exists(data_file_dir):
214224
return
215-
225+
config.set('pycon2018', 'register_data_dir', data_file_dir)
226+
config.write()
216227
_data = {}
217228
for fl in os.listdir(data_file_dir):
218229
if not fl.endswith('.csv'):

0 commit comments

Comments
 (0)