Added micropythonrc file

basic powershell script to write project files to board
the beginnings of what will hopefully be a micropython port of py-jira
This commit is contained in:
Matthew Connelly 2018-06-12 18:00:00 +01:00
parent b19a681565
commit 9be6ca2e3b
4 changed files with 76 additions and 0 deletions

0
.micropythonrc Normal file
View File

58
flash.ps1 Normal file
View File

@ -0,0 +1,58 @@
param(
[String]$COMPort,
[switch]$Extras,
[switch]$ResetAfterFlash,
[String[]]$Libs
)
Function Write-AmpyFile {
[cmdletbinding()]
param(
[String]$Filename,
[String]$COMPort
)
If ((Get-Command -Name ampy -ErrorAction SilentlyContinue) -eq $false) {
Write-Error -Message "Couldn't locate ``ampy`` in environment paths - please run ``pip install adafruit-ampy``." -ErrorAction Stop
}
ampy -p $COMPort put $Filename
}
Function Reset-AmpyDevice {
[cmdletbinding()]
param(
[String]$COMPort
)
If ((Get-Command -Name ampy -ErrorAction SilentlyContinue) -eq $false) {
Write-Error -Message "Couldn't locate ``ampy`` in environment paths - please run ``pip install adafruit-ampy``." -ErrorAction Stop
}
ampy -p $COMPort reset
}
$BaseFiles=(
'boot',
'main',
'uPyConfig'
)
$ExtraFiles=(
'init_sample'
)
$CfgFiles=(
'wifi_cfg',
'webrepl_cfg'
)
$BaseFiles | % {
Write-AmpyFile -Filename "$_.py" -COMPort $COMPort
}
$CfgFiles | % {
If (Get-ChildItem "$_.py" -ErrorAction SilentlyContinue) {
Write-AmpyFile -Filename "$_.py" -COMPort $COMPort
}
}
If ($Extras) { $ExtraFiles | % {
Write-AmpyFile -Filename "$_.py" -COMPort $COMPort
}}
If ($Libs.Count -gt 0) { $Libs | %{
Write-AmpyFile -Filename "$_.py" -COMPort $COMPort
}}
If ($ResetAfterFlash) { Reset-AmpyDevice -COMPort $COMPort }

View File

@ -6,3 +6,10 @@ import init_sample
init_sample.PrintHWInfo(hw)
# Main app
import uJIRA
jcloud = uJIRA.client('tradeprint.atlassian.net')
auth = {
'method': 'basic-auth',
'username': '',
'password': '',
}

11
uJIRA.py Normal file
View File

@ -0,0 +1,11 @@
import ussl
import urequests
import usocket
class client:
def __init__(self, jira_server):
self.base_uri=jira_server
def login(self, params):
self.method = params['method']
self.username = params['username']