#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Location
    east coast
    Posts
    20
    Rep Power
    0

    [solved] Modifying a opensource program help linux python


    hi
    i have found this really nice program for organising things, called keepnote written in python runs on win or Linux.

    i would like to have one note book on a samba share and be able to work on it from different computers on my local net work, not all at the same time more for access, pdf's png's web pages url's

    when everything is on a single computer you can have a folder with all your pdf files and make links to each one in your notebook in keepnote with a notation and description for the files same with png and text documents even with url's so if you say start to learn PIC18F4550 I/P you can create a folder and link to all your material you have collected on that subject in one place pdf files png files etc.

    now trying to run keepnote noterbook from a samba share is easy as long as you have the share open or mounted, the problem is that keepnote isn't set up for dealing with a net work so it trys to open everything with firefox and then firefox tells you i don't know what to do with this.

    what i would like to do is edit the right click menu so when you click on a link then right mouse click on it you can select send to terminal .

    evince smb://192.168.1.35/p3compaq/pdf/2545s.pdf

    gimp smb://192.168.1.35/p3compaq/pdf/384859674_o.jpg

    eog smb://192.168.1.35/p3compaq/pdf/384859674_o.jpg

    and if it is a url just double click on it and it will open in firefox

    the guy that is building keepnote is going to collage and is involved in several different projects and right now is working on drag and drop i don't think networking is on his mind right now.
    Last edited by klein5366; November 12th, 2012 at 11:00 AM. Reason: solved
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,966
    Rep Power
    481
    Split file names based on
    os.extsep .

    Get a dictionary key from
    filename.split(os.extsep)[-1]

    Index into a dictionary of programs
    {
    'jpg': 'gimp',
    'doc': 'libreoffice --writer',
    'pdf': 'evince'
    #blah blah blah
    }
    and fork these or use command lines that put them in the background,
    Code:
    os.system('nohup evince /autoMount/smb/lots-of-numbers/glork.pdf >&/dev/null &')
    or use the subprocess module.

    Hope this answer is related to your question!
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Location
    east coast
    Posts
    20
    Rep Power
    0
    hi
    what i don't understand it sends everything to firefox there is a place in the program that says file launcher: xdg-open but i'm thinking it isn't working yet


    you can make links to files but it trys to open them with firefox if i could make the link in keepnote and right click it and send it to terminal that would solve my problem i'm just not that good at programming
  6. #4
  7. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,966
    Rep Power
    481
    Find the xdg-open documentation, read it, understand it, configure it to meet your needs. You're way ahead of me. I never before this heard of xdg-open or of keepnote or why your question is related to python.
    [code]Code tags[/code] are essential for python code and Makefiles!
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Location
    east coast
    Posts
    20
    Rep Power
    0
    b49P23TIvg

    i have found this really nice program for organising things, called keepnote written in python runs on win or Linux.
    written in python
    xdg-open is the program that opens double clicked files in ubuntu and it works fine.

    keepnote

    the problem really lies in keepnote and being it isn't a completed work it should not be call a problem.

    i just need some help modifying the code to add send to terminal to the right click menu in keepnote, so right clicking on a hyper link in keepnote select send to terminal sends that hyper link to terminal.

    i think just modifying the code in the right click menu would be the least evasive change , to the program it's self.
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Location
    east coast
    Posts
    20
    Rep Power
    0

    [solved] Modifying a opensource program help linux python


    b49P23TIvg

    sometimes it just helps to talk to some one lol
    all i had to do was move xdg-open to the command line for open web browser that way on linux it uses xdg for everything instead of firefox now the appropit link to a file will use xdg to open it :
    png
    pdf
    jpg
    url

    i guess any file that is xdg-open file
    Last edited by klein5366; November 12th, 2012 at 10:59 AM. Reason: solved
  12. #7
  13. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,966
    Rep Power
    481
    I installed keepnote and haven't yet figured out how to make a new notebook.

    Before that I grabbed keepnote source and ended up filing this bug report.

    I'm happy you found a solution and I'm removing keepnote from my computer.
    [code]Code tags[/code] are essential for python code and Makefiles!
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Location
    east coast
    Posts
    20
    Rep Power
    0
    open keepnote
    topleft open file
    in the drop down menu chose new notebook
    give that notebook a name and place it any ware you wont and close or ok
    that should give you a folder in the left column with the name you picked,
    right clicking on that folder you can add more pages and name those pages if you create a folder or child page for dog and click on dog in the lower right box you can type anything you wont or add links to dog url or if you have a pdf file you can drag that file from where ever it is to that page in the lower right and it will create a link to that file. so insted of going and hunting for that file in a bunch of pdf file you just click there you can add links to pic's you have on your computer too as for me i have a lot of pdf files and png files

IMN logo majestic logo threadwatch logo seochat tools logo