diff options
Diffstat (limited to 'makescripts/xobuild.py')
-rw-r--r-- | makescripts/xobuild.py | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/makescripts/xobuild.py b/makescripts/xobuild.py deleted file mode 100644 index 300c2e9..0000000 --- a/makescripts/xobuild.py +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# -# Copyright (C) 2012 S. Daniel Francis <francis@sugarlabs.org> -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# 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., 51 Franklin Street, Fifth Floor, Boston, -# MA 02110-1301, USA. - -import sys -import os -sys.path.append(os.path.abspath('.')) -os.environ['INFO_L10N'] = '0' -import zipfile -import info - -ignore_ends = ['.pyc', '~'] -ignores = ['makescripts', 'Makefile', 'install', - 'desktop', 'install', '.git', '.gitignore', - 'mimetypes.xml', 'mimetype.png', - info.file_filter_mime.replace('/', '-') + '.xml', - info.lower_name, info.lower_name + '.desktop', - info.lower_name + '.png', - 'data/appicon.svg', # Comment this line if you feel it's necessary. - 'application.py'] -manifest = [] - -def validate(path): - """Validate - Checks in the ignored files and ends""" - if path in ignores: - return False - for i in ignore_ends: - if path[-len(i):] == i: - return False - return True - -def packdir(path, newpath=None): - for i in os.listdir(path): - filepath = os.path.join(path, i) - filename = filepath[2:] - if validate(filename): - if os.path.isdir(filepath): - if filename == 'sugar': - for name in os.listdir(filepath): - new_filepath = os.path.join(filepath, name) - new_filename = new_filepath[2:] - if validate(new_filename): - packdir(new_filepath, os.path.join(newpath, name)) - else: - if newpath: - packdir(filepath, os.path.join(newpath, filename)) - else: - packdir(filepath) - else: - new_path = list(os.path.split(filename)) - if newpath: - global new_path - if newpath != '.': - new_path[0] = newpath - manifest.append((filename, '/'.join(new_path))) - print '%s listed to pack' % filename - -packdir('./', '%s.activity' % info.name.replace(' ', '')) - -xofile = zipfile.ZipFile('./%s-%s.xo' % (info.name.replace(' ', ''), - info.version), 'w') -for name, path in manifest: - xofile.write(name, path) - print 'Packed %s as %s' % (name, path) -xofile.close() |