Always be curious.
Automagically converts discord.py async-branch code to rewrite-branch code.
License: MIT License
This is a deal breaker issue for a lot of the people that want to use async2rewrite.
Potential Solutions
Me being stupid I need an answer, does this transfer code using Discord.py v0.16.8/9/10 to v.1.0.0a
i still keep getting this error, althou i have no idea why
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
Multiline strings/docstrings are destroyed in the conversion
I installed the async2rewrite but it didn't work. I also done the file convert and still nothing
checks introduced in old-style wait_for
s are removed when conversions are done
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>
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.
This project does not convert Message.timestamp
due to the fact that changing all attributes with the name timestamp
would break Embed.timestamp
. Some way of type checking the parent attribute for all attributes named timestamp
would need to be implemented.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.