Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ck cd #33

Closed
psyhtest opened this issue Sep 3, 2015 · 9 comments
Closed

ck cd #33

psyhtest opened this issue Sep 3, 2015 · 9 comments

Comments

@psyhtest
Copy link
Collaborator

psyhtest commented Sep 3, 2015

Certain CK commands (e.g. find) often return a directory where a user needs to go for further operation. It would be convenient to combine search and change into a single command.

@gfursin
Copy link
Contributor

gfursin commented Sep 21, 2015

We discussed that internally and there is no easy way to change current directory and keep it when calling programs/scripts in Linux or Windows. Instead, I added two commands to CK 'cd' and 'cdc'. The first one just prints 'cd {path to entry}' which you can copy/paste ... Second one does the same and also attempt to copy this command to clipboard so that you can just paste it and go to a given entry ...

I.e. for a test:

  • ck cd test:unicode
  • ck cdc test:unicode

May I ask you to check if it will be ok as a possible solution, please? Thanks!

@psyhtest
Copy link
Collaborator Author

The cd command works just fine. But cdc complains:

CK error: seems that "tkinter" python package is not installed!

I'll check with tkinter installed... In any case, it would be good to document this dependence.

@gfursin
Copy link
Contributor

gfursin commented Sep 21, 2015

I added extra support for 'pyperclip' module (available via pip, i.e. pip install pyperclip).
Can you please check it now? Thanks!

@psyhtest
Copy link
Collaborator Author

I've installed pyperclip via pip but it appears to have an unsatisfied dependency on Ubuntu 12.04:

$ python -c "import pyperclip"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/pyperclip/__init__.py", line 218, in <module>
    raise Exception('Pyperclip requires the xclip or xsel application, or the gtk or PyQt4 module.')
Exception: Pyperclip requires the xclip or xsel application, or the gtk or PyQt4 module.
$ 

@psyhtest
Copy link
Collaborator Author

Let's ignore the clipping issue for now. In the below, I'd expect to see a warning informing of more than one option existing:

$ ck list program:slambench*
slambench-1.1-opencl
slambench-1.1-cuda
slambench-1.1-opencl-dragon-board
slambench-1.1-cpu
slambench-1.1-cpu-openmp
$ ck cd program:slambench*
cd /home/dvdt/CK/reproduce-pamela-project/program/slambench-1.1-opencl
$

(Only a single, topmost option is selected; no warning.)

@gfursin
Copy link
Contributor

gfursin commented Sep 21, 2015

I added warning to the above case - can you please check it ...
As for clipboard, yes, we should find a better solution ...
Thanks!

@psyhtest
Copy link
Collaborator Author

It's actually become a bit worse - I get an exception now when I try to find anything:

$ ck find script:explore-datasets
/home/dvdt/CK/ck-clsmith/script/explore-datasets
Traceback (most recent call last):
  File "/home/dvdt/CK/ck-master/ck/kernel.py", line 8414, in <module>
    r=access(sys.argv[1:])
  File "/home/dvdt/CK/ck-master/ck/kernel.py", line 8376, in access
    rr=perform_action(i)
  File "/home/dvdt/CK/ck-master/ck/kernel.py", line 2899, in perform_action
    return a(i)
  File "/home/dvdt/CK/ck-master/ck/kernel.py", line 4748, in find
    rx=copy_to_clipboard({'string':'"'+pf+'"'})
  File "/home/dvdt/CK/ck-master/ck/kernel.py", line 1383, in copy_to_clipboard
    import pyperclip
  File "/usr/local/lib/python2.7/dist-packages/pyperclip/__init__.py", line 218, in <module>
    raise Exception('Pyperclip requires the xclip or xsel application, or the gtk or PyQt4 module.')
Exception: Pyperclip requires the xclip or xsel application, or the gtk or PyQt4 module.
$

@gfursin
Copy link
Contributor

gfursin commented Sep 21, 2015

Ups, sorry. I think I fixed that.
Can you please check both 'find' and 'cdc' (that it doesn't crash but returns CK error)?
Thanks!

@gfursin gfursin assigned gfursin and psyhtest and unassigned gfursin Sep 23, 2015
@ctuning
Copy link
Contributor

ctuning commented Dec 11, 2015

It should be solved now so I close this ticket!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants