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

Argmark not creating markdown #6

Open
Relyte opened this issue Dec 27, 2022 · 1 comment
Open

Argmark not creating markdown #6

Relyte opened this issue Dec 27, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@Relyte
Copy link

Relyte commented Dec 27, 2022

I ran argmark with the following command against this repo: https://github.com/Relyte/cosmos-multivote

argmark -f multi-vote.py

It gave no output against that file. I did get it working by creating a new file (multi-vote-copy.py) that had the following contents:

import argparse

parser = argparse.ArgumentParser(
    prog="multi-vote.py",
    description="Create json file for multiple votes in a single transaction",
    formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
parser.add_argument(
    "--denom",
    dest="denom",
    required=False,
    default="ukuji",
    help="native chain denom",
)
parser.add_argument(
    "--daemon",
    dest="daemon",
    required=False,
    default="kujirad",
    help="daemon for sending tx",
)
parser.add_argument(
    "-c",
    "--chain_id",
    dest="chain_id",
    required=False,
    default="cosmoshub-4",
    help="Chain ID (ex. kaiyo-1)",
)
parser.add_argument(
    "-e",
    "--endpoint",
    dest="endpoint",
    required=False,
    help="RPC endpoint",
)
parser.add_argument(
    "-m",
    "--memo",
    dest="memo",
    help="Memo to send with votes",
)
parser.add_argument(
    "-k",
    "--keyname",
    dest="keyname",
    required=False,
    help="Wallet to vote from",
)
parser.add_argument(
    "-b",
    "--keyringbackend",
    dest="keyringbackend",
    default="test",
    required=False,
    help="Keyring Backend type",
)
parser.add_argument(
    "-s",
    "--send_address",
    dest="send_address",
    required=True,
    help="Address to vote from",
)
parser.add_argument(
    "-v",
    "--vote",
    dest="vote",
    action="append",
    required=True,
    help="Votes in the format of `proposal_id:vote_option` (eg: 110:no 111:yes 112:veto 113:abstain)",
)
parser.add_argument(
    "-d",
    "--dry-run",
    dest="dryrun",
    default=False,
    required=False,
    action="store_true",
    help="Do not sign or broadcast tx, just prepare the .json file",
)

args=parser.parse_args()

When run against this file it did properly create the markdown file. I'm assuming the issue is due to my argparse arguments being defined in the parseArgs function as opposed to main.

In case it is helpful, I ran argmark with verbose enabled against the multi-vote.py file and got the following output:

2022-12-27 16:17:22,874 - gen_help -root - DEBUG - import argparse

import json



from subprocess import run

from time import sleep, strftime

from getpass import getpass





def parseArgs():

    """Parse and return argparse arguments"""

    parser = argparse.ArgumentParser(

        prog="multi-vote.py",

        description="Create json file for multiple votes in a single transaction",

        formatter_class=argparse.ArgumentDefaultsHelpFormatter,

    )

    parser.add_argument(

        "--denom",

        dest="denom",

        required=False,

        default="ukuji",

        help="native chain denom",

    )

    parser.add_argument(

        "--daemon",

        dest="daemon",

        required=False,

        default="kujirad",

        help="daemon for sending tx",

    )

    parser.add_argument(

        "-c",

        "--chain_id",

        dest="chain_id",

        required=False,

        default="cosmoshub-4",

        help="Chain ID (ex. kaiyo-1)",

    )

    parser.add_argument(

        "-e",

        "--endpoint",

        dest="endpoint",

        required=False,

        help="RPC endpoint",

    )

    parser.add_argument(

        "-m",

        "--memo",

        dest="memo",

        help="Memo to send with votes",

    )

    parser.add_argument(

        "-k",

        "--keyname",

        dest="keyname",

        required=False,

        help="Wallet to vote from",

    )

    parser.add_argument(

        "-b",

        "--keyringbackend",

        dest="keyringbackend",

        default="test",

        required=False,

        help="Keyring Backend type",

    )

    parser.add_argument(

        "-s",

        "--send_address",

        dest="send_address",

        required=True,

        help="Address to vote from",

    )

    parser.add_argument(

        "-v",

        "--vote",

        dest="vote",

        action="append",

        required=True,

        help="Votes in the format of `proposal_id:vote_option` (eg: 110:no 111:yes 112:veto 113:abstain)",

    )

    parser.add_argument(

        "-d",

        "--dry-run",

        dest="dryrun",

        default=False,

        required=False,

        action="store_true",

        help="Do not sign or broadcast tx, just prepare the .json file",

    )



    import argmark
    argmark.md_help(parser)
@devanshkv devanshkv self-assigned this Dec 28, 2022
@devanshkv devanshkv added the bug Something isn't working label Dec 28, 2022
@devanshkv
Copy link
Owner

@lennertvandevelde adding you as a collaborator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants