Skip to content

Commit

Permalink
FIX: #6 Support substitution variable MATCH_OS_LANGUAGE in recipes.
Browse files Browse the repository at this point in the history
  • Loading branch information
mosen committed Jan 23, 2017
1 parent 276c62c commit 20e9bd2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.
6 changes: 5 additions & 1 deletion Adobe/CreativeCloudApp.pkg.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Other Input values here correspond to options provided in the CCP UI.</string>
<key>Input</key>
<dict>
<key>NAME</key>
<string>AdobePhotoshopCC2017</string>
<string>CreativeCloudApp</string>
<!-- Org name is shown in the upper right hand corner of the Enterprise Dashboard web interface -->
<key>ORG_NAME</key>
<string>ADMIN_PLEASE_OVERRIDE</string>
Expand Down Expand Up @@ -55,6 +55,8 @@ Other Input values here correspond to options provided in the CCP UI.</string>
<string></string>
<key>DEPLOYMENT_POOL</key>
<string></string>
<key>MATCH_OS_LANGUAGE</key>
<string>true</string>
</dict>
<key>MinimumVersion</key>
<string>0.4.0</string>
Expand Down Expand Up @@ -102,6 +104,8 @@ Other Input values here correspond to options provided in the CCP UI.</string>
<string>%SERIAL_NUMBER%</string>
<key>device_pool_name</key>
<string>%DEPLOYMENT_POOL%</string>
<key>match_os_language</key>
<string>%MATCH_OS_LANGUAGE%</string>
</dict>
</dict>
</array>
Expand Down
31 changes: 20 additions & 11 deletions Adobe/CreativeCloudPackager.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
CCP_ERROR_MSGS = {
"CustomerTypeMismatchError": \
("Please check that your organization is of the correct "
"type, either 'enterprise' or 'team'."),
"type, one of ({}).".format(', '.join(CUSTOMER_TYPES))),
"TronWelcomeInputValidationError": \
("Please check that your ORG_NAME matches one to which your "
"CCP-signed-in user ""belongs."),
Expand Down Expand Up @@ -108,6 +108,11 @@ class CreativeCloudPackager(Processor):
"default": True,
"description": "Include all available updates, defaults to true.",
},
"match_os_language": {
"required": False,
"default": "true",
"description": "Match the Operating System language when building packages, default is True."
},
"language": {
"required": False,
"default": "en_US",
Expand Down Expand Up @@ -225,7 +230,11 @@ def automation_xml(self):
is_64.text = 'true'
pkg_elem.append(is_64)
match_os = ElementTree.Element('matchOSLanguage')
match_os.text = 'true'
if params.get('match_os_language', 'true').lower() == 'false':
match_os.text = 'false'
else:
match_os.text = 'true'

pkg_elem.append(match_os)

# substituting snake case for camel case for all top-level elements
Expand Down Expand Up @@ -289,15 +298,15 @@ def automation_xml(self):

def set_customer_type(self):
# Set the customer type, using CCP's preferences if none provided
if not self.env.get("customer_type"):
ccp_prefs = self.ccp_preferences()
self.env['customer_type'] = ccp_prefs.get("customer_type")
if not self.env.get("customer_type"):
raise ProcessorError(
"No customer_type input provided and unable to read one "
"from %s" % CCP_PREFS_FILE)
self.output("Using customer type '%s' found in CCPPreferences: %s'"
% (self.env['customer_type'], CCP_PREFS_FILE))
# if not self.env.get("customer_type"):
# ccp_prefs = self.ccp_preferences()
# self.env['customer_type'] = ccp_prefs.get("customer_type")
# if not self.env.get("customer_type"):
# raise ProcessorError(
# "No customer_type input provided and unable to read one "
# "from %s" % CCP_PREFS_FILE)
# self.output("Using customer type '%s' found in CCPPreferences: %s'"
# % (self.env['customer_type'], CCP_PREFS_FILE))

if self.env['customer_type'] not in CUSTOMER_TYPES:
raise ProcessorError(
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ AutoPkg recipes for Creative Cloud Packager workflows
## Overview

These processors and recipes may be used to automate the creation of Adobe Creative Cloud Packager packages.
Based upon Adobes documentation for [Creative Cloud Packager Automation](https://helpx.adobe.com/creative-cloud/packager/ccp-automation.html)

## Getting Started

Expand Down

0 comments on commit 20e9bd2

Please sign in to comment.