TypeError: 'kivy.weakproxy.WeakProxy' object is not callable Kivi
up vote
1
down vote
favorite
I'm new to kivy, and I'm to write a viewer
app.
Currently I'm working on the design alone, but I'm getting the following error:
line 239, in create_view
view_instance = cls(**item_args) TypeError: 'kivy.weakproxy.WeakProxy' object is not callable
Sharing my code:
bins_player.py:
import kivy
import glob
from os import path
import tkinter as tk
from kivy.app import App
from tkinter import filedialog
from kivy.core.window import Window
from kivy.uix.boxlayout import BoxLayout
from kivy.properties import ObjectProperty
from kivy.uix.gridlayout import GridLayout
kivy.require('1.9.0')
class FilesPanel(GridLayout):
frames_list = ObjectProperty()
def open_files(self):
root = tk.Tk()
root.withdraw()
self.load_files(filedialog.askdirectory(parent=root,initialdir="/", title='Please select a directory'))
def load_files(self, selected_folder):
all_bin_files = glob.glob(path.join(selected_folder, '*.bin'))
for bin_file in all_bin_files:
self.frames_list.adapter.data.extend([bin_file])
self.frames_list._trigger_reset_populate()
class BinsPlayerMain(GridLayout):
pass
class Bins_PlayerApp(App):
def build(self):
Window.clearcolor = (1, 1, 1, 1)
self.title = 'Bins Player'
self.icon = 'BinsPlayer.ico'
return BinsPlayerMain()
if __name__ == "__main__":
Bins_PlayerApp().run()
bins_player.kv:
#: include ui/filespanel.kv
<BinsPlayerMain>:
rows: 2
GridLayout:
filespanel.kv:
#: include force ui/sectiontitle.kv
#: import ListAdapter kivy.adapters.listadapter.ListAdapter
<FilesPanel>:
id: filesPanel
frames_list: frames_list_view
rows: 2
size_hint_x: None
width: 200
ListView:
id: frames_list_view
rgba: .2, .2, .2, 1
adapter:
ListAdapter(data=, cls=filesPanel)
Button:
size_hint_y: None
height: 30
spacing: 10
text: 'Open Folder'
on_press: filesPanel.open_files()
I'm getting this error right after I'm opening a folder - after the ListView
gets updated.
What could be the problem here?
I saw a new
layout called ResycleView
- can this be used here instead of the ListView
?
python python-3.x pycharm kivy kivy-language
add a comment |
up vote
1
down vote
favorite
I'm new to kivy, and I'm to write a viewer
app.
Currently I'm working on the design alone, but I'm getting the following error:
line 239, in create_view
view_instance = cls(**item_args) TypeError: 'kivy.weakproxy.WeakProxy' object is not callable
Sharing my code:
bins_player.py:
import kivy
import glob
from os import path
import tkinter as tk
from kivy.app import App
from tkinter import filedialog
from kivy.core.window import Window
from kivy.uix.boxlayout import BoxLayout
from kivy.properties import ObjectProperty
from kivy.uix.gridlayout import GridLayout
kivy.require('1.9.0')
class FilesPanel(GridLayout):
frames_list = ObjectProperty()
def open_files(self):
root = tk.Tk()
root.withdraw()
self.load_files(filedialog.askdirectory(parent=root,initialdir="/", title='Please select a directory'))
def load_files(self, selected_folder):
all_bin_files = glob.glob(path.join(selected_folder, '*.bin'))
for bin_file in all_bin_files:
self.frames_list.adapter.data.extend([bin_file])
self.frames_list._trigger_reset_populate()
class BinsPlayerMain(GridLayout):
pass
class Bins_PlayerApp(App):
def build(self):
Window.clearcolor = (1, 1, 1, 1)
self.title = 'Bins Player'
self.icon = 'BinsPlayer.ico'
return BinsPlayerMain()
if __name__ == "__main__":
Bins_PlayerApp().run()
bins_player.kv:
#: include ui/filespanel.kv
<BinsPlayerMain>:
rows: 2
GridLayout:
filespanel.kv:
#: include force ui/sectiontitle.kv
#: import ListAdapter kivy.adapters.listadapter.ListAdapter
<FilesPanel>:
id: filesPanel
frames_list: frames_list_view
rows: 2
size_hint_x: None
width: 200
ListView:
id: frames_list_view
rgba: .2, .2, .2, 1
adapter:
ListAdapter(data=, cls=filesPanel)
Button:
size_hint_y: None
height: 30
spacing: 10
text: 'Open Folder'
on_press: filesPanel.open_files()
I'm getting this error right after I'm opening a folder - after the ListView
gets updated.
What could be the problem here?
I saw a new
layout called ResycleView
- can this be used here instead of the ListView
?
python python-3.x pycharm kivy kivy-language
thecls
parameter in yourfilespanel.kv
should be a class, but you are passing akivy.weakproxy.WeakProxy
(that is what theid
filesPanel1
actually is).
– John Anderson
Nov 4 at 14:53
Then I should pass theFilesPanel
class instead? If I do that I get an errorNameError: name 'FilesPanel' is not defined
– Idanis
2 days ago
NoFilesPanel
is not the class you want. Thecls
parameter is a class that will be used to display each element in theListView
. A simple one isListItemLabel
. And yes, you can useRecycleView
, in fact,ListView
is deprecated in favor ofRecycleView
. See the documentation.
– John Anderson
2 days ago
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm new to kivy, and I'm to write a viewer
app.
Currently I'm working on the design alone, but I'm getting the following error:
line 239, in create_view
view_instance = cls(**item_args) TypeError: 'kivy.weakproxy.WeakProxy' object is not callable
Sharing my code:
bins_player.py:
import kivy
import glob
from os import path
import tkinter as tk
from kivy.app import App
from tkinter import filedialog
from kivy.core.window import Window
from kivy.uix.boxlayout import BoxLayout
from kivy.properties import ObjectProperty
from kivy.uix.gridlayout import GridLayout
kivy.require('1.9.0')
class FilesPanel(GridLayout):
frames_list = ObjectProperty()
def open_files(self):
root = tk.Tk()
root.withdraw()
self.load_files(filedialog.askdirectory(parent=root,initialdir="/", title='Please select a directory'))
def load_files(self, selected_folder):
all_bin_files = glob.glob(path.join(selected_folder, '*.bin'))
for bin_file in all_bin_files:
self.frames_list.adapter.data.extend([bin_file])
self.frames_list._trigger_reset_populate()
class BinsPlayerMain(GridLayout):
pass
class Bins_PlayerApp(App):
def build(self):
Window.clearcolor = (1, 1, 1, 1)
self.title = 'Bins Player'
self.icon = 'BinsPlayer.ico'
return BinsPlayerMain()
if __name__ == "__main__":
Bins_PlayerApp().run()
bins_player.kv:
#: include ui/filespanel.kv
<BinsPlayerMain>:
rows: 2
GridLayout:
filespanel.kv:
#: include force ui/sectiontitle.kv
#: import ListAdapter kivy.adapters.listadapter.ListAdapter
<FilesPanel>:
id: filesPanel
frames_list: frames_list_view
rows: 2
size_hint_x: None
width: 200
ListView:
id: frames_list_view
rgba: .2, .2, .2, 1
adapter:
ListAdapter(data=, cls=filesPanel)
Button:
size_hint_y: None
height: 30
spacing: 10
text: 'Open Folder'
on_press: filesPanel.open_files()
I'm getting this error right after I'm opening a folder - after the ListView
gets updated.
What could be the problem here?
I saw a new
layout called ResycleView
- can this be used here instead of the ListView
?
python python-3.x pycharm kivy kivy-language
I'm new to kivy, and I'm to write a viewer
app.
Currently I'm working on the design alone, but I'm getting the following error:
line 239, in create_view
view_instance = cls(**item_args) TypeError: 'kivy.weakproxy.WeakProxy' object is not callable
Sharing my code:
bins_player.py:
import kivy
import glob
from os import path
import tkinter as tk
from kivy.app import App
from tkinter import filedialog
from kivy.core.window import Window
from kivy.uix.boxlayout import BoxLayout
from kivy.properties import ObjectProperty
from kivy.uix.gridlayout import GridLayout
kivy.require('1.9.0')
class FilesPanel(GridLayout):
frames_list = ObjectProperty()
def open_files(self):
root = tk.Tk()
root.withdraw()
self.load_files(filedialog.askdirectory(parent=root,initialdir="/", title='Please select a directory'))
def load_files(self, selected_folder):
all_bin_files = glob.glob(path.join(selected_folder, '*.bin'))
for bin_file in all_bin_files:
self.frames_list.adapter.data.extend([bin_file])
self.frames_list._trigger_reset_populate()
class BinsPlayerMain(GridLayout):
pass
class Bins_PlayerApp(App):
def build(self):
Window.clearcolor = (1, 1, 1, 1)
self.title = 'Bins Player'
self.icon = 'BinsPlayer.ico'
return BinsPlayerMain()
if __name__ == "__main__":
Bins_PlayerApp().run()
bins_player.kv:
#: include ui/filespanel.kv
<BinsPlayerMain>:
rows: 2
GridLayout:
filespanel.kv:
#: include force ui/sectiontitle.kv
#: import ListAdapter kivy.adapters.listadapter.ListAdapter
<FilesPanel>:
id: filesPanel
frames_list: frames_list_view
rows: 2
size_hint_x: None
width: 200
ListView:
id: frames_list_view
rgba: .2, .2, .2, 1
adapter:
ListAdapter(data=, cls=filesPanel)
Button:
size_hint_y: None
height: 30
spacing: 10
text: 'Open Folder'
on_press: filesPanel.open_files()
I'm getting this error right after I'm opening a folder - after the ListView
gets updated.
What could be the problem here?
I saw a new
layout called ResycleView
- can this be used here instead of the ListView
?
python python-3.x pycharm kivy kivy-language
python python-3.x pycharm kivy kivy-language
asked Nov 4 at 10:11
Idanis
79942150
79942150
thecls
parameter in yourfilespanel.kv
should be a class, but you are passing akivy.weakproxy.WeakProxy
(that is what theid
filesPanel1
actually is).
– John Anderson
Nov 4 at 14:53
Then I should pass theFilesPanel
class instead? If I do that I get an errorNameError: name 'FilesPanel' is not defined
– Idanis
2 days ago
NoFilesPanel
is not the class you want. Thecls
parameter is a class that will be used to display each element in theListView
. A simple one isListItemLabel
. And yes, you can useRecycleView
, in fact,ListView
is deprecated in favor ofRecycleView
. See the documentation.
– John Anderson
2 days ago
add a comment |
thecls
parameter in yourfilespanel.kv
should be a class, but you are passing akivy.weakproxy.WeakProxy
(that is what theid
filesPanel1
actually is).
– John Anderson
Nov 4 at 14:53
Then I should pass theFilesPanel
class instead? If I do that I get an errorNameError: name 'FilesPanel' is not defined
– Idanis
2 days ago
NoFilesPanel
is not the class you want. Thecls
parameter is a class that will be used to display each element in theListView
. A simple one isListItemLabel
. And yes, you can useRecycleView
, in fact,ListView
is deprecated in favor ofRecycleView
. See the documentation.
– John Anderson
2 days ago
the
cls
parameter in your filespanel.kv
should be a class, but you are passing a kivy.weakproxy.WeakProxy
(that is what the id
filesPanel1
actually is).– John Anderson
Nov 4 at 14:53
the
cls
parameter in your filespanel.kv
should be a class, but you are passing a kivy.weakproxy.WeakProxy
(that is what the id
filesPanel1
actually is).– John Anderson
Nov 4 at 14:53
Then I should pass the
FilesPanel
class instead? If I do that I get an error NameError: name 'FilesPanel' is not defined
– Idanis
2 days ago
Then I should pass the
FilesPanel
class instead? If I do that I get an error NameError: name 'FilesPanel' is not defined
– Idanis
2 days ago
No
FilesPanel
is not the class you want. The cls
parameter is a class that will be used to display each element in the ListView
. A simple one is ListItemLabel
. And yes, you can use RecycleView
, in fact, ListView
is deprecated in favor of RecycleView
. See the documentation.– John Anderson
2 days ago
No
FilesPanel
is not the class you want. The cls
parameter is a class that will be used to display each element in the ListView
. A simple one is ListItemLabel
. And yes, you can use RecycleView
, in fact, ListView
is deprecated in favor of RecycleView
. See the documentation.– John Anderson
2 days ago
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53139681%2ftypeerror-kivy-weakproxy-weakproxy-object-is-not-callable-kivi%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
the
cls
parameter in yourfilespanel.kv
should be a class, but you are passing akivy.weakproxy.WeakProxy
(that is what theid
filesPanel1
actually is).– John Anderson
Nov 4 at 14:53
Then I should pass the
FilesPanel
class instead? If I do that I get an errorNameError: name 'FilesPanel' is not defined
– Idanis
2 days ago
No
FilesPanel
is not the class you want. Thecls
parameter is a class that will be used to display each element in theListView
. A simple one isListItemLabel
. And yes, you can useRecycleView
, in fact,ListView
is deprecated in favor ofRecycleView
. See the documentation.– John Anderson
2 days ago