Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
rmdir /q /s import-mailbox-to-gmail
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add cd "%~dp0" to the top of the file.

rmdir /q /s import-mailbox-to-gmail-64
rmdir /q /s build
rmdir /q /s dist
del /q /f import-mailbox-to-gmail-%1-windows.zip
del /q /f import-mailbox-to-gmail-%1-windows-x64.zip

c:\python27-32\scripts\pyinstaller -F --distpath=import-mailbox-to-gmail import-mailbox-to-gmail.spec
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make the paths (e.g. c:\python27-32 and 7zip's path) in central variables?

xcopy LICENSE import-mailbox-to-gmail\
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add some error handling here, e.g. if errorlevel 1 and print an error message and exit the file.

del import-mailbox-to-gmail\w9xpopen.exe
"%ProgramFiles(x86)%\7-Zip\7z.exe" a -tzip import-mailbox-to-gmail-%1-windows.zip import-mailbox-to-gmail\ -xr!.svn

c:\python27\scripts\pyinstaller -F --distpath=import-mailbox-to-gmail-64 import-mailbox-to-gmail.spec
xcopy LICENSE import-mailbox-to-gmail-64\
xcopy whatsnew.txt import-mailbox-to-gmail-64\
"%ProgramFiles(x86)%\7-Zip\7z.exe" a -tzip import-mailbox-to-gmail-%1-windows-x64.zip import-mailbox-to-gmail-64\ -xr!.svn
7 changes: 3 additions & 4 deletions import-mailbox-to-gmail.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@
import os
import sys

from apiclient import discovery
from apiclient.http import set_user_agent
from googleapiclient import discovery
from googleapiclient.http import set_user_agent
import httplib2
from apiclient.http import MediaIoBaseUpload
from googleapiclient.http import MediaIoBaseUpload
from oauth2client.service_account import ServiceAccountCredentials
import oauth2client.tools
import OpenSSL # Required by Google API library, but not checked by it

APPLICATION_NAME = 'import-mailbox-to-gmail'
APPLICATION_VERSION = '1.3'
Expand Down
21 changes: 21 additions & 0 deletions import-mailbox-to-gmail.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- mode: python -*-
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add some comment(s) to the file? All of these lines just seem arbitrary. :) At least mention it's for pyinstaller.

a = Analysis(['import-mailbox-to-gmail.py'],
hiddenimports=[],
hookspath=None,
runtime_hooks=None)
for d in a.datas:
if 'pyconfig' in d[0]:
a.datas.remove(d)
break
a.datas += [('httplib2/cacerts.txt', 'c:\python27\lib\site-packages\httplib2\cacerts.txt', 'DATA')]
pyz = PYZ(a.pure)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name='import-mailbox-to-gmail.exe',
debug=False,
strip=None,
upx=True,
console=True )