From 2f2dc3c6985510745f562b35dbe0aed6cfb8e9d5 Mon Sep 17 00:00:00 2001 From: rzaitov Date: Fri, 1 Nov 2013 17:48:35 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B8=D0=BB=20=D0=BD?= =?UTF-8?q?=D0=B5=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D1=83=D0=B5?= =?UTF-8?q?=D0=BC=D1=8B=D0=B5=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CleanBuildCommandBuilder.py | 2 +- .../CleanBuildParser/test_cleanBuildParser.py | 2 +- scripts/commands/TestflightCommand.py | 9 ++++ scripts/commands/build_command.py | 44 ------------------- scripts/commands/testflight_command.py | 10 ----- scripts/parser/AttributeNameParser.py | 8 ---- .../CleanBuildParser.py | 0 scripts/parser/CleanBuildParser/__init__.py | 1 - scripts/parser/InfoplistParser/__init__.py | 1 - scripts/parser/StringValueParser.py | 10 ----- scripts/parser/token.py | 4 -- ...blisher_base.py => TestflightPublisher.py} | 2 +- .../utils/testflight/testflight_publisher.py | 22 ---------- 13 files changed, 12 insertions(+), 103 deletions(-) create mode 100644 scripts/commands/TestflightCommand.py delete mode 100644 scripts/commands/build_command.py delete mode 100644 scripts/commands/testflight_command.py delete mode 100644 scripts/parser/AttributeNameParser.py rename scripts/parser/{CleanBuildParser => }/CleanBuildParser.py (100%) delete mode 100644 scripts/parser/CleanBuildParser/__init__.py delete mode 100644 scripts/parser/InfoplistParser/__init__.py delete mode 100644 scripts/parser/StringValueParser.py delete mode 100644 scripts/parser/token.py rename scripts/utils/testflight/{testflight_publisher_base.py => TestflightPublisher.py} (91%) delete mode 100644 scripts/utils/testflight/testflight_publisher.py diff --git a/scripts/CommandBuilders/CleanBuildCommandBuilder.py b/scripts/CommandBuilders/CleanBuildCommandBuilder.py index ab47d24..cd8639f 100644 --- a/scripts/CommandBuilders/CleanBuildCommandBuilder.py +++ b/scripts/CommandBuilders/CleanBuildCommandBuilder.py @@ -1,6 +1,6 @@ from commands.CleanBuildCommands.BuildCommand import BuildCommand from commands.CleanBuildCommands.CleanCommand import CleanCommand -from parser.CleanBuildParser.CleanBuildParser import CleanBuildParser +from parser import CleanBuildParser class CleanBuildCommandBuilder: diff --git a/scripts/UnitTests/CleanBuildParser/test_cleanBuildParser.py b/scripts/UnitTests/CleanBuildParser/test_cleanBuildParser.py index cf0f49d..48c3bcc 100644 --- a/scripts/UnitTests/CleanBuildParser/test_cleanBuildParser.py +++ b/scripts/UnitTests/CleanBuildParser/test_cleanBuildParser.py @@ -1,5 +1,5 @@ import unittest -from parser.CleanBuildParser.CleanBuildParser import CleanBuildParser +from parser import CleanBuildParser class TestCleanBuildParser(unittest.TestCase): diff --git a/scripts/commands/TestflightCommand.py b/scripts/commands/TestflightCommand.py new file mode 100644 index 0000000..6f2e4e2 --- /dev/null +++ b/scripts/commands/TestflightCommand.py @@ -0,0 +1,9 @@ +from utils.testflight.TestflightPublisher import TestFlightPublisher + + +class PublishToTestFlightCommand: + def __init__(self, api_token, team_token, notes): + self._publisher = TestFlightPublisher(api_token, team_token, notes) + + def execute(self): + self._publisher.Publish() \ No newline at end of file diff --git a/scripts/commands/build_command.py b/scripts/commands/build_command.py deleted file mode 100644 index 3eb1db0..0000000 --- a/scripts/commands/build_command.py +++ /dev/null @@ -1,44 +0,0 @@ - - -class BuildCommand: - def SetCommandPrefix(self, value): - self._command_prefix = value - self._cmd_prefix_len = len(self._command_prefix) - - self._prefix_name= 'prefix' - self._app_name= 'app' - self._key_name = 'key' - - def __init__(self, config, cmd_prefix, separator=' '): - self._separator = separator - self._config = config - self.SetCommandPrefix(cmd_prefix) - - - def _parseConfig(self): - return None - - - def FetchAllKeysFromConfig(self): - all_keys = [] - - for k in self._config: - if k.startswith(self._command_prefix): - all_keys.append(k) - - print all_keys - return all_keys - - - def ParseValueFromToken(self, value_token): - value = value_token - - if value_token.startswith('@'): - key = value_token[1:] - value = self._config[key] - - return value - - - def execute(self): - return None diff --git a/scripts/commands/testflight_command.py b/scripts/commands/testflight_command.py deleted file mode 100644 index eb6f20d..0000000 --- a/scripts/commands/testflight_command.py +++ /dev/null @@ -1,10 +0,0 @@ -import commands.build_command as bcmd -import utils.testflight.testflight_publisher as tf - - -class PublishToTestFlightCommand(bcmd.BuildCommand): - def __init__(self, api_token, team_token, notes): - self._publisher = tf.TestFlightPublisherBase(api_token, team_token, notes) - - def execute(self): - self._publisher.Publish() \ No newline at end of file diff --git a/scripts/parser/AttributeNameParser.py b/scripts/parser/AttributeNameParser.py deleted file mode 100644 index c49226b..0000000 --- a/scripts/parser/AttributeNameParser.py +++ /dev/null @@ -1,8 +0,0 @@ -import parser.StringValueParser as parser - -class AttributeNameParser(parser.StringValueParser): - def __init__(self, attribute_name, model): - parser.StringValueParser.__init__(self, attribute_name, model) - - def ProcessToken(self, token): - self._model.rel_path = '' diff --git a/scripts/parser/CleanBuildParser/CleanBuildParser.py b/scripts/parser/CleanBuildParser.py similarity index 100% rename from scripts/parser/CleanBuildParser/CleanBuildParser.py rename to scripts/parser/CleanBuildParser.py diff --git a/scripts/parser/CleanBuildParser/__init__.py b/scripts/parser/CleanBuildParser/__init__.py deleted file mode 100644 index cc31abc..0000000 --- a/scripts/parser/CleanBuildParser/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__author__ = 'rzaitov' diff --git a/scripts/parser/InfoplistParser/__init__.py b/scripts/parser/InfoplistParser/__init__.py deleted file mode 100644 index cc31abc..0000000 --- a/scripts/parser/InfoplistParser/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__author__ = 'rzaitov' diff --git a/scripts/parser/StringValueParser.py b/scripts/parser/StringValueParser.py deleted file mode 100644 index 135e3b9..0000000 --- a/scripts/parser/StringValueParser.py +++ /dev/null @@ -1,10 +0,0 @@ -class StringValueParser: - def __init__(self, valid_string, model): - self._valid_string = valid_string - self._model = model - - def IsTokenValid(self, token): - return token == self._valid_string - - def ProcessToken(self, token): - pass diff --git a/scripts/parser/token.py b/scripts/parser/token.py deleted file mode 100644 index 6d9eacd..0000000 --- a/scripts/parser/token.py +++ /dev/null @@ -1,4 +0,0 @@ -class Token(): - def __init__(self, content, type): - self.content = content - self.type = type diff --git a/scripts/utils/testflight/testflight_publisher_base.py b/scripts/utils/testflight/TestflightPublisher.py similarity index 91% rename from scripts/utils/testflight/testflight_publisher_base.py rename to scripts/utils/testflight/TestflightPublisher.py index 7a74568..5450571 100644 --- a/scripts/utils/testflight/testflight_publisher_base.py +++ b/scripts/utils/testflight/TestflightPublisher.py @@ -1,7 +1,7 @@ from subprocess import call -class TestFlightPublisherBase: +class TestFlightPublisher: DefaultNotes = 'This build was uploaded via the upload API' def __init__(self, api_token, team_token, notes=DefaultNotes): diff --git a/scripts/utils/testflight/testflight_publisher.py b/scripts/utils/testflight/testflight_publisher.py deleted file mode 100644 index 0e5ac12..0000000 --- a/scripts/utils/testflight/testflight_publisher.py +++ /dev/null @@ -1,22 +0,0 @@ -import os -from utils import testflight as tf - - -class TestFlightPublisher(tf.TestFlightPublisherBase): - def __init__(self, config): - self._config = config - - api_token = config['tf_api_token'] - team_token = config['tf_team_token'] - notes = config.get('ft_notes', None) - - tf.TestFlightPublisherBase.__init__(self, api_token, team_token, notes) - - def Publish(self): - sln_path = self._config['sln_path'] - sln_dir = os.path.dirname(sln_path) - - ipa_rel_path = 'BuildSample/bin/iPhone/Release/BuildSample-{0}.ipa'.format(self._config['version']) - ipa_abs_path = os.path.join(sln_dir, ipa_rel_path) - - return tf.TestFlightPublisherBase.Publish(self, ipa_abs_path) \ No newline at end of file