Skip to content
Merged
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
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
outputs:
output1: ${{ steps.step1.outputs.test }}
steps:
- uses: actions/checkout@v3.1.0
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update Build Number
Expand All @@ -30,12 +30,12 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v3.1.0
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v4.3.0
uses: actions/setup-python@v5
with:
python-version: 3.9
cache: 'pip'
Expand All @@ -56,7 +56,7 @@ jobs:
if: matrix.os == 'ubuntu-latest'

- name: Upload Wheel
uses: actions/upload-artifact@v3.1.0
uses: actions/upload-artifact@v4
with:
name: pros-cli-wheel-${{needs.update_build_number.outputs.output1}}
path: dist/*
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
mv intercept-c++ pros

- name: Upload Artifact
uses: actions/upload-artifact@v3.1.0
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{needs.update_build_number.outputs.output1}}
path: dist/*
path: dist/pros/*
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ out/
*.zip
*_pros_capture.png

venv/

*venv/
.DS_Store
*.pyc
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include pros/autocomplete/*
2 changes: 1 addition & 1 deletion pip_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.5.4
3.5.5
2 changes: 1 addition & 1 deletion pros/cli/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def resolve_v5_port(port: Optional[str], type: str, quiet: bool = False) -> Tupl
return None, False
else:
port = ports[0].device
is_joystick = type == 'user' and 'Controller' in ports[0].description
is_joystick = type == 'user' and ('Controller' in ports[0].description or ports[0].pid == 0x503)
logger(__name__).info('Automatically selected {}'.format(port))
return port, is_joystick

Expand Down
2 changes: 1 addition & 1 deletion pros/cli/conductor.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def new_project(ctx: click.Context, path: str, target: str, version: str,
ui.echo('New PROS Project was created:', output_machine=False)
ctx.invoke(info_project, project=project)

if compile_after or build_cache:
if (compile_after or build_cache) and not no_default_libs:
with ui.Notification():
ui.echo('Building project...')
exit_code = project.compile([], scan_build=build_cache)
Expand Down
2 changes: 2 additions & 0 deletions pros/cli/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ def upload(path: Optional[str], project: Optional[c.Project], port: str, **kwarg
kwargs['slot'] = 1
if 'icon' in options and kwargs.get('icon','pros') == 'pros':
kwargs.pop('icon')
if 'description' in options and kwargs.get('description','Made with PROS') == 'Made with PROS':
kwargs.pop('description')
if 'after' in options and kwargs.get('after','screen') is None:
kwargs.pop('after')

Expand Down
4 changes: 3 additions & 1 deletion pros/conductor/project/ProjectReport.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ def __str__(self):
f' ({self.project["name"]})' if self.project["name"] else ''
s += '\n'
rows = [t.values() for t in self.project["templates"]]
headers = [h.capitalize() for h in self.project["templates"][0].keys()]

headers = [h.capitalize() for h in self.project["templates"][0].keys()]if self.project["templates"] else []
s += tabulate.tabulate(rows, headers=headers)

return s

def __getstate__(self):
Expand Down
2 changes: 0 additions & 2 deletions pros/conductor/project/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ def new_user_filter(new_file: str) -> bool:
def remove_template(self, template: Template, remove_user: bool = False, remove_empty_directories: bool = True):
if not self.template_is_installed(template):
raise ValueError(f'{template.identifier} is not installed on this project.')
if template.name == 'kernel':
raise ValueError(f'Cannot remove the kernel template. Maybe create a new project?')

real_template = LocalTemplate(orig=template, location=self.location)
transaction = Transaction(self.location, set(self.all_files))
Expand Down
2 changes: 1 addition & 1 deletion pros/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self, file, error_on_decode=False):
if file:
# If the file already exists, update this new config with the values in the file
if os.path.isfile(file):
with open(file, 'r') as f:
with open(file, 'r', encoding ='utf-8') as f:
try:
result = jsonpickle.decode(f.read())
if isinstance(result, dict):
Expand Down
13 changes: 10 additions & 3 deletions pros/serial/devices/vex/v5_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,14 @@ def write_file(self, file: typing.BinaryIO, remote_file: str, file_len: int = -1
if compress and self.status['system_version'] in Spec('>=1.0.5'):
logger(__name__).info('Closing gzip file')
file.close()
self.ft_complete(options=run_after)
# The time to write the file to flash isn't exactly linear with the file size,
# but it's okay even if we slightly underestimate as long as we get a response back
# on one of the 3 tries of ft_complete.
# The point is to set our timeout window so we aren't waiting too long for a response
# that will never happen if, for example, the brain turned off.
ft_timeout = max(file_len/200000, 1.0)
logger(__name__).debug(f'Setting file transfer timeout as {ft_timeout:.2f} seconds')
self.ft_complete(options=run_after, timeout=ft_timeout)

@with_download_channel
def capture_screen(self) -> Tuple[List[List[int]], int, int]:
Expand Down Expand Up @@ -688,12 +695,12 @@ def ft_initialize(self, file_name: str, **kwargs) -> Dict[str, Any]:
return rx

@retries
def ft_complete(self, options: FTCompleteOptions = FTCompleteOptions.DONT_RUN):
def ft_complete(self, options: FTCompleteOptions = FTCompleteOptions.DONT_RUN, timeout: float = 1.0):
logger(__name__).debug('Sending ext 0x12 command')
if isinstance(options, bool):
options = self.FTCompleteOptions.RUN_IMMEDIATELY if options else self.FTCompleteOptions.DONT_RUN
tx_payload = struct.pack("<B", options.value)
ret = self._txrx_ext_packet(0x12, tx_payload, 0, timeout=self.default_timeout * 10)
ret = self._txrx_ext_packet(0x12, tx_payload, 0, timeout=timeout)
logger(__name__).debug('Completed ext 0x12 command')
return ret

Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
'pros=pros.cli.main:main',
'prosv5=pros.cli.main:main'
]
}
},
include_package_data=True,
)
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.5.4
3.5.5
2 changes: 1 addition & 1 deletion win_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.5.4.0
3.5.5.0
Loading