Permalink
Browse files

Merge branch 'Munki3dev'

  • Loading branch information...
gregneagle committed Sep 21, 2017
2 parents 91b43fd + e13c21e commit bdfca0b789ea4a6d7badbab3a27f843607b92454
Showing with 1,695 additions and 511 deletions.
  1. +6 −2 code/apps/Managed Software Center/Managed Software Center.xcodeproj/project.pbxproj
  2. +3 −7 code/apps/Managed Software Center/Managed Software Center/AlertController.py
  3. +92 −0 code/apps/Managed Software Center/Managed Software Center/CocoaWrapper.py
  4. +6 −2 code/apps/Managed Software Center/Managed Software Center/MSCAppDelegate.py
  5. +6 −2 code/apps/Managed Software Center/Managed Software Center/MSCBadgedTemplateImage.py
  6. +10 −5 code/apps/Managed Software Center/Managed Software Center/MSCLogWindowController.py
  7. +22 −6 code/apps/Managed Software Center/Managed Software Center/MSCMainWindowController.py
  8. +7 −2 code/apps/Managed Software Center/Managed Software Center/MSCPasswordAlertController.py
  9. +6 −2 code/apps/Managed Software Center/Managed Software Center/MSCStatusController.py
  10. +6 −2 code/apps/Managed Software Center/Managed Software Center/MSCToolbar.py
  11. +1 −1 code/apps/Managed Software Center/Managed Software Center/Managed Software Center-Info.plist
  12. +122 −20 code/apps/Managed Software Center/Managed Software Center/MunkiItems.py
  13. +2 −1 code/apps/Managed Software Center/Managed Software Center/WebResources/base.css
  14. +19 −1 code/apps/Managed Software Center/Managed Software Center/da.lproj/Localizable.strings
  15. +19 −1 code/apps/Managed Software Center/Managed Software Center/de.lproj/Localizable.strings
  16. +16 −18 code/apps/Managed Software Center/Managed Software Center/en.lproj/MainMenu.xib
  17. +19 −1 code/apps/Managed Software Center/Managed Software Center/es.lproj/Localizable.strings
  18. +19 −1 code/apps/Managed Software Center/Managed Software Center/fi.lproj/Localizable.strings
  19. +20 −1 code/apps/Managed Software Center/Managed Software Center/fr.lproj/Localizable.strings
  20. +19 −1 code/apps/Managed Software Center/Managed Software Center/it.lproj/Localizable.strings
  21. +19 −1 code/apps/Managed Software Center/Managed Software Center/ja.lproj/Localizable.strings
  22. +35 −3 code/apps/Managed Software Center/Managed Software Center/mschtml.py
  23. +49 −71 code/apps/Managed Software Center/Managed Software Center/munki.py
  24. +19 −1 code/apps/Managed Software Center/Managed Software Center/nb.lproj/Localizable.strings
  25. +19 −1 code/apps/Managed Software Center/Managed Software Center/nl.lproj/Localizable.strings
  26. +19 −1 code/apps/Managed Software Center/Managed Software Center/ru.lproj/Localizable.strings
  27. +19 −1 code/apps/Managed Software Center/Managed Software Center/sv.lproj/Localizable.strings
  28. +17 −1 code/apps/Managed Software Center/Managed Software Center/templates/updates_template.html
  29. +4 −0 code/apps/MunkiStatus/MunkiStatus.xcodeproj/project.pbxproj
  30. +55 −0 code/apps/MunkiStatus/MunkiStatus/CocoaWrapper.py
  31. +9 −5 code/apps/MunkiStatus/MunkiStatus/MSUAppDelegate.py
  32. +9 −5 code/apps/MunkiStatus/MunkiStatus/MSULogWindowController.py
  33. +10 −5 code/apps/MunkiStatus/MunkiStatus/MSUStatusWindowController.py
  34. +2 −2 code/apps/MunkiStatus/MunkiStatus/de.lproj/Localizable.strings
  35. +144 −135 code/client/makecatalogs
  36. +7 −0 code/client/makepkginfo
  37. +134 −60 code/client/managedsoftwareupdate
  38. +58 −1 code/client/manifestutil
  39. +24 −3 code/client/munkiimport
  40. +26 −0 code/client/munkilib/appleupdates/sync.py
  41. +1 −1 code/client/munkilib/authrestart/__init__.py
  42. +121 −0 code/client/munkilib/bootstrapping.py
  43. +9 −4 code/client/munkilib/constants.py
  44. +2 −2 code/client/munkilib/fetch.py
  45. +7 −4 code/client/munkilib/installer/core.py
  46. +14 −3 code/client/munkilib/munkirepo/FileRepo.py
  47. +63 −22 code/client/munkilib/osinstaller.py
  48. +85 −40 code/client/munkilib/powermgr.py
  49. +118 −23 code/client/munkilib/prefs.py
  50. +93 −20 code/client/munkilib/updatecheck/analyze.py
  51. +26 −12 code/client/munkilib/updatecheck/catalogs.py
  52. +12 −2 code/client/munkilib/updatecheck/core.py
  53. +31 −2 code/client/munkilib/updatecheck/download.py
  54. +1 −1 code/client/munkilib/version.plist
  55. +14 −3 code/tools/make_munki_mpkg_DEP.sh
@@ -9,6 +9,7 @@
/* Begin PBXBuildFile section */
650B29A419B69FC800A5E946 /* MSCToolbar.py in Resources */ = {isa = PBXBuildFile; fileRef = 650B29A319B69FC800A5E946 /* MSCToolbar.py */; };
C00A4C57185FCEC9004EB3B7 /* FoundationPlist.py in Resources */ = {isa = PBXBuildFile; fileRef = C00A4C56185FCEC9004EB3B7 /* FoundationPlist.py */; };
C00F67571F016C9F00D9007D /* CocoaWrapper.py in Resources */ = {isa = PBXBuildFile; fileRef = C00F67561F016C9F00D9007D /* CocoaWrapper.py */; };
C01B396D1EEA6A9000DFBA3B /* libpython2.7.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = C01B396C1EEA6A9000DFBA3B /* libpython2.7.dylib */; };
C01FBD311EA64CD600AE97EE /* passwdutil.py in Resources */ = {isa = PBXBuildFile; fileRef = C01FBD301EA64CD600AE97EE /* passwdutil.py */; };
C02C98891911B81D00425167 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = C02C98871911B81D00425167 /* Localizable.strings */; };
@@ -69,6 +70,7 @@
/* Begin PBXFileReference section */
650B29A319B69FC800A5E946 /* MSCToolbar.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = MSCToolbar.py; sourceTree = "<group>"; };
C00A4C56185FCEC9004EB3B7 /* FoundationPlist.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = FoundationPlist.py; sourceTree = "<group>"; };
C00F67561F016C9F00D9007D /* CocoaWrapper.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = CocoaWrapper.py; sourceTree = "<group>"; };
C01B396C1EEA6A9000DFBA3B /* libpython2.7.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libpython2.7.dylib; path = ../../../../../../../../../System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.dylib; sourceTree = SDKROOT; };
C01E26911B4DADDC005ACFFB /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/MainMenu.strings; sourceTree = "<group>"; };
C01E26921B4DADE4005ACFFB /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Localizable.strings; sourceTree = "<group>"; };
@@ -101,7 +103,7 @@
C02C988F1911B82E00425167 /* nb */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nb; path = nb.lproj/Localizable.strings; sourceTree = "<group>"; };
C02C98901911B83000425167 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = "<group>"; };
C02C98911911B83100425167 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Localizable.strings; sourceTree = "<group>"; };
C042CA141EAD86DE006CC681 /* MSCPasswordAlertController.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; name = MSCPasswordAlertController.py; path = "Managed Software Center/MSCPasswordAlertController.py"; sourceTree = "<group>"; };
C042CA141EAD86DE006CC681 /* MSCPasswordAlertController.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = MSCPasswordAlertController.py; sourceTree = "<group>"; };
C0453A201CCEF7B60002D396 /* MSCLogWindowController.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = MSCLogWindowController.py; sourceTree = "<group>"; };
C046261519FFF8C000AF1E48 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/MainMenu.strings; sourceTree = "<group>"; };
C046261619FFF8CC00AF1E48 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Localizable.strings; sourceTree = "<group>"; };
@@ -190,7 +192,6 @@
C09004E216CDD84E00BE34CE = {
isa = PBXGroup;
children = (
C042CA141EAD86DE006CC681 /* MSCPasswordAlertController.py */,
C09004F916CDD84E00BE34CE /* Managed Software Center */,
C0EF96B21ADDB90B002C02FF /* MSCDockTilePlugin */,
C09004F016CDD84E00BE34CE /* Frameworks */,
@@ -230,6 +231,7 @@
C09004F916CDD84E00BE34CE /* Managed Software Center */ = {
isa = PBXGroup;
children = (
C042CA141EAD86DE006CC681 /* MSCPasswordAlertController.py */,
C0B9E8B519AF7E9E00DB7247 /* Managed Software Center 10_6.icns */,
C094B6CE188F7C7700E06897 /* MSCStatusController.py */,
C05C3CEE188391F200095E65 /* munki.py */,
@@ -251,6 +253,7 @@
C01FBD301EA64CD600AE97EE /* passwdutil.py */,
650B29A319B69FC800A5E946 /* MSCToolbar.py */,
C0453A201CCEF7B60002D396 /* MSCLogWindowController.py */,
C00F67561F016C9F00D9007D /* CocoaWrapper.py */,
);
path = "Managed Software Center";
sourceTree = "<group>";
@@ -427,6 +430,7 @@
C02C98891911B81D00425167 /* Localizable.strings in Resources */,
C090050B16CDD84E00BE34CE /* MainMenu.xib in Resources */,
C049C9951AEC77DD00251D45 /* updatesTemplate.png in Resources */,
C00F67571F016C9F00D9007D /* CocoaWrapper.py in Resources */,
C090050616CDD84E00BE34CE /* main.py in Resources */,
C0E098BC1857A3C80045DEEB /* msclib.py in Resources */,
C042CA151EAD86DE006CC681 /* MSCPasswordAlertController.py in Resources */,
@@ -12,7 +12,6 @@
import munki
import msclog
import MunkiItems
from MSCPasswordAlertController import MSCPasswordAlertController

from objc import nil
from AppKit import *
@@ -36,7 +35,7 @@ def handlePossibleAuthRestart(self):
if (MunkiItems.updatesRequireRestart() and
authrestart.verify_user(username) and
not authrestart.verify_recovery_key_present()):
# FV is on and user is in list of FV users, so they can
# FV is on and user is in list of FV users, so they can
# authrestart, and we do not have a stored FV recovery
# key/password. So we should prompt the user for a password
# we can use for fdesetup authrestart
@@ -360,8 +359,7 @@ def alertedToFirmwareUpdatesAndCancelled(self):
firmware_alert_info = self.getFirmwareAlertInfo()
if not firmware_alert_info:
return False
power_info = munki.getPowerInfo()
on_battery_power = (power_info.get('PowerSource') == 'Battery Power')
on_battery_power = munki.onBatteryPower()
for item in firmware_alert_info:
alert = NSAlert.alertWithMessageText_defaultButton_alternateButton_otherButton_informativeTextWithFormat_(
item['name'],
@@ -392,9 +390,7 @@ def alertedToFirmwareUpdatesAndCancelled(self):
def alertedToRunningOnBatteryAndCancelled(self):
'''Returns True if we are running on battery and user clicks
the Cancel button'''
power_info = munki.getPowerInfo()
if (power_info.get('PowerSource') == 'Battery Power'
and power_info.get('BatteryCharge', 0) < 50):
if munki.onBatteryPower() and munki.getBatteryPercentage() < 50:
alert = NSAlert.alertWithMessageText_defaultButton_alternateButton_otherButton_informativeTextWithFormat_(
NSLocalizedString(
u"Your computer is not connected to a power source.",
@@ -0,0 +1,92 @@
# -*- coding: utf-8 -*-
#
# CocoaWrapper.py
# MunkiStatus
#
# Created by Greg Neagle on 6/26/17.
# Copyright (c) 2017 The Munki Project. All rights reserved.
#

"""Selectively import Cocoa symbols to speed up app launch.
Idea from Per Olofsson's AutoDMG"""

# PyLint cannot properly find names inside Cocoa libraries, so issues bogus
# No name 'Foo' in module 'Bar' warnings. Disable them.
# pylint: disable=no-name-in-module
#
# disable unused-import warning, since we don't use any of these here.
# pylint: disable=unused-import

# put all Foundation imports used by the project here
from Foundation import (
NSAppleEventManager,
NSBundle,
NSCachesDirectory,
NSData,
NSDate,
NSDateFormatter,
NSDateFormatterBehavior10_4,
NSFileHandle,
NSFileManager,
NSInsetRect,
NSLocalizedString,
NSLog,
NSMakePoint,
NSMakeRect,
NSMakeSize,
NSMinX,
NSMinY,
NSMutableArray,
NSObject,
NSOffsetRect,
NSPoint,
NSPredicate,
NSString,
NSTimer,
NSURL,
NSURLFileScheme,
NSURLRequest,
NSURLRequestReloadIgnoringLocalCacheData,
NSUTF8StringEncoding,
NSUserDomainMask,
NSUserName,
NSZeroRect,
kCFDateFormatterLongStyle,
kCFDateFormatterShortStyle,
)

# put all AppKit imports used by the project here
from AppKit import (
NSAlert,
NSAlertAlternateReturn,
NSAlertDefaultReturn,
NSAlertFirstButtonReturn,
NSAlertOtherReturn,
NSAlertSecondButtonReturn,
NSApp,
NSApplication,
NSBezierPath,
NSBitmapImageRep,
NSButton,
NSButtonCell,
NSColor,
NSCompositeCopy,
NSCriticalAlertStyle,
NSDistributedNotificationCenter,
NSDragOperationAll,
NSFontAttributeName,
NSFontManager,
NSGraphicsContext,
NSImage,
NSNotFound,
NSNotificationDeliverImmediately,
NSNotificationPostToAllSessions,
NSNotificationSuspensionBehaviorDeliverImmediately,
NSOnState,
NSPNGFileType,
NSPasteboard,
NSScreen,
NSUserNotificationCenter,
NSWindowController,
NSWorkspace,
)
@@ -24,8 +24,12 @@

from objc import YES, NO, IBAction, IBOutlet, nil
import PyObjCTools
from Foundation import *
from AppKit import *
#from Foundation import *
#from AppKit import *
# pylint: disable=wildcard-import
from CocoaWrapper import *
# pylint: enable=wildcard-import


from MSCStatusController import MSCStatusController

@@ -21,8 +21,12 @@
# builtin super doesn't work with Cocoa classes in recent PyObjC releases.
from objc import super

from Foundation import *
from AppKit import *
#from Foundation import *
#from AppKit import *
# pylint: disable=wildcard-import
from CocoaWrapper import *
# pylint: enable=wildcard-import


class MSCBadgedTemplateImage(NSImage):
'''Subclass to handle our updates template image with a badge showing the count
@@ -11,14 +11,19 @@
#

from objc import YES, NO, IBAction, IBOutlet
## pylint: disable=wildcard-import
## pylint: disable=unused-wildcard-import
## pylint: disable=redefined-builtin
#from Foundation import *
#from AppKit import *
## pylint: enable=redefined-builtin
## pylint: enable=wildcard-import

# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import
# pylint: disable=redefined-builtin
from Foundation import *
from AppKit import *
# pylint: enable=redefined-builtin
from CocoaWrapper import *
# pylint: enable=wildcard-import


import munki
import os

@@ -33,11 +33,20 @@
from objc import YES, NO, IBAction, IBOutlet, nil
from PyObjCTools import AppHelper

# Disable PyLint complaining about wildcard imports and unused symbols
# pylint: disable=W0401,W0614
from Foundation import *
from AppKit import *
from WebKit import *
## pylint: disable=wildcard-import
## pylint: disable=unused-wildcard-import
## pylint: disable=redefined-builtin
#from Foundation import *
#from AppKit import *
## pylint: enable=redefined-builtin
## pylint: enable=wildcard-import

# pylint: disable=wildcard-import
from CocoaWrapper import *
# pylint: enable=wildcard-import

#from WebKit import *
from WebKit import WebView, WebPreferences

# Disable PyLint complaining about 'invalid' camelCase names
# pylint: disable=C0103
@@ -155,7 +164,7 @@ def loadInitialView(self):
'''Called by app delegate from applicationDidFinishLaunching:'''
self.enableOrDisableSoftwareViewControls()
optional_items = MunkiItems.getOptionalInstallItems()
if not optional_items or self.getUpdateCount():
if not optional_items or self.getUpdateCount() or MunkiItems.getProblemItems():
self.loadUpdatesPage_(self)
else:
self.loadAllSoftwarePage_(self)
@@ -407,6 +416,13 @@ def checkForUpdates(self, suppress_apple_update_check=False):
else:
self.munkiStatusSessionEnded_(2)

@IBAction
def reloadPage_(self, sender):
'''User selected Reload page menu item. Reload the page and kick off an updatecheck'''
msclog.log('user', 'reload_page_menu_item_selected')
self.checkForUpdates()
self.webView.reload_(sender)

def kickOffInstallSession(self):
'''start an update install/removal session'''
# check for need to logout, restart, firmware warnings
@@ -9,12 +9,17 @@
'''Controller for our custom alert that prompts for password'''

from objc import IBAction, IBOutlet, nil
from AppKit import *
from Foundation import *
from PyObjCTools import AppHelper
from Quartz import CAKeyframeAnimation, CGPathCreateMutable
from Quartz import CGPathAddLineToPoint, CGPathMoveToPoint
from Quartz import CGPathCloseSubpath
#from Foundation import *
#from AppKit import *

# pylint: disable=wildcard-import
from CocoaWrapper import *
# pylint: enable=wildcard-import


import authrestart
import msclog
@@ -18,9 +18,13 @@


from objc import YES, IBOutlet, nil
from Foundation import *
from AppKit import *
from PyObjCTools import AppHelper
#from Foundation import *
#from AppKit import *

# pylint: disable=wildcard-import
from CocoaWrapper import *
# pylint: enable=wildcard-import

import munki
import msclog
@@ -10,8 +10,12 @@
from objc import super

from objc import YES, NO, nil
from Foundation import *
from AppKit import *
#from Foundation import *
#from AppKit import *
# pylint: disable=wildcard-import
from CocoaWrapper import *
# pylint: enable=wildcard-import



class MSCToolbarButton(NSButton):
@@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>4.6</string>
<string>4.7</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Oops, something went wrong.

0 comments on commit bdfca0b

Please sign in to comment.