Giter Club home page Giter Club logo

pymacadmin's People

Contributors

acdha avatar clintonblackmore avatar nigelkersten avatar unixorn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

pymacadmin's Issues

Seeing a backtrace

Oct  2 04:29:02 pluto org.crankd.plist[58620]: INFO: NSWorkspace Notification 
NSWorkspaceDidWakeNotification: executing /bin/echo "The system woke from 
sleep!"
Oct  2 04:29:02 pluto org.crankd.plist[58620]: Traceback (most recent call 
last):
Oct  2 04:29:02 pluto org.crankd.plist[58620]:   File 
"/usr/local/sbin/crankd.py", line 597, in <module>
Oct  2 04:29:02 pluto org.crankd.plist[58620]:     main()
Oct  2 04:29:02 pluto org.crankd.plist[58620]:   File 
"/usr/local/sbin/crankd.py", line 523, in main
Oct  2 04:29:02 pluto org.crankd.plist[58620]:     
AppHelper.runConsoleEventLoop(installInterrupt=True)
Oct  2 04:29:02 pluto org.crankd.plist[58620]:   File 
"/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/PyOb
jC/PyObjCTools/AppHelper.py", line 178, in runConsoleEventLoop
Oct  2 04:29:02 pluto org.crankd.plist[58620]:     if not 
runLoop.runMode_beforeDate_(mode, nextfire):
Oct  2 04:29:02 pluto org.crankd.plist[58620]:   File 
"/usr/local/sbin/crankd.py", line 110, in onNotification_
Oct  2 04:29:02 pluto org.crankd.plist[58620]:     
self.callable(user_info=user_info) # pylint: disable-msg=E1101
Oct  2 04:29:02 pluto org.crankd.plist[58620]:   File 
"/usr/local/sbin/crankd.py", line 558, in do_shell
Oct  2 04:29:02 pluto org.crankd.plist[58620]:     for k, v in 
kwargs['user_info'].items():
Oct  2 04:29:02 pluto org.crankd.plist[58620]: AttributeError: 'NoneType' 
object has no attribute 'items'

Original issue reported on code.google.com by [email protected] on 2 Oct 2011 at 8:36

Update to run on py27

Nothing was holding on to the handlers after the loop ends, so they were being 
release before the notification fired. This is a problem with py27, which seems 
to have ARC enabled.

Also, the NS prefix is reserved for Apple use, so rename NSNotificationHandler 
to NotificationHandler

Original issue reported on code.google.com by [email protected] on 21 Jan 2014 at 9:05

Attachments:

Installing things in crazy places!

What is it doing putting crankd.py in /usr/local/stow/leafnode-1.11.8/sbin/ ?
This is very surprising!

pluto:~/src/pymacadmin dave% sudo ./install-crankd.sh
pluto:~/src/pymacadmin dave% /usr/local/sbin/crankd.py 
Module directory /Users/dave/Library/Application Support/crankd does not exist: 
Python handlers will need to use absolute pathnames
INFO: /Users/dave/Library/Preferences/com.googlecode.pymacadmin.crankd.plist 
does not exist - initializing with an example configuration
Creating /Users/dave/Library/Preferences/com.googlecode.pymacadmin.crankd.plist 
with default options for you to customize
/usr/local/stow/leafnode-1.11.8/sbin/crankd.py --list-events will list the 
events you can monitor on this system
pluto:~/src/pymacadmin dave% less /usr/local/stow/leafnode-1.11.8/sbin/crankd.py

Original issue reported on code.google.com by [email protected] on 25 Sep 2011 at 4:46

PyPI distro is broken

I don't know if you're responsible for that package, but:

% sudo pip install PyMacAdmin
Downloading/unpacking PyMacAdmin
  Downloading PyMacAdmin-1.0.macosx-10.5-i386.tar.gz
  Running setup.py egg_info for package PyMacAdmin
    Traceback (most recent call last):
      File "<string>", line 14, in <module>
    IOError: [Errno 2] No such file or directory: '/private/tmp/build/PyMacAdmin/setup.py'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 14, in <module>

IOError: [Errno 2] No such file or directory: 
'/private/tmp/build/PyMacAdmin/setup.py'

Original issue reported on code.google.com by [email protected] on 25 Sep 2011 at 4:33

crankd doesn't handle nsdistributednotifications, now it does

I have GeekTool installed(v3 is applescriptable. In particular, you can
tell it to refresh certain geeklets, allowing one to update a geeklet on an
event supported by crankd) and I wanted a way to avoid polling for iTunes
track information because that drained my macbook's battery pretty quickly
so I took a look at crankd.  I quickly realized that it didn't support
NSDistributedNotifications so I wrote in support for that particular
notification type.
When the initial patch was finished, I discovered that there might be a
quirk(maybe this "quirk" is by design, I don't know) with the way the
NSDistributedNotificationCenter handles an application launch/quit.  I
found that if you're subscribed to an event and the application emitting
that event quits and subsequently relaunches, the handler will never be
called again.
I wrote another patch to fix this problem.  It adds a config option for
NSDistrbutedNotifications, process, that tells crankd to subscribe to
ApplicationDidLaunch events with a special handler, do_reload.  When an
application is launched, the do_reload handler is called and checks the
process name against the config option.  If they match, the
DistNotification is reloaded and hence the handler is valid once again. 
This handler won't replace any existing appdidlaunch events.

The patched version of crankd is attached to this issue with changes marked
by the comment "# distnot patch: change" (where change is what was added).
 FYI: All spaces were converted to tabs.

btw, I wanted to take this opportunity to thank you for crankd, it's been
working amazingly well for me :D.

Original issue reported on code.google.com by [email protected] on 10 Dec 2009 at 9:34

Attachments:

applescript fails when interacting with GUI app

What steps will reproduce the problem?
1. Call applescript that does "tell application xyz" (where xyz is a GUI
application) from a handler.  crankd must be running via launchd.

What is the expected output? What do you see instead?
Expected Output: result from applescript
Actual Output: applescript fails because it doesn't have a connection to
WindowServer


What version of the product are you using? On what operating system?
Version: current posted version
OS: 10.5.8


Please provide any additional information below.
As a work-around, I've wrapped crankd in a Platypus app that runs on login
after 30 seconds.  Is it possible for crankd to obtain the proper
WindowServer handle from launchd/somewhere and execute in that context?  I
don't even know where to start (patch-wise) if it is possible so I can't
really help with this (except testing).

Original issue reported on code.google.com by [email protected] on 10 Dec 2009 at 9:37

non-ASCII characters in notification data crashes crankd

I recently discovered a bug in crankd's handling of characters outside of
standard ASCII when it's parsing the userdata in the notification.

replace the line under:
    for k in [ 'info', 'key' ]:
        if k in kwargs and kwargs[k]:
with:
                child_env['CRANKD_%s' % k.upper()] = str(kwargs[k])
            except Exception:
                child_env['CRANKD_%s' % k.upper()] = kwargs[k].encode('utf-8')

replace the line under:
    if 'user_info' in kwargs:
        for k, v in kwargs['user_info'].items():
with:
            try:
                child_env[create_env_name(k)] = str(v)
            except Exception:
                child_env[create_env_name(k)] = v.encode('utf-8')

This should fix the problem.  I've been running several foreign characters
through crankd to test (such as ë, é) and it hasn't failed.

Original issue reported on code.google.com by [email protected] on 9 Jan 2010 at 7:07

Issues with running on boot.

What steps will reproduce the problem?
1. Create /Library/LaunchAgents/org.crankd.plist with the ProgramArguments 
String /usr/local/sbin/crankd.py 
--config=/Library/Preferences/com.googlecode.pymacadmin.crankd.plist
2. Create /Library/Preferences/com.googlecode.pymacadmin.crankd.plist with 
whatever configuration script you want.
3. Run launchctl load /Library/LaunchAgents/org.crankd.plist

What is the expected output? What do you see instead?
The configuration script to be executed.

Instead I see Console messages with the error
"(org.crankd.plist[621]) posix_spawn("/usr/local/sbin/crankd.py 
--config=/Library/Preferences/com.googlecode.pymacadmin.crankd.plist", ...): No 
such file or directory"

What version of the product are you using? On what operating system?
OS X 10.7.2

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 18 Oct 2011 at 2:20

Changes made to an individual location happen to other locations after creating them with create-location.py

What steps will reproduce the problem?
1. Create multiple locations with create-location.py
2. Use networksetup to configure network settings or just use Sys Prefs
3.

What is the expected output? What do you see instead?
Configuration changes (such as setting proxy, turning off interfaces etc)
happens across all locations made with the script not just the one.

What version of the product are you using? On what operating system?
Mac OS X 10.5.6

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 10 Mar 2009 at 4:02

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.