foss-np / anubad

gloss browser for https://github.com/foss-np/np-l10n-glossary
Other
9 stars 5 forks source link

receive error during `make` #11

Closed samundra closed 8 years ago

samundra commented 8 years ago

I get error on dev and experimental branch during make. I didn't bother to test the master branch as it seemed to be outdated.

  1. ./configure - pulls the latest translation files
  2. make fails with following error message cd src; make make[1]: Entering directory `/home/developer/personal/anubad/src' ./main.py
Traceback (most recent call last):
  File "./main.py", line 23, in <module>
    import ui.home
  File "/home/developer/personal/anubad/src/ui/home.py", line 507

              ^
SyntaxError: only named arguments may follow *expression
make[1]: *** [all] Error 1
make[1]: Leaving directory `/home/developer/personal/anubad/src'
make: *** [app] Error 2

The reported error is in line number 507, https://github.com/foss-np/anubad/blob/dev/src/ui/home.py#L507

My System

Description:    Ubuntu 14.04.4 LTS
Release:    14.04
Codename:   trusty
rhoit commented 8 years ago

Ya master branch is really far behind, will sync in when experimental is stable. I'm not entirely sure why that error occurred, there has been :hurtrealbad: major changes lately.. still haven't push all of it.

I'm trying to clean and refactor, in the hope :sweat: its increase the readability and robustness :goberserk: Breaking changes into chucks of interpretable commits, might have :open_mouth: missed something then, wait for new changes I :pray: hope it fixes itself by then.

Anyways which version of :snake: python are you using, since https://github.com/foss-np/anubad/blob/dev/src/ui/home.py#L507 shouldn't have occurred,

EDITED

restting the dev using fore push dev is experimental was diverged

rhoit commented 8 years ago

Can you :checkered_flag: check it again.

samundra commented 8 years ago

I checked it again, but still have the same problem. the error reported is:

** (main.py:12010): WARNING **: Couldn't register with accessibility bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
Traceback (most recent call last):
  File "src/main.py", line 31, in <module>
    import ui.home
  File "/home/developer/personal/anubad/src/ui/home.py", line 426

              ^
SyntaxError: only named arguments may follow *expression

I also tried looking for solutions but failed. I ended up in Ubuntu launchpad bug report which looks similar to the one I reported here.

The file is home.py and the error

            for key, val in FULL.items():
                self.sidebar.add_suggestion(key, val)
                self._view_item(*key, val) #426 - error points here
                treeSelection.select_path(self.sidebar.count - 1)
rhoit commented 8 years ago

can you test again :repeat: from experimental.

samundra commented 8 years ago

after pulling in the changes from experiemental I tried running it again. This time I had the same error but on sidebar.py file. I applied the fix from https://github.com/foss-np/anubad/commit/eff5e0f98551e27c86f14192322a31c04deb14de. Then tried make again, this time I got different error:

cd src; make
make[1]: Entering directory `/home/developer/personal/anubad/src'
./main.py
Traceback (most recent call last):
  File "./main.py", line 114, in do_startup
    self.cnf = setting.main(PWD)
  File "/home/developer/personal/anubad/src/setting.py", line 141, in main
    cnf.load()
  File "/home/developer/personal/anubad/src/setting.py", line 50, in load
    self.preferences = self.extract_preferences()
  File "/home/developer/personal/anubad/src/setting.py", line 74, in extract_preferences
    pref = self['preferences']
  File "/usr/lib/python3.4/configparser.py", line 937, in __getitem__
    raise KeyError(key)
KeyError: 'preferences'
Traceback (most recent call last):
  File "./main.py", line 127, in do_activate
    self.home = self.home_create_window()
  File "./main.py", line 162, in home_create_window
    home = ui.home.Home(core, self.cnf)
AttributeError: 'App' object has no attribute 'cnf'

(main.py:8936): GLib-GIO-CRITICAL **: GApplication subclass '__main__+App' failed to chain up on ::shutdown (from end of override function)
make[1]: Leaving directory `/home/developer/personal/anubad/src'

This error is in TrayIcon class which extends GtkStatusIcon). Debug trace leads me toAppclass which does not havecnf` attribute. Looks like you forgot to initialize it :wink: . I fixed it and then now I ended up with another issue.

cd src; make
make[1]: Entering directory `/home/developer/personal/anubad/src'
./main.py
Traceback (most recent call last):
  File "./main.py", line 114, in do_startup
    self.cnf = setting.main(PWD)
  File "/home/developer/personal/anubad/src/setting.py", line 141, in main
    cnf.load()
  File "/home/developer/personal/anubad/src/setting.py", line 50, in load
    self.preferences = self.extract_preferences()
  File "/home/developer/personal/anubad/src/setting.py", line 74, in extract_preferences
    pref = self['preferences']
  File "/usr/lib/python3.4/configparser.py", line 937, in __getitem__
    raise KeyError(key)
KeyError: 'preferences'
Traceback (most recent call last):
  File "./main.py", line 127, in do_activate
    self.home = self.home_create_window()
  File "./main.py", line 162, in home_create_window
    home = ui.home.Home(core, self.cnf)
  File "/home/developer/personal/anubad/src/ui/home.py", line 57, in __init__
    self.tray     = cnf.preferences['show-on-system-tray']
AttributeError: 'NoneType' object has no attribute 'preferences'

(main.py:10540): GLib-GIO-CRITICAL **: GApplication subclass '__main__+App' failed to chain up on ::shutdown (from end of override function)
make[1]: Leaving directory `/home/developer/personal/anubad/src'

My python version: python3 Gtk version from command: dpkg -l libgtk2.0-0 libgtk-3-0

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                Version        Architecture   Description
+++-===================-==============-==============-===========================================
ii  libgtk-3-0:amd64    3.10.8-0ubuntu amd64          GTK+ graphical user interface library
ii  libgtk2.0-0:amd64   2.24.23-0ubunt amd64          GTK+ graphical user interface library

Let me know if there is anything you would like me test :santa:

rhoit commented 8 years ago

Still not sure what caused this error.. cnf attribute went missing, because it was never created due to this first key error.

cd src; make
make[1]: Entering directory `/home/developer/personal/anubad/src'
./main.py
Traceback (most recent call last):
  File "./main.py", line 114, in do_startup
    self.cnf = setting.main(PWD)
  File "/home/developer/personal/anubad/src/setting.py", line 141, in main
    cnf.load()
  File "/home/developer/personal/anubad/src/setting.py", line 50, in load
    self.preferences = self.extract_preferences()
  File "/home/developer/personal/anubad/src/setting.py", line 74, in extract_preferences
    pref = self['preferences']
  File "/usr/lib/python3.4/configparser.py", line 937, in __getitem__
    raise KeyError(key)
KeyError: 'preferences'

this is not suppose to happen.. :grimacing:, looking into it.

rhoit commented 8 years ago

@samundra can you check it now

samundra commented 8 years ago

I checked with the latest code base experimental and still have the same kind of errors.

cd src; make
make[1]: Entering directory `/home/developer/personal/anubad/src'
./main.py
Traceback (most recent call last):
  File "./main.py", line 31, in <module>
    import ui.home
  File "/home/developer/personal/anubad/src/ui/home.py", line 19, in <module>
    import sidebar
  File "/home/developer/personal/anubad/src/ui/sidebar.py", line 33
    self.dictstore[self.count] = (*key, value)
                                         ^
SyntaxError: can use starred expression only as assignment target
make[1]: *** [all] Error 1
make[1]: Leaving directory `/home/developer/personal/anubad/src'
make: *** [app] Error 2

I applied the same patch from here, https://github.com/foss-np/anubad/commit/eff5e0f98551e27c86f14192322a31c04deb14de

Then I ended up with another error.

cd src; make
make[1]: Entering directory `/home/developer/personal/anubad/src'
./main.py
glossary: ~/.cache/anubad/gloss/foss/en2np/ 3675
glossary: ~/.cache/anubad/gloss/foss/np2en/ 81
Traceback (most recent call last):
  File "./main.py", line 119, in do_startup
    self.plugins = { k: v for k, v in scan_plugins(self.cnf) }
  File "./main.py", line 119, in <dictcomp>
    self.plugins = { k: v for k, v in scan_plugins(self.cnf) }
  File "./main.py", line 272, in scan_plugins
    namespace = importlib.__import__(file_name[:-3])
  File "<frozen importlib._bootstrap>", line 2334, in __import__
  File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1471, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/home/developer/personal/anubad/src/../plugins/linux.py", line 10, in <module>
    gi.require_version('Keybinder', '3.0')
  File "/usr/lib/python3/dist-packages/gi/__init__.py", line 79, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Keybinder not available
Traceback (most recent call last):
  File "./main.py", line 126, in do_activate
    self.home = self.home_create_window()
  File "./main.py", line 163, in home_create_window
    home.set_icon(self.pixbuf_logo)
AttributeError: 'App' object has no attribute 'pixbuf_logo'
^[^Cmake[1]: *** [all] Interrupt
make: *** [app] Interrupt

You see I intentionally interrupted the process as it was just sitting there doing nothing.

By the way, I am currently using gnome3 as my DE does it makes any difference?

Looks like we are at least getting through it now. :+1:

rhoit commented 8 years ago

:tada: you are almost done problem is due to plugin :electric_plug: now, remove the plugins/linux.py problem is cause due to incomplete libkeybinder3 dependency, which I added recently, need to auto disable, for that need to change the plugin architecture.

or start it with

$ anubad --noplugins
samundra commented 8 years ago

executed following:

python3 src/main.py --noplugins

and got the following output:

glossary: ~/.cache/anubad/gloss/foss/en2np/ 3675
glossary: ~/.cache/anubad/gloss/foss/np2en/ 81
Traceback (most recent call last):
  File "src/main.py", line 126, in do_activate
    self.home = self.home_create_window()
  File "src/main.py", line 176, in home_create_window
    encoding = "UTF-8"
FileNotFoundError: [Errno 2] No such file or directory: '/home/developer/.cache/anubad/history'

Looks to be clean now some final cleanup remains :) :dart: :+1:

rhoit commented 8 years ago

for quick fix just create the history file

$ touch /home/developer/.cache/anubad/history

or

  $ anubad --noplugin --nohistfile

will fix that problem in following commit.

rhoit commented 8 years ago

can you test again :recycle: earlier issues should not occur now.. plugin should load smoothly now, even if there is the error :exclamation:, lets hope this branch become stable, i can freeze the dev, or update master

samundra commented 8 years ago

:sparkles: :sparkles: Screenshot

anubad - _001

:checkered_flag: :+1: it looks good now. It gave a error Error occured during loading plugin number2word other than that its fine.

Here is the dump running from command line:

cd src; make
make[1]: Entering directory `/home/developer/personal/anubad/src'
./main.py
glossary: ~/.cache/anubad/gloss/foss/en2np/ 3675
glossary: ~/.cache/anubad/gloss/foss/np2en/ 81
Traceback (most recent call last):
  File "./main.py", line 276, in scan_plugins
    namespace = importlib.__import__(name)
  File "<frozen importlib._bootstrap>", line 2334, in __import__
  File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1471, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/home/developer/personal/anubad/src/../plugins/linux.py", line 10, in <module>
    gi.require_version('Keybinder', '3.0')
  File "/usr/lib/python3/dist-packages/gi/__init__.py", line 79, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Keybinder not available
Traceback (most recent call last):
  File "./main.py", line 287, in load_plugins
    if plug.plugin_main(app, PWD):
AttributeError: 'NoneType' object has no attribute 'plugin_main'
plugin: tricks
Traceback (most recent call last):
  File "./main.py", line 287, in load_plugins
    if plug.plugin_main(app, PWD):
  File "/home/developer/personal/anubad/src/../plugins/number2word.py", line 116, in plugin_main
    gloss = app.home.core.Glossary.instances[path + 'en2ne/']
KeyError: '~/.cache/anubad/gloss/foss/en2ne/'
plugin: espeak
shutdown: update history

(main.py:9360): GLib-GIO-CRITICAL **: GApplication subclass '__main__+App' failed to chain up on ::shutdown (from end of override function)
make[1]: Leaving directory `/home/developer/personal/anubad/src'

The window appears and can be used as usual.

rhoit commented 8 years ago

:sob: nice to see icons are correctly displayed, UI font seems too be bit off, in that theme. mine looks something like this.

screenshot128

plugin breakage is due to unsynced glossary, and libkeybinder will be fixed soon.

P.S. above is the screenshot of number2word plugin :sunglasses:

samundra commented 8 years ago

Looks good. I think we can close this issue now and free the master branch :+1: :fireworks:

rhoit commented 8 years ago

hey @samundra do you like to handle the releases, I'm not sure where to freeze and release, and what to complete.

samundra commented 8 years ago

@rhoit IMHO, we can freeze the code now and bump up the version to 0.96-2

Are you following any specific tagging schema for the versioning?

rhoit commented 8 years ago

0.96-2 [major version]-[minor release]

major version: reflect major changes minor version: number denoted for important changes which cannot wait major release.