Code Monkey home page Code Monkey logo

async2rewrite's People

Contributors

gorialis avatar henry232323 avatar simmsb avatar tylergibbs2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

async2rewrite's Issues

Special characters letters aren't supported

I got the following traceback :

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Zenrac\AppData\Local\Programs\Python\Python35\lib\site-packages\async2rewrite\main.py", line 47, in from_file
    code = f.read()
  File "C:\Users\Zenrac\AppData\Local\Programs\Python\Python35\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 101238: character maps to <undefined>

Find a way of keeping comments

This is a deal breaker issue for a lot of the people that want to use async2rewrite.

Potential Solutions

  • tokenizer module (most likely solution)
  • Find a way of acquiring, parsing, and unparsing a full syntax tree (little online information)
  • Custom parser (most difficult solution)

What?

Me being stupid I need an answer, does this transfer code using Discord.py v0.16.8/9/10 to v.1.0.0a

Argument expected but is not required

root@ubuntu-512mb-nyc3-01:~/modules# python3.5 -m async2rewrite shop.py --suffix  .edited.py
Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.5/dist-packages/async2rewrite/__main__.py", line 18, in <module>
    converted = from_file(*results.paths, interactive=results.interactive)
  File "/usr/local/lib/python3.5/dist-packages/async2rewrite/main.py", line 76, in from_file
    res[path] = process_file(path, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/async2rewrite/main.py", line 62, in process_file
    return get_result(f.read(), **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/async2rewrite/main.py", line 42, in get_result
    new_ast = DiscordTransformer(interactive=interactive).generic_visit(expr_ast)
  File "/usr/lib/python3.5/ast.py", line 300, in generic_visit
    value = self.visit(value)
  File "/usr/lib/python3.5/ast.py", line 245, in visit
    return visitor(node)
  File "/usr/lib/python3.5/ast.py", line 300, in generic_visit
    value = self.visit(value)
  File "/usr/lib/python3.5/ast.py", line 245, in visit
    return visitor(node)
  File "/usr/local/lib/python3.5/dist-packages/async2rewrite/transformers.py", line 131, in visit_AsyncFunctionDef
    self.generic_visit(node)
  File "/usr/lib/python3.5/ast.py", line 300, in generic_visit
    value = self.visit(value)
  File "/usr/lib/python3.5/ast.py", line 245, in visit
    return visitor(node)
  File "/usr/lib/python3.5/ast.py", line 300, in generic_visit
    value = self.visit(value)
  File "/usr/lib/python3.5/ast.py", line 245, in visit
    return visitor(node)
  File "/usr/lib/python3.5/ast.py", line 300, in generic_visit
    value = self.visit(value)
  File "/usr/lib/python3.5/ast.py", line 245, in visit
    return visitor(node)
  File "/usr/lib/python3.5/ast.py", line 300, in generic_visit
    value = self.visit(value)
  File "/usr/lib/python3.5/ast.py", line 245, in visit
    return visitor(node)
  File "/usr/lib/python3.5/ast.py", line 300, in generic_visit
    value = self.visit(value)
  File "/usr/lib/python3.5/ast.py", line 245, in visit
    return visitor(node)
  File "/usr/local/lib/python3.5/dist-packages/async2rewrite/transformers.py", line 51, in visit_Expr
    self.generic_visit(node)
  File "/usr/lib/python3.5/ast.py", line 309, in generic_visit
    new_node = self.visit(old_value)
  File "/usr/lib/python3.5/ast.py", line 245, in visit
    return visitor(node)
  File "/usr/local/lib/python3.5/dist-packages/async2rewrite/transformers.py", line 126, in visit_Await
    self.generic_visit(node)
  File "/usr/lib/python3.5/ast.py", line 309, in generic_visit
    new_node = self.visit(old_value)
  File "/usr/lib/python3.5/ast.py", line 245, in visit
    return visitor(node)
  File "/usr/local/lib/python3.5/dist-packages/async2rewrite/transformers.py", line 68, in visit_Call
    node = self.stateful_edit_message(node)
  File "/usr/local/lib/python3.5/dist-packages/async2rewrite/transformers.py", line 557, in stateful_edit_message
    content = call.args[1]
IndexError: list index out of range

I can't install the module

I'm trying to install the module using the android app Termux. I get this error message: unable to execute 'arm-linux-androideabi-clang': No such file or directory error: command 'arm-linux-androideabi-clang' failed with exit status 1 ---------------------------------------- Command "/data/data/com.termux/files/usr/bin/python -u -c "import setuptools, tokenize;__file__='/data/data/com.termux/files/usr/tmp/pip-build-p4gilwlc/typed-ast/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /data/data/com.termux/files/usr/tmp/pip-39_jjk1r-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /data/data/com.termux/files/usr/tmp/pip-build-p4gilwlc/typed-ast/

The command I used to install it was python -m pip install -U async2rewrite, but just typing pip install async2rewrite gives the same problem.

Positional expected when keyword is given

I managed to install the module, but now the module is having problems with my Fun.py extension. The error message says: File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/async2rewrite/transformers.py", line 419, in stateful_edit_message content = call.args[1] IndexError: list index out of range
I tried it with and without remove_parens=True, it worked with other files, I have no idea how i could fix this...

Edit: the problem might be f-strings

Nothin happened

I installed the async2rewrite but it didn't work. I also done the file convert and still nothing

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.