Kijiji-Repost-Headless icon indicating copy to clipboard operation
Kijiji-Repost-Headless copied to clipboard

FZF, SXIV, SXRF, default editor, and multiple addresses

Open zalmoxis opened this issue 4 years ago • 7 comments

I improved the interface for tree selections (categories, etc.) using FZF narrowing. I also and added the ability to post same item to multiple addresses in 1 go. This comes with a small caveat where each address needs a unique title that gets appended to the post title. I also added a method to use SXIV image viewer in gallery mode to narrow and select images. Granted this makes it less portable (Linux/BSD/mac/OSX are gonna work). Although sxiv should silently fail if not on headless or available or right OS and you should still be able to proceed, the prompt for the image file was removed.

FYI, in SXIV gallery view M marks the file, arrow keys select, and q exits and continues with the marked files. You may want to tweak the depth at which images are looked at please look into it. There are 2 targets /media and $HOME with a shallow depth (assumes you have Pics, photos, images, media dir in your home, and possibly a camera SD card inserted).

This PR also includes a fix for XSRF deletion of items (nuke and otherwise)

zalmoxis avatar Feb 05 '21 03:02 zalmoxis

Shouldn't the binary name for emacs be "emacs" not "macs"?

On my system I have emacs running as a daemon and 'macs' is a scriptlet that runs emacs-client as a background job (with some extra features). I couldn't figure out how to make it block just for this instance so I put in the if clause so that it works for others as well. The issue I'm running into is that macs basically has emacs-client "$@" & in it and any sort of subprocess call would fail to "wait" because the scriptlet would terminate instantly and there is no longer a PID via which I could get the PGID to wait on the children processes. It's a bit of a silly situation and I just don't have time ... as long as it works and there's something reasonable available for others.

zalmoxis avatar Feb 05 '21 19:02 zalmoxis

Hmm... just crossed my mind... if I use popen with create_new_session the PID and the PGID might end up being the same so I can use that to wait for children. editor_proc = subprocess.POPEN('macs', shell=True, create_new_session=True) os.waitid(os.P_PGID, editor_proc.pid, os.STOPPED) or something on those lines... I'll have to try it, but don't have high hopes.

zalmoxis avatar Feb 05 '21 19:02 zalmoxis

Has this been tested on Windows and Mac?

ArthurG avatar Feb 05 '21 19:02 ArthurG

Has this been tested on Windows and Mac?

No, it can work on Mac but SXIV is not available on windows. Can someone try to run it on those platforms? I am quite sure iterfzf python package contains fzf built for the target platform so that should be portable... however, the /tmp and /media paths are unix specific so it won't work on windows without further work (I don't have time/interest in that though since I don't use windows much).

zalmoxis avatar Feb 05 '21 19:02 zalmoxis

The nuking/deleting portion works great on mac, I think that should be a separate PR thats expedited IMO since its currently broken

meeoh avatar Feb 22 '21 16:02 meeoh

The nuking/deleting portion works great on mac, I think that should be a separate PR thats expedited IMO since its currently broken

If you've tested via cut and paste, please feel free to create a commit and PR just for that. Thanks! This is the specific change ... but I don't know how to create a PR from just the commit (one is part of existing commiPR other is just commit in my fork). If you can guide me of how to cherry pick a specific commit for the PR Ill do it.

https://github.com/ArthurG/Kijiji-Repost-Headless/pull/211/commits/00249925049ad5e94df69346c813ab417e13a0f7 FZF, SXIV, SXRF, default editor, and multiple addresses by zalmoxis · Pull Request #211 · ArthurG/Kijiji-Repost-Headless

https://github.com/zalmoxis/Kijiji-Repost-Headless/commit/00249925049ad5e94df69346c813ab417e13a0f7 fixed xsrf issue with delete · zalmoxis/Kijiji-Repost-Headless@0024992

zalmoxis avatar Feb 22 '21 19:02 zalmoxis

don't know how to create a PR from just the co

TBH I havent done that before, I would guess you just make a new branch off of master and do a git-cherry-pick from there: https://stackoverflow.com/questions/35437253/how-to-git-cherrypick-all-changes-introduced-in-specific-branch

Also already have one up https://github.com/ArthurG/Kijiji-Repost-Headless/pull/214

meeoh avatar Feb 22 '21 19:02 meeoh