Пример #1
0
"""

from __future__ import unicode_literals
from subprocess import (check_output as sp_co, check_call as sp_cc)
from os import path, unlink, rename
from hashlib import md5 as hl_md5
import json
from urllib import urlretrieve
from fileinput import (input as fi_input, close as fi_close)
from re import compile as re_compile
from sys import argv as sys_argv
from collections import deque
from filecmp import cmp as filecmp_cmp


md5_hex = lambda a_str: hl_md5(a_str.encode('utf-8')).hexdigest().upper()


class XUnique(object):
    def __init__(self, xcodeproj_path):
        # check project path
        abs_xcodeproj_path = path.abspath(xcodeproj_path)
        if not path.exists(abs_xcodeproj_path):
            raise SystemExit('Path "{!r}" does not exist!'.format(abs_xcodeproj_path))
        elif xcodeproj_path.endswith(('xcodeproj', 'xcodeproj/')):
            self.xcodeproj_path = abs_xcodeproj_path
            self.xcode_pbxproj_path = path.join(abs_xcodeproj_path, 'project.pbxproj')
        elif abs_xcodeproj_path.endswith('project.pbxproj'):
            self.xcode_pbxproj_path = abs_xcodeproj_path
            self.xcodeproj_path = path.split(self.xcode_pbxproj_path)[0]
        else:
Пример #2
0
from __future__ import unicode_literals
from __future__ import print_function
from subprocess import (check_output as sp_co, CalledProcessError)
from os import path, unlink, rename
from hashlib import md5 as hl_md5
from json import (loads as json_loads, dump as json_dump)
from fileinput import (input as fi_input, close as fi_close)
from re import compile as re_compile
from sys import (argv as sys_argv, getfilesystemencoding as
                 sys_get_fs_encoding)
from collections import deque
from filecmp import cmp as filecmp_cmp
from optparse import OptionParser

md5_hex = lambda a_str: hl_md5(a_str.encode('utf-8')).hexdigest().upper()
print_ng = lambda *args, **kwargs: print(
    *[unicode(i).encode(sys_get_fs_encoding()) for i in args], **kwargs)
# output_u8line = lambda a_unicode: print(a_unicode.encode('utf-8'), end='')
output_u8line = lambda *args: print(
    *[unicode(i).encode('utf-8') for i in args], end='')


def warning_print(*args, **kwargs):
    new_args = list(args)
    new_args[0] = '\x1B[33m{}'.format(new_args[0])
    new_args[-1] = '{}\x1B[0m'.format(new_args[-1])
    print_ng(*new_args, **kwargs)


def success_print(*args, **kwargs):
Пример #3
0
def md5_hex(a_str):
    return hl_md5(a_str.encode('utf-8')).hexdigest().upper()