DPCS-team / DPCS

Data Powered Crash Solver
7 stars 17 forks source link

Client #13

Closed MSusik closed 8 years ago

MSusik commented 8 years ago

Additionally, two commit from Paweł Goliński, that were pushed to the Launchpad repo, but aren't available here.

MSusik commented 8 years ago

@qiubit @bdfhjk Please review

The daemon is not functional yet, but it serves here as an example how to implement one in future. The requirements should be automatically installed by code produced in #4. By the time it's merged the client should be run as python2 -m dpcs.client.main.client 'command'

bdfhjk commented 8 years ago

Static review completed. The code have high quality. Good job :+1:

However I can't run it directly. I've tried two approaches

marek@debian:~$ python2 -m dpcs.client.main.client 'dpkg -v' Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main "main", fname, loader, pkg_name) File "/usr/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/home/marek/dpcs/client/main/client.py", line 115, in stderr=subprocess.PIPE) File "/usr/lib/python2.7/subprocess.py", line 710, in init errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory

And

marek@debian:~/dpcs/client/main$ python client.py Traceback (most recent call last): File "client.py", line 16, in from ...systemcheck.systemcheck import systemcheck ValueError: Attempted relative import in non-package

Readme would be appreciated!

MSusik commented 8 years ago

Readme would be appreciated

Just please wait for the package PR. If I add a readme here, it will have to be removed with the next PR.

bdfhjk commented 8 years ago

@MSusik How to quickly test the PR? Could you send me a list of instructions?

I'll try to dynamically review it and merge before Tue 18:00 (if not please ping me to do it).

MSusik commented 8 years ago

@bdfhjk python2 -m dpcs.client.main.client 'command'

Then chack the directory indicated in the output

bdfhjk commented 8 years ago

I think we should implement the communication with user what the client is doing like we have talked yesterday.

Additionally, would it be hard to make it transparent, so the user can use the application without knowing it's inside dpcs? And then output an information about the log uploading procedure when an application exit with crash?

Optionally there may be a switch, like standard usage will be a transparent execution mode, and dpcs -c 'app' will capture whole output and send to the server :question: +

bdfhjk commented 8 years ago

Works really good now. Thanks! :+1: