Skip to content

function.py:2:4: py2many.exceptions.AstNotImplementedError: try_dummy not implemented #725

Description

@newlaurent62

Hello,

Firstly, thanks for your initiative and the great work !

I'm trying to run the py2many command to transpile python to rust but i 'm facing a runtime error :

:€ py2many function.py --rust=1 --outdir="rust"

Writing to: rust
function.py ... rust/function.rs
function.py:2:4: py2many.exceptions.AstNotImplementedError: try_dummy not implemented
Error: ['rustfmt', '--edition=2021', 'rust/function.rs'] (code: 1):
b'error: expected one of `!` or `::`, found `<eof>`\n --> /home/laurent/Projects/py2many-main/examples/rust/function.rs:1:1\n  |\n1 | FAILED\n  | ^^^^^^ expected one of `!` or `::`\n\n'b''
def process(self):
    try:
        # Check the file extension
        check_extension(self.extension, SUPPORTED_EXTENSIONS)
        success_msg("Extension supportée ✔")

        # Extract metadata
        self.extract_metadata()
        if self.errors:
            return False
        success_msg("Métadonnées extraites ✔")

        # Convert content to Markdown
        markdown = self.convert_content()
        success_msg("Conversion en Markdown réussie ✔")

        # Write the Markdown file
        self.write_markdown(markdown)
        success_msg("Écriture du fichier Markdown réussie ✔")

    except (
        # Handle specific exceptions
        UnsupportedExtensionError,
        MetadataExtractionError,
        MarkdownConversionError,
        MarkdownWriteError,
        ImageCopyError,
    ) as e:
        print(self.errors, type(e).__name__, message=str(e))
        return False
    return True

Hopefully, we would like to help if possible (tests or others tasks) but i want to know if there is a reason why this feature has not been implemented ?

Thanks for your advices,
Hope to hear from you soon,

Best Regards,
++
Laurent

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions