Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

remove invoke from code and dependency (closes #72) #74

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

remove invoke from code and dependency (closes #72) #74

wants to merge 3 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Jul 25, 2017

I tried to remove all invoke dependencies.

Mostly I was lazy and just changed it for the subprocess equivalent, althought I am sure that stuff can be done without invoking the likes of mv and sed (which makes this part of code linux only, btw.)

Reason for not wanting invoke: It is not easily found in distributions, and has quite some shadowy sides.

@toirl toirl self-requested a review July 26, 2017 08:03
@toirl
Copy link
Member

toirl commented Jul 26, 2017

I have tried this version but I have some problems running at least one command:

agrav-admin fixtures load --path ../demodata                                                                          26.Jul.17 10.00
sed: -e Ausdruck #1, Zeichen 1: Unbekannter Befehl: `''
sed: -e Ausdruck #1, Zeichen 1: Unbekannter Befehl: `''
Loading data in 
Loading fixture 0_users.json
Traceback (most recent call last):
  File "/home/torsten/Entwicklung/ringo-apps/agrav/env/bin/agrav-admin", line 9, in <module>
    load_entry_point('agrav', 'console_scripts', 'agrav-admin')()
  File "/home/torsten/Entwicklung/ringo-apps/agrav/lib/ringo/ringo/scripts/admin.py", line 356, in main
    args.func(args)
  File "/home/torsten/Entwicklung/ringo-apps/agrav/lib/ringo/ringo/scripts/fixture.py", line 13, in handle_fixture_load_command
    args.config,modul,fixture])
  File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

On master exact this code works as expected.

@ghost
Copy link
Author

ghost commented Jul 26, 2017

The command "agrav-admin" was not found.

Apparently invoke automatically adds some (to me, unknown) paths to sys.path, so that an executable will be found if in those paths (probably somewhere in .virtualenv/...?) .

Subprocess takes the system's $path.

I am currently not sure how to solve this, as I don't know where ringo places these binaries, and I don't really want to take "just some binary that is conveniently called like the file I am looking for".

@ghost ghost mentioned this pull request Jul 26, 2017
@g-tom
Copy link

g-tom commented Aug 25, 2017

The command "agrav-admin" was not found.

I suspect there's any good reason to use an applications own user interface inside that very same application.

Instead of invokeing each other, the *-admin commands should be able to use the Python-API directly. Or do I miss something here, @toirl?

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

Successfully merging this pull request may close these issues.

2 participants