Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Oct 19, 2025. It is now read-only.

Latest commit

 

History

History
History
33 lines (30 loc) · 1.33 KB

File metadata and controls

33 lines (30 loc) · 1.33 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# -*- coding:utf-8 -*-
import re
import sys,os
def updateHeader(DIR, PROJ):
for path in os.listdir(DIR):
fullPath = os.path.join(DIR, path)
if os.path.isdir(fullPath):
if path != "Pods":
updateHeader(fullPath, PROJ)
elif os.path.isfile(fullPath):
if path.lower().endswith('.m') or path.lower().endswith('.h'):
print('Updating: %s' % (path))
codeFile = open(fullPath, 'r+')
content = codeFile.read()
content = re.sub('^(//[^\n]*\n)+//(?P<smile>[^\n]*)\n',
'//\n' +
'// ' + path + '\n' +
'// ' + PROJ + '\n' +
'//\n' +
'// Copyright (c) 2017-2018 Alibaba. All rights reserved.\n' +
'//' + '\g<smile>' + '\n',
content)
codeFile.seek(0)
codeFile.write(content)
codeFile.truncate()
codeFile.close()
updateHeader(os.path.join(sys.path[0], 'Tangram'), 'Tangram')
updateHeader(os.path.join(sys.path[0], 'TangramDemo'), 'TangramDemo')
# updateHeader(os.path.join(sys.path[0], 'TangramTest'), 'TangramTest')
print('Header updating is done.')
Morty Proxy This is a proxified and sanitized view of the page, visit original site.