Skip to content

Integrated handling for filesystem and gzipped binaries #8266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
28c79fa
Add functionality to copy generated binaries into sketch folder
gneiss15 Aug 2, 2021
8c7445b
Merge branch 'master' into master
gneiss15 Aug 9, 2021
4f6340e
Integrated handling for filesystem and gzipped Binaries
gneiss15 Aug 13, 2021
5509ba4
Forgot to add new tools to git
gneiss15 Aug 13, 2021
71d4213
Minor bugfix
gneiss15 Aug 13, 2021
62ca3b6
Debug for failed check in Pull-Request
gneiss15 Aug 13, 2021
6091823
Ignore files generated by boards.txt.py & my extra files
gneiss15 Aug 13, 2021
158484f
More Debug for failed check in Pull-Request
gneiss15 Aug 13, 2021
cf02d41
Bugfix for check
gneiss15 Aug 13, 2021
dd93598
And another bigfix :-(
gneiss15 Aug 13, 2021
f39b549
Changed mod a+x (as all other .py)
gneiss15 Aug 13, 2021
43f9e21
Syntax error in utilities.py may be the reason for failed import. Cor…
gneiss15 Aug 13, 2021
6849302
instead of external commd, use python module gzip
gneiss15 Aug 18, 2021
d86910c
Integrated handling for filesystem and gzipped binaries (#1)
gneiss15 Aug 18, 2021
ea98d66
Improved handling of "tkinter not awailable"
gneiss15 Aug 18, 2021
fc74ac7
Merge branch 'master' into Integrated-handling-for-filesystem-and-gzi…
gneiss15 Aug 18, 2021
b827489
Improved selection of actions to be performed
gneiss15 Aug 23, 2021
8c06e83
Merge branch 'master' of https://github.com/esp8266/Arduino into esp8…
gneiss15 Sep 5, 2021
cbc8f4d
Merge branch 'esp8266-master' into Integrated-handling-for-filesystem…
gneiss15 Sep 5, 2021
87eacb4
Remover empthy dir
gneiss15 Sep 8, 2021
32d715a
Merge branch 'Integrated-handling-for-filesystem-and-gzipped-Binaries…
gneiss15 Sep 8, 2021
3380148
Changes as requested by d-a-v
gneiss15 Sep 15, 2021
311c9c3
Removed changes not contained inside master
gneiss15 Sep 15, 2021
b7751e3
platformio-build.py forgotten
gneiss15 Sep 15, 2021
9d1ded0
Merge branch 'master' into Integrated-handling-for-filesystem-and-gzi…
gneiss15 Sep 18, 2021
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
Prev Previous commit
Next Next commit
Syntax error in utilities.py may be the reason for failed import. Cor…
…reted
  • Loading branch information
gneiss15 committed Aug 13, 2021
commit 43f9e21461215fb95b5e72472c4b016c84e076d4
4 changes: 2 additions & 2 deletions tools/netUploadGn.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
try:
sys.path.insert( 0, ToolsDir ) # ToolsDir
from utillities import * # If this fails, we can't continue and will bomb below
except Exception:
sys.stderr.write( '\nutillities.py not found next to this %s tool.\n' % __file__ )
except Exception as e:
sys.stderr.write( '\nImport of utillities.py failed.\n...Is it not next to this %s tool?\n...Exception was: %s\n' % ( __file__, e ) )
sys.exit( 2 )

try:
Expand Down
14 changes: 3 additions & 11 deletions tools/postbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,12 @@
import os
import sys
ToolsDir = os.path.dirname( os.path.realpath( __file__ ) ).replace( '\\', '/' ) + "/" # convert to UNIX format
sys.stderr.write( '\nDebug for failed check in Pull-Request:\n' )
sys.stderr.write( '...ToolsDir: %s\n' % ToolsDir )
sys.stderr.write( '...sys.path (before insert): %s\n' % ", ".join( sys.path ) )
sys.stderr.write( '...os.path.exists( ToolsDir/utillities.py ): %s\n"' % ( "Yes" if os.path.exists( ToolsDir + "utillities.py" ) else "No" ) )
try:
sys.path.insert( 0, ToolsDir ) # ToolsDir
sys.stderr.write( '...sys.path (after insert): %s\n' % ", ".join( sys.path ) )
from utillities import * # If this fails, we can't continue and will bomb below
except Exception:
try:
from .utillities import * # If this fails, we can't continue and will bomb below
except Exception:
sys.stderr.write( '\nutillities.py not found next to this %s tool.\n' % __file__ )
sys.exit( 2 )
except Exception as e:
sys.stderr.write( '\nImport of utillities.py failed.\n...Is it not next to this %s tool?\n...Exception was: %s\n' % ( __file__, e ) )
sys.exit( 2 )

def parse_args( argsIn ):
parser = argparse.ArgumentParser( description = 'PostBuild for ESP8288' )
Expand Down
4 changes: 2 additions & 2 deletions tools/uploadGn.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
try:
sys.path.insert( 0, ToolsDir ) # ToolsDir
from utillities import * # If this fails, we can't continue and will bomb below
except Exception:
sys.stderr.write( '\nutillities.py not found next to this %s tool.\n' % __file__ )
except Exception as e:
sys.stderr.write( '\nImport of utillities.py failed.\n...Is it not next to this %s tool?\n...Exception was: %s\n' % ( __file__, e ) )
sys.exit( 2 )
import tempfile
from pathlib import Path
Expand Down
19 changes: 5 additions & 14 deletions tools/utillities.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def Which( prg, dir = None ):
Takes care of OS, on Windows searches for <prg>.exe instead of <prg>.
if <dir> is given prefers prg inside this dir over others"""
if platform.system() == "Windows":
prg = "%s.exe" % prg
prg = "%s.exe" % prg
res = None
if dir is not None:
res = Which_Chdir_( prg, dir )
Expand All @@ -62,23 +62,14 @@ def CopyToDir( name, ext, dstDir ):
fileName = "%s.%s" % ( name, ext )
srcPath = os.path.abspath( fileName )
if not os.path.exists( srcPath ):
return []
return []
shutil.copyfile( srcPath, os.path.join( dstDir, fileName ) )
return [ fileName ]

def IntValFromStr( strVal ):
""" Convert string into integer, can be used with decimal value '123' or hex '0xabc'. """
return int( strVal.strip(), 0 )

def CountFilesInDir( dataDir ):
fileCount = 0
for root, dir, files in os.walk( dataDir ):
for file in files:
#!? Why Ony count files without '.' ??
if file[ 0 ] != ".":
fileCount += 1
return fileCount

def RemoveIno( path ):
""" Returns the given path with extension ".ino" removed (if exist) """
if path[ -4: ] == ".ino":
Expand All @@ -87,10 +78,10 @@ def RemoveIno( path ):

def ConfirmDialog( title, text ):
try:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it a leftover ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it is the base of (for ex.) ConfirmDialog & WarningDialog which are used inside postbuild.py

Copy link
Collaborator

Choose a reason for hiding this comment

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

Anything with python must be cross-compatible with all archs.
A portable version of python is shipped by the installer and I doubt tkinter will work in that case.

import tkinter
from tkinter import messagebox
import tkinter
from tkinter import messagebox
except:
raise ProcessError( "tkinter not available.\nPlease install it with:\npip3 install tkinter\n" ))
raise ProcessError( "tkinter not available.\nPlease install it with:\npip3 install tkinter\n" )
rootWin = tkinter.Tk() # Create the object
rootWin.overrideredirect( 1 ) # Avoid it appearing and then disappearing quickly
#rootWin.iconbitmap("PythonIcon.ico") # Set an icon (this is optional - must be in a .ico format)
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy