-def py2exe_options():
- if os.name == 'nt':
- import py2exe
- return {
- "console" : [ { "script": "openerp-server", "icon_resources": [(1, join("pixmaps","openerp-icon.ico"))], }],
- 'options' : {
- "py2exe": {
- "skip_archive": 1,
- "optimize": 2,
- "dist_dir": 'dist',
- "packages": [ "DAV", "HTMLParser", "PIL", "asynchat", "asyncore", "commands", "dateutil", "decimal", "email", "encodings", "imaplib", "lxml", "lxml._elementpath", "lxml.builder", "lxml.etree", "lxml.objectify", "mako", "openerp", "poplib", "pychart", "pydot", "pyparsing", "reportlab", "select", "simplejson", "smtplib", "uuid", "vatnumber" "vobject", "xml", "xml", "xml.dom", "xml.xpath", "yaml", ],
- "excludes" : ["Tkconstants","Tkinter","tcl"],
- }
- }
- }
- else:
- return {}
+FILE_PATTERNS = \
+ r'.+\.(py|cfg|po|pot|mo|txt|rst|gif|png|jpg|ico|mako|html|js|css|htc|swf)$'
+def find_data_files(source, patterns=FILE_PATTERNS):
+ file_matcher = re.compile(patterns, re.I)
+ out = []
+ for base, _, files in os.walk(source):
+ cur_files = []
+ for f in files:
+ if file_matcher.match(f):
+ cur_files.append(os.path.join(base, f))
+ if cur_files:
+ out.append(
+ (base, cur_files))