pep8 compliance: E262 inline comment should start with '# '

This commit is contained in:
David Sowder 2012-02-19 19:07:36 -06:00
parent 58c5d6c3dc
commit b99c425a67

View File

@ -53,7 +53,7 @@ def getTexturePacks():
return [] return []
#for k,v in os.environ.iteritems(): # for k,v in os.environ.iteritems():
# try: # try:
# os.environ[k] = v.decode(sys.getfilesystemencoding()) # os.environ[k] = v.decode(sys.getfilesystemencoding())
# except: # except:
@ -72,7 +72,7 @@ if sys.platform == "win32":
try: try:
import win32com.client import win32com.client
from win32com.shell import shell, shellcon #@UnresolvedImport from win32com.shell import shell, shellcon # @UnresolvedImport
except: except:
pass pass
@ -131,13 +131,13 @@ def askOpenFile(title='Select a Minecraft level....', schematics=False):
op.setDirectory_(initialDir) op.setDirectory_(initialDir)
if op.runModal() == 0: if op.runModal() == 0:
return #pressed cancel return # pressed cancel
AppKit.NSApp.mainWindow().makeKeyWindow() AppKit.NSApp.mainWindow().makeKeyWindow()
return op.filename() return op.filename()
else: #linux else: # linux
return request_old_filename(suffixes=suffixes, directory=initialDir) return request_old_filename(suffixes=suffixes, directory=initialDir)
@ -152,7 +152,7 @@ def askOpenFile(title='Select a Minecraft level....', schematics=False):
def askOpenFileWin32(title, schematics, initialDir): def askOpenFileWin32(title, schematics, initialDir):
try: try:
#if schematics: # if schematics:
f = ('Levels and Schematics\0*.mclevel;*.dat;*.mine;*.mine.gz;*.schematic;*.zip;*.schematic.gz;*.inv\0' + f = ('Levels and Schematics\0*.mclevel;*.dat;*.mine;*.mine.gz;*.schematic;*.zip;*.schematic.gz;*.inv\0' +
'*.*\0*.*\0\0') '*.*\0*.*\0\0')
# else: # else:
@ -167,7 +167,7 @@ def askOpenFileWin32(title, schematics, initialDir):
| win32con.OFN_NOCHANGEDIR | win32con.OFN_NOCHANGEDIR
| win32con.OFN_FILEMUSTEXIST | win32con.OFN_FILEMUSTEXIST
| win32con.OFN_LONGNAMES | win32con.OFN_LONGNAMES
#|win32con.OFN_EXTENSIONDIFFERENT # |win32con.OFN_EXTENSIONDIFFERENT
), ),
Title=title, Title=title,
Filter=f, Filter=f,
@ -225,10 +225,10 @@ def askSaveFile(initialDir, title, defaultName, filetype, suffix):
sp = AppKit.NSSavePanel.savePanel() sp = AppKit.NSSavePanel.savePanel()
sp.setDirectory_(initialDir) sp.setDirectory_(initialDir)
sp.setAllowedFileTypes_([suffix]) sp.setAllowedFileTypes_([suffix])
#sp.setFilename_(self.editor.level.displayName) # sp.setFilename_(self.editor.level.displayName)
if sp.runModal() == 0: if sp.runModal() == 0:
return #pressed cancel return # pressed cancel
filename = sp.filename() filename = sp.filename()
AppKit.NSApp.mainWindow().makeKeyWindow() AppKit.NSApp.mainWindow().makeKeyWindow()
@ -248,7 +248,7 @@ def askSaveFile(initialDir, title, defaultName, filetype, suffix):
# #
# (filename, customfilter, flags) = win32gui.GetSaveFileNameW( # (filename, customfilter, flags) = win32gui.GetSaveFileNameW(
# hwndOwner = display.get_wm_info()['window'], # hwndOwner = display.get_wm_info()['window'],
# #InitialDir=saveFileDir, # # InitialDir=saveFileDir,
# Flags=win32con.OFN_EXPLORER | win32con.OFN_NOCHANGEDIR | win32con.OFN_OVERWRITEPROMPT, # Flags=win32con.OFN_EXPLORER | win32con.OFN_NOCHANGEDIR | win32con.OFN_OVERWRITEPROMPT,
# File=initialDir + os.sep + displayName, # File=initialDir + os.sep + displayName,
# DefExt=fileFormat, # DefExt=fileFormat,
@ -263,10 +263,10 @@ def askSaveFile(initialDir, title, defaultName, filetype, suffix):
# sp = AppKit.NSSavePanel.savePanel(); # sp = AppKit.NSSavePanel.savePanel();
# sp.setDirectory_(initialDir) # sp.setDirectory_(initialDir)
# sp.setAllowedFileTypes_([fileFormat]) # sp.setAllowedFileTypes_([fileFormat])
# #sp.setFilename_(self.editor.level.displayName) # # sp.setFilename_(self.editor.level.displayName)
# #
# if sp.runModal() == 0: # if sp.runModal() == 0:
# return; #pressed cancel # return; # pressed cancel
# #
# filename = sp.filename() # filename = sp.filename()
# AppKit.NSApp.mainWindow().makeKeyWindow(); # AppKit.NSApp.mainWindow().makeKeyWindow();
@ -311,9 +311,9 @@ def platform_open(path):
try: try:
if sys.platform == "win32": if sys.platform == "win32":
os.startfile(path) os.startfile(path)
#os.system('start ' + path + '\'') # os.system('start ' + path + '\'')
elif sys.platform == "darwin": elif sys.platform == "darwin":
#os.startfile(path) # os.startfile(path)
os.system('open "' + path + '"') os.system('open "' + path + '"')
else: else:
os.system('xdg-open "' + path + '"') os.system('xdg-open "' + path + '"')
@ -333,7 +333,7 @@ fixedSchematicsDir = os.path.join(docsFolder, u"MCEdit-schematics")
if sys.platform == "darwin": if sys.platform == "darwin":
#parentDir is MCEdit.app/Contents/ # parentDir is MCEdit.app/Contents/
folderContainingAppPackage = dirname(dirname(parentDir)) folderContainingAppPackage = dirname(dirname(parentDir))
oldPath = fixedConfigFilePath oldPath = fixedConfigFilePath
fixedConfigFilePath = os.path.expanduser("~/Library/Preferences/mcedit.ini") fixedConfigFilePath = os.path.expanduser("~/Library/Preferences/mcedit.ini")
@ -392,8 +392,8 @@ def goFixed():
portable = False portable = False
def portableConfigExists(): def portableConfigExists():
return (os.path.exists(portableConfigFilePath) #mcedit.ini in MCEdit folder return (os.path.exists(portableConfigFilePath) # mcedit.ini in MCEdit folder
or (sys.platform != 'darwin' and not os.path.exists(fixedConfigFilePath))) #no mcedit.ini in Documents folder (except on OS X when we always want it in Library/Preferences or (sys.platform != 'darwin' and not os.path.exists(fixedConfigFilePath))) # no mcedit.ini in Documents folder (except on OS X when we always want it in Library/Preferences
if "-fixed" not in sys.argv and ("-portable" in sys.argv or portableConfigExists()): if "-fixed" not in sys.argv and ("-portable" in sys.argv or portableConfigExists()):
print "Running in portable mode. MCEdit-schematics and mcedit.ini are stored alongside " + (sys.platform == "darwin" and "the MCEdit app bundle" or "MCEditData") print "Running in portable mode. MCEdit-schematics and mcedit.ini are stored alongside " + (sys.platform == "darwin" and "the MCEdit app bundle" or "MCEditData")