Skip to content

Commit

Permalink
Applanga Command Line Interface Version 1.0.103
Browse files Browse the repository at this point in the history
  • Loading branch information
steffen-roemer committed Dec 10, 2024
1 parent 1f343e1 commit 60a2ff1
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
*Applanga CLI Documentation:* <https://www.applanga.com/docs-integration/cli>
***

### Version 1.0.103 (10 Dec 2024)
#### Fixed
- Fixed contradictory configurations error messages for ios / ios_stringsdict overlap
---

### Version 1.0.102 (21 Nov 2024)
#### Fixed
- Fixed initialize script and documentation for android / ios default setup
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Applanga Localization Command Line Interface (CLI)

***
*Version:* 1.0.102
*Version:* 1.0.103

*Website:* <https://www.applanga.com>

Expand Down
3 changes: 2 additions & 1 deletion lib/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import requests
import json
import os
import errno
import re
import time
from lib import constants
Expand Down Expand Up @@ -137,7 +138,7 @@ def downloadFile(file_data, debug=False):
try:
os.makedirs(os.path.dirname(file_path))
except OSError as e:
if e.errno != os.errno.EEXIST:
if e.errno != errno.EEXIST:
raise

open(file_path, 'wb').write(response.content)
Expand Down
15 changes: 14 additions & 1 deletion lib/config_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ def __init__(self, fileBlockData):
if 'exclude_languages' in fileBlockData:
self.exclude_languages = fileBlockData['exclude_languages']

self.file_format = None
if 'file_format' in fileBlockData:
self.file_format = fileBlockData['file_format']

def compareTag(self, other):
tagEqual = None
if isinstance(self.tag, list):
Expand All @@ -170,6 +174,12 @@ def compareTag(self, other):
tagEqual = self.tag
return tagEqual

def ignoreFormatOverlap(self, other):
for exclude in constants.EXCLUDE_FORMAT_OVERLAP:
if (self.file_format == exclude[0] and other.file_format == exclude[1]) or (self.file_format == exclude[1] and other.file_format == exclude[0]):
return True
return False

def compare(self, other):
if self.tag == None and other.tag == None:
return False
Expand All @@ -179,6 +189,9 @@ def compare(self, other):
if tagEqual == False:
return False

if self.ignoreFormatOverlap(other):
return False

if self.language == None:
if other.language == None:
if set(self.exclude_languages).intersection(other.exclude_languages):
Expand All @@ -197,7 +210,7 @@ def compare(self, other):


def __str__(self):
return '''{language}:{tag}:{path}:{exc}'''.format(tag=self.tag, language=self.language, path=self.path, exc=self.exclude_languages)
return '''{language}:{tag}:{path}:{exc}:{format}'''.format(tag=self.tag, language=self.language, path=self.path, exc=self.exclude_languages, format=self.file_format)



Expand Down
3 changes: 2 additions & 1 deletion lib/constants.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
VERSION_NUMBER = '1.0.102'
VERSION_NUMBER = '1.0.103'
APPLANGA_HOST = 'https://api.applanga.com'
API_BASE_PATH = '/v1/api'
CONFIG_FILE_NAME = '.applanga.json'
DEBUG_TEXT_COLOR = 'blue'
ENVIRONMENT_VARIABLE = 'APPLANGA_CONFIG'
X_INTEGRATION_HEADER_VALUE = '1'
EXCLUDE_FORMAT_OVERLAP = [['ios_strings', 'ios_stringsdict']]
FILE_FORMATS = {
'android_xml': {
'name': 'Android XML',
Expand Down

0 comments on commit 60a2ff1

Please sign in to comment.