File: main.py

package info (click to toggle)
python-plyer 2.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,724 kB
  • sloc: python: 13,395; sh: 217; makefile: 177
file content (62 lines) | stat: -rw-r--r-- 1,737 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
'''
Storage Path Example.
'''

from kivy.lang import Builder
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout

Builder.load_string('''
#: import storagepath plyer.storagepath
<StoragePathInterface>:
    BoxLayout:
        orientation: 'vertical'
        BoxLayout:
            Button:
                text: 'Home'
                on_press: label.text = str(storagepath.get_home_dir())
            Button:
                text: 'External Storage'
                on_press:
                    label.text = str(storagepath.get_external_storage_dir())
        BoxLayout:
            Button:
                text: 'Root'
                on_press: label.text = str(storagepath.get_root_dir())
            Button:
                text: 'Documents'
                on_press: label.text = str(storagepath.get_documents_dir())
        BoxLayout:
            Button:
                text: 'Downloads'
                on_press: label.text = str(storagepath.get_downloads_dir())
            Button:
                text: 'Videos'
                on_press: label.text = str(storagepath.get_videos_dir())
        BoxLayout:
            Button:
                text: 'Music'
                on_press: label.text = str(storagepath.get_music_dir())
            Button:
                text: 'Pictures'
                on_press: label.text = str(storagepath.get_pictures_dir())
        Button:
            text: 'Applications'
            on_press: label.text = str(storagepath.get_application_dir())
        Label:
            id: label
''')


class StoragePathInterface(BoxLayout):
    pass


class StoragePathApp(App):

    def build(self):
        return StoragePathInterface()


if __name__ == "__main__":
    StoragePathApp().run()