本文整理汇总了Python中exe.engine.path.Path.walk方法的典型用法代码示例。如果您正苦于以下问题:Python Path.walk方法的具体用法?Python Path.walk怎么用?Python Path.walk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类exe.engine.path.Path
的用法示例。
在下文中一共展示了Path.walk方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: function
# 需要导入模块: from exe.engine.path import Path [as 别名]
# 或者: from exe.engine.path.Path import walk [as 别名]
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# ===========================================================================
'''Envelop with eXe translation function ("_") all tinymce english lang strings
Depends on demjson python module to parse json. "apt-get install python-demjson"
'''
from exe.engine.path import Path
import demjson
if __name__ == '__main__':
basedir = Path() / 'exe' / 'webui' / 'scripts' / 'tinymce_3.5.7' / 'jscripts' / 'tiny_mce'
for path in basedir.walk('en*.js'):
pathdir = path.dirname()
f = path.bytes()
s = '{' + f.partition('{')[2]
s = s.rpartition('}')[0] + '}'
json = demjson.decode(s)
replacements = []
def update_string(string):
global f, replacements
if type(string) == dict:
for v in string.values():
update_string(v)
else:
if string:
string = string.replace('\n', '\\n')