You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.3 KiB
46 lines
1.3 KiB
8 years ago
|
#!/usr/bin/python3
|
||
|
# -*- coding: utf-8 -*-
|
||
|
|
||
|
from BF_Constants import *
|
||
|
|
||
|
def is_int(stringInteger):
|
||
|
try:
|
||
|
int(stringInteger)
|
||
|
return True
|
||
|
except ValueError:
|
||
|
return False
|
||
|
|
||
|
def is_float(stringFloat):
|
||
|
try:
|
||
|
float(stringFloat)
|
||
|
return True
|
||
|
except ValueError:
|
||
|
return False
|
||
|
|
||
|
def getValueWithKey(value):
|
||
|
value = str(value)
|
||
|
argvArray = value.split(LAN_CONSTANTS.MESSAGE_SPECIAL_CHAR.SEPARATOR.value)
|
||
|
for argv in argvArray:
|
||
|
key = argv.split(LAN_CONSTANTS.MESSAGE_SPECIAL_CHAR.ASIGNATOR.value)
|
||
|
key = key[0]
|
||
|
value = argv.split(LAN_CONSTANTS.MESSAGE_SPECIAL_CHAR.ASIGNATOR.value)
|
||
|
value = value[1]
|
||
|
return key, value
|
||
|
|
||
|
def createMessage(key,value,isNotLast):
|
||
|
value = str(value)
|
||
|
message = key + LAN_CONSTANTS.MESSAGE_SPECIAL_CHAR.ASIGNATOR.value + value
|
||
|
if isNotLast:
|
||
|
message = message + LAN_CONSTANTS.MESSAGE_SPECIAL_CHAR.SEPARATOR.value
|
||
|
return message
|
||
|
|
||
|
def createMessageList(key,content,isNotLast):
|
||
|
message = key + LAN_CONSTANTS.MESSAGE_SPECIAL_CHAR.ASIGNATOR.value
|
||
|
for i in range(0,len(content)):
|
||
|
message = message + str(content[i])
|
||
|
if i < len(content) -1:
|
||
|
message = message + LAN_CONSTANTS.MESSAGE_SPECIAL_CHAR.SAME_VALUE_SEPRATOR.value
|
||
|
if isNotLast:
|
||
|
message = message + LAN_CONSTANTS.MESSAGE_SPECIAL_CHAR.SEPARATOR.value
|
||
|
return message
|
||
|
|