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

ENH: Add quack compilation to setup.py #1

Merged
merged 5 commits into from
Apr 6, 2015

Conversation

ElDeveloper
Copy link
Collaborator

If a C compiler and Make are available, quack will be compiled and
installed when running setup.py, otherwise the mac-update.sh script will
fall-back to using osascript.

If a C compiler and Make are available, quack will be compiled and
installed when running setup.py, otherwise the mac-update.sh script will
fall-back to using osascript.
@ElDeveloper
Copy link
Collaborator Author

BTW, I'm all for making any changes to main.m, your C-fu is much more powerful than mine.

@ElDeveloper ElDeveloper changed the title ENH: Add quack compile to setup.py ENH: Add quack compilation to setup.py Apr 3, 2015
@SantiagoTorres
Copy link
Owner

Wow this is great, thanks @ElDeveloper !

I'm wondering if instead of keeping the automator script we could:

  • change to your other alternative.
  • Pre-compile and host the binary elsewhere....

What do you think?

@ElDeveloper
Copy link
Collaborator Author

Hmmm, what about 1) tries to compile, 2) tries to download binary and 3)
falls back to the applescript. If we decide to go with this we are gonna
need to find a way to host the binary and compile it to keep it up to
date every time main.m changes.

On (Apr-03-15| 9:37), Santiago Torres wrote:

Wow this is great, thanks @ElDeveloper !

I'm wondering if instead of keeping the automator script we could:

  • change to your other alternative.
  • Pre-compile and host the binary elsewhere....

What do you think?


Reply to this email directly or view it on GitHub:
#1 (comment)

@SantiagoTorres
Copy link
Owner

^ This would make sense 👍

Hosting the binary somewhere doesn't seem that much of a challenge. I'm thinking of a git hook on the server side and finding a way to compile OSX binaries.

In the meantime we can get 1 and 3 to integrate this into the codebase ASAP and move 2) to a ticket.

@ElDeveloper
Copy link
Collaborator Author

Ok, I've opened #2

tell application "Finder"
set desktop picture to POSIX file "$1"
end tell
if quack -h &>/dev/null; then
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if test ([) is a better command for this.

if [ -e quack ]
then
   ....

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think so:

yoshikivazquezbaeza:~$ ls quack
ls: quack: No such file or directory
yoshikivazquezbaeza:~$ which quack
/Library/Frameworks/Python.framework/Versions/2.7/bin/quack
yoshikivazquezbaeza:~$ if [ -e quack ]; then echo "plel"; else echo "lolercoaster"; fi
lolercoaster

@SantiagoTorres
Copy link
Owner

In general it looks in good shape. My last comment is that mac-update.sh could be "deprecated" in the long run. We could instead change to quack as the definitive manager for the image and update it at configuration time by setting the update hook to be "quack -i {target}.

@ElDeveloper
Copy link
Collaborator Author

Ready for another round.

You have to trick it into thinking you are using a different background
image.
FN=${1}-temp.jpg
cp $1 $FN

if quack -h &>/dev/null; then
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still not completely convinced about this, it is not self-explanatory:

  • Why quack -h?
  • Are we testing that quack exists or that it runs successfully?

I'd rather go with an alternative that is self descriptive here:

if [-e $(which quack)] 
...

or

if which quack

For that matter.

@SantiagoTorres
Copy link
Owner

@ElDeveloper Guess that's all 💯

SantiagoTorres added a commit that referenced this pull request Apr 6, 2015
ENH: Add quack compilation to setup.py
@SantiagoTorres SantiagoTorres merged commit 8deaaa9 into SantiagoTorres:master Apr 6, 2015
@ElDeveloper
Copy link
Collaborator Author

Thanks!

On (Apr-05-15|20:17), Santiago Torres wrote:

@ElDeveloper Guess that's all 💯


Reply to this email directly or view it on GitHub:
#1 (comment)

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

Successfully merging this pull request may close these issues.

None yet

2 participants