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

Python implementation using pybind11 and gobject introspection - #181

Open
zalox wants to merge 5 commits into
masterfrom
python-refactor
Open

Python implementation using pybind11 and gobject introspection#181
zalox wants to merge 5 commits into
masterfrom
python-refactor

Conversation

@zalox

@zaloxzalox commented Apr 4, 2016

Copy link
Copy Markdown
Member

No description provided.

@zaloxzalox self-assigned this Apr 4, 2016
@zaloxzalox added this to the v.1.3 milestone Apr 4, 2016
@zalox

zalox commented Apr 4, 2016

Copy link
Copy Markdown
MemberAuthor

Replaces #99

@zalox
zaloxforce-pushed the python-refactor branch 4 times, most recently from d82ae2b to 9bdc0c9CompareApril 8, 2016 12:49
Comment threadsrc/python_interpreter.cc Outdated
std::cerr << std::string(err) << std::endl;
}

PythonError::PythonError(){

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zalox Have not studied the changes in detail, just saw that you repeated Python in for instance PythonInterpreter and PythonError. I think its better to use namespaces such that it becomes: Python::Interpreter and Python::Error.

@zalox
zaloxforce-pushed the python-refactor branch 2 times, most recently from 94c68fd to 3513d4fCompareApril 9, 2016 16:32
@zalox
zaloxforce-pushed the python-refactor branch 2 times, most recently from 97504ef to 989501fCompareApril 18, 2016 16:08
@zalox

Copy link
Copy Markdown
MemberAuthor

Working plugins here for now: https://github.com/zalox/jucipp-plugins

@zalox

Copy link
Copy Markdown
MemberAuthor

@milleniumbug Did you manage to test the plugins?

@milleniumbug

Copy link
Copy Markdown
Contributor

Not yet, I'm trying to. The missing Py_DecodeLocale was the immediate issue that prevented me from compiling this branch.

Comment threaddocs/install.md
```sh
pacman -S git mingw-w64-x86_64-cmake make mingw-w64-x86_64-toolchain mingw-w64-x86_64-clang mingw-w64-x86_64-gtkmm3 mingw-w64-x86_64-gtksourceviewmm3 mingw-w64-x86_64-boost mingw-w64-x86_64-aspell mingw-w64-x86_64-aspell-en
pacman -S git mingw-w64-x86_64-cmake make mingw-w64-x86_64-toolchain mingw-w64-x86_64-clang mingw-w64-x86_64-gtkmm3 mingw-w64-x86_64-gtksourceviewmm3 mingw-w64-x86_64-boost mingw-w64-x86_64-aspell mingw-w64-x86_64-aspell-en mingw-w64-x86_64-gobject-introspection mingw-w64-x86_64-pygobject-devel mingw-w64-x86_64-python3-gobject
```

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@milleniumbug You will probably need some variant of these packages as well. I needed to point to my site-packages on windows and debian. Arch was fine.

@milleniumbug

milleniumbug commented Apr 19, 2016

Copy link
Copy Markdown
Contributor

Ok, after installing necessary dependencies, setting site-packages in config.json to correct path, snippet.py works correctly, but tools.py doesn't seem to load at all. (Python version: 3.4)

Dependencies for Fedora 23: gobject-introspection-devel pygobject3-devel python3-gobject (posting here so I won't forget)

@zalox

Copy link
Copy Markdown
MemberAuthor

Are there no errors in the terminal?

@milleniumbug

Copy link
Copy Markdown
Contributor

None at all. I've verified that it doesn't load by putting some logging statements in tools.py (with jucipp.terminal.println("test"))

@milleniumbug

Copy link
Copy Markdown
Contributor

Okay, nevermind. Moving snippet.py outside and renaming tools.py to snippet.py loads the plugin, so probably I have forgotten to put it on some list.

zalox referenced this pull request in zalox/jucipp-plugins Apr 19, 2016
@zalox

Copy link
Copy Markdown
MemberAuthor

@eidheim I'm having trouble persisting my config.json file. Is there any mechanism that overwrites the file or anything in it?

I had the issues in msys2.

@eidheim

eidheim commented Apr 19, 2016

Copy link
Copy Markdown
Member

As long as you have the same version number in the config file, as in the files.h, juCi++ will not touch the config file. However, if the versions are different, changes will be done to the old config file so that it corresponds to the new file specified in files.h.

@zalox

zalox commented Apr 19, 2016

Copy link
Copy Markdown
MemberAuthor

I had some very strange behaviour then. I'll try to reproduce when I get back to windows.

@eidheim

Copy link
Copy Markdown
Member

Windows does some file lock if a file is opened by another process? That might have been the case, denying the write to you your config file. Although, I'm not very experienced with Windows.

@milleniumbug

milleniumbug commented Apr 19, 2016

Copy link
Copy Markdown
Contributor

I've debugged the program, and it seems it stops searching for plugins on first hidden file.

/home/milleniumbug/.juci/plugins/snippet.py - full
snippet - stem
/home/milleniumbug/.juci/plugins/.gitignore - full
- stem
/home/milleniumbug/.juci/plugins/__pycache__ - full
__pycache__ - stem
/home/milleniumbug/.juci/plugins/README.md - full
README - stem
/home/milleniumbug/.juci/plugins/LICENSE - full
LICENSE - stem
/home/milleniumbug/.juci/plugins/tools.py - full
tools - stem
/home/milleniumbug/.juci/plugins/.git - full
- stem

Changing from

 auto module_name=it->path().stem().string();
if(module_name.empty())
break;

to

 auto module_name=it->path().stem().string();
if(module_name.empty())
continue;

fixed the problem.

if(module_name.empty())
break;
continue;
auto is_directory=boost::filesystem::is_directory(it->path());

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@milleniumbug I fixed it this morning. You probably pulled before.

@zalox

Copy link
Copy Markdown
MemberAuthor

It might be possible to do it inClangViewAutocomplete::autocomplete_get_suggestions by asking i.e.Python::Interpreter::get_suggestions. The suggestions can be dynamically produced by clang context in plugins. If the interpreter and clang works in parallel I think it might work without a huge performance drop.

This approach isn't very generic and re-factoring might be needed for a reasonable solution.

@eidheim

eidheim commented Apr 20, 2016

Copy link
Copy Markdown
Member

@zalox I've been thinking about simpler ways to reuse the autocompletion dialog. I'll prioritize this in the coming weeks.

@zalox
zaloxforce-pushed the master branch 2 times, most recently from e10188b to 6dac0b7CompareMay 5, 2016 12:10
@zalox

Copy link
Copy Markdown
MemberAuthor

I updated the docker images with python now. I only updated the packages, so it shouldn't break other builds. https://hub.docker.com/r/cppit/jucipp/builds/

@eidheim

Copy link
Copy Markdown
Member

Coincidently, I'll test it on master now:)

@zalox

Copy link
Copy Markdown
MemberAuthor

@zalox
zaloxforce-pushed the python-refactor branch 6 times, most recently from 15b91fd to b019550CompareSeptember 4, 2016 14:30
@zalox
zaloxforce-pushed the python-refactor branch 3 times, most recently from 73502bd to b285d3dCompareFebruary 18, 2017 15:02
@zalox
zaloxforce-pushed the python-refactor branch 3 times, most recently from 1e57586 to bb6b4aaCompareFebruary 28, 2017 22:50
@zaloxzalox removed this from the v.1.3 milestone Jun 10, 2018
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@zalox@milleniumbug@eidheim