Skip to content
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

231 device documentation return value description #232

Open
wants to merge 4 commits into
base: 1.18-forge
Choose a base branch
from

Conversation

zccafa3
Copy link
Contributor

@zccafa3 zccafa3 commented Aug 20, 2022

@zccafa3
Copy link
Contributor Author

zccafa3 commented Aug 20, 2022

Changes have not been built and integration tested.
Also I would have created some automated tests for the changes, but I am not familiar with java language, sorry.

Copy link

@CoolCat467 CoolCat467 left a comment

Choose a reason for hiding this comment

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

Seems simple enough, but wondering, what does removing the newline in FileImportExportCardItemDevice.java do?

@zccafa3
Copy link
Contributor Author

zccafa3 commented Aug 20, 2022

@CoolCat467 nothing significant, just a bit of house-work.

import devices

d_bus = devices.bus()

d_tn = "file_import_export"

for line in str(d_bus.find(type_name=d_tn)).split("\n"):
    doc = ""
    for index, char in enumerate(line):
        if index > 0 and index % 80 == 0:
            doc += "\n"
        doc += char
    print(doc)

Returns the following;

beginExportFile(name: String): void
Begins exporting a file to external data storage. Requires calls to writeExportF
ile() to provide data of the exported file and a call to finishExportFile() to c
omplete the export.
This method may error if the device is currently exporting or importing.
  name  the name of the file being exported.
writeExportFile(data: byte[]): void
Appends more data to the currently being exported file.
This method may error if the device is not currently exporting or the export was
 interrupted.

  data  the contents of the file being exported.
finishExportFile(): void
Finishes an export. This will prompt present users to select an external file lo
cation for the file being exported. If multiple users are present, the file is p
rovided to all users.
This method may error if the device is not currently exporting or the export was
 interrupted.
requestImportFile(): boolean
beginImportFile(): ImportedFileInfo
Begins a file import operation. This will prompt present users to select an exte
rnally stored file for import. If multiple users are present, the first user to 
select a file will have their file uploaded. Use the readImportFile() method to 
read the contents of the file being imported.
This method may error if the device is currently exporting or importing.
readImportFile(): byte[]
Tries to read some data from a file being imported. Returns zero length data if 
no data is available yet. Returns null when no more data is available.
This method may error if the device is not currently importing or the import was
 interrupted.
reset(): void
Resets the device and cancels any currently running export or import operation.

That change simply removes the newline in the writeExportFile method, between the description and the parameterDescriptions.

@CoolCat467
Copy link

Ah ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants