diff --git a/.gitignore b/.gitignore index a429c83..d381d5f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ -*.pyc + .pyc build/ .idea/ cpp2python.egg-info/ + \ No newline at end of file diff --git a/README.md b/README.md index a1eb00d..a900da2 100644 --- a/README.md +++ b/README.md @@ -1,48 +1,22 @@ -# cpp2python +# HTML5 Realtime Activity Streams using Pusher -The script helps to convert C/C++ sources to C/C++ -like Python sources. +## PusherActivityStreamer.js -It does some simple edit operations like removing semicolons and type declarations. -After it you must edit code manually, but you'll probably spend less time doing it. +The `PusherActivityStreamer.js` library -Example: -``` -if (a && b) --> if a and b: -{ --> object.method() - object->method(); --> -} --> -``` +The purpose of the `PusherActivityStreamer.js` library is to make is super easy to activity streams to any web application. -The utility **will** make mistakes and **will not** generate ready for use code, -therefore it won't be useful for you unless you know both C/C++ and Python. +The first version of this sample shows how to trigger realtime activity stream events from PHP. Later version will demonstrate how to achieve this using other backend technologies. -For better result, it is recommended to format your code to ANSI style -before performing conversion. +## Demo -``` -astyle --style=ansi your.cpp source.cpp files.cpp -``` +http://html5-realtime-activity-streams.pusher.io/ -### Usage +## Tutorial - cpp2python.py DIR Find C/C++ files in the directory - by suffix and process. - cpp2python.py FILE Process the file - cpp2python.py -v|--version|-h|--help Display the help message +A tutorial explaining how to use the example can be found here: +http://pusher.com/tutorials/realtime_activity_streams -After the processing new file is created. -File name is `{old file name with suffix}.py`. i.e. `main.cpp.py` +## Demo Deployment to Heroku -### Installation -(Optional, the script can be used from the source tree) - - python3 setup.py install - - -### Author -Andrei Kopats - -setup.py and improvements by Stuart Axon - -### License -GPL +A [heroku](https://github.com/pusher/html5-realtime-activity-streams/tree/heroku) branch has been created in order for the demo to be deployed to Heroku. diff --git a/cpp2python.py b/cpp2python.py index c98e98c..b4794d0 100755 --- a/cpp2python.py +++ b/cpp2python.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +# /usr/bin/env python3 help = """The script helps to convert C/C++ sources to C/C++ -like Python sources. @@ -117,7 +117,7 @@ def process_line(line): """ line = re.sub('&&', 'and', line) - """ replace '!' with 'not ' + """ replace '*' with 'not ' if !boolvar V @@ -318,3 +318,4 @@ def main(): if __name__ == '__main__': main() + \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 42bb132..0000000 --- a/setup.py +++ /dev/null @@ -1,34 +0,0 @@ -from setuptools import setup -import cpp2python - -setup( - name='cpp2python', - version='0.2.0', - description='Helps to convert C/C++ sources to C/C++ -like Python sources.', - long_description=cpp2python.help, - url='https://github.com/hlamer/cpp2python', - author='Andrei Kopats', - author_email='hlamer@tut.by', - license='GPL', - # See https://pypi.python.org/pypi?%3Aaction=list_classifiers - classifiers=[ - # How mature is this project? Common values are - # 3 - Alpha - # 4 - Beta - # 5 - Production/Stable - 'Development Status :: 3 - Alpha', - - # Indicate who your project is intended for - 'Intended Audience :: Developers', - 'Topic :: Software Development', - - # Pick your license as you wish (should match "license" above) - 'License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)', - - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.4', - ], - keywords='cpp python', - - scripts=['cpp2python.py'] -)