From 3db24d341fd54ab3debd11e28d9ca2ccc28d3b2f Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Fri, 26 Sep 2014 16:13:33 -0300 Subject: Use textwrap to have nicer multiple-line strings. --- bundler/actions.py | 93 +++++++++++++++++++++++++++++------------------------- 1 file changed, 50 insertions(+), 43 deletions(-) diff --git a/bundler/actions.py b/bundler/actions.py index 3cb4a6b..20d99f5 100644 --- a/bundler/actions.py +++ b/bundler/actions.py @@ -4,6 +4,7 @@ import os import stat import subprocess import sys +import textwrap import urllib import zipfile @@ -367,33 +368,36 @@ class CopyBinaries(Action): class PLister(Action): - plist = """ - - - - CFBundleDisplayName - Bitmask - CFBundleExecutable - MacOS/bitmask-launcher - CFBundleIconFile - bitmask.icns - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - Bitmask - CFBundlePackageType - APPL - CFBundleShortVersionString - 1 - LSBackgroundOnly - - CFBundleIdentifier - se.leap.bitmask - -""".split("\n") - - qtconf = """[Paths] -Plugins = PlugIns""" + plist = textwrap.dedent("""\ + + + + + CFBundleDisplayName + Bitmask + CFBundleExecutable + MacOS/bitmask-launcher + CFBundleIconFile + bitmask.icns + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Bitmask + CFBundlePackageType + APPL + CFBundleShortVersionString + 1 + LSBackgroundOnly + + CFBundleIdentifier + se.leap.bitmask + + """).split("\n") + + qtconf = textwrap.dedent( + """\ + [Paths] + Plugins = PlugIns""") def __init__(self, basedir, skip, do): Action.__init__(self, "plister", basedir, skip, do) @@ -431,18 +435,20 @@ class SeededConfig(Action): class DarwinLauncher(Action): - launcher = """#!/bin/bash -# -# Launcher for the LEAP Client under OSX -# -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)" -export DYLD_LIBRARY_PATH=$DIR/lib -export PATH=$DIR/../Resources/:$PATH -# --------------------------- -# DEBUG Info -- enable this if you -# are having problems with dynamic libraries loading - -cd "${DIR}" && ./Bitmask $1 $2 $3 $4 $5""".split("\n") + launcher = textwrap.dedent( + """\ + #!/bin/bash + # + # Launcher for the LEAP Client under OSX + # + DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)" + export DYLD_LIBRARY_PATH=$DIR/lib + export PATH=$DIR/../Resources/:$PATH + # --------------------------- + # DEBUG Info -- enable this if you + # are having problems with dynamic libraries loading + + cd "${DIR}" && ./Bitmask $1 $2 $3 $4 $5""").split("\n") def __init__(self, basedir, skip, do): Action.__init__(self, "darwinlauncher", basedir, skip, do) @@ -483,11 +489,12 @@ class CopyAssets(Action): class CopyMisc(Action): - TUF_CONFIG="""[General] -updater_delay = 60 + TUF_CONFIG = textwrap.dedent("""\ + [General] + updater_delay = 60 -[Mirror.localhost] -url_prefix = http://dl.bitmask.net/tuf""" + [Mirror.localhost] + url_prefix = http://dl.bitmask.net/tuf""") def __init__(self, basedir, skip, do): Action.__init__(self, "copymisc", basedir, skip, do) -- cgit v1.2.3