Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/pythonium.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/scopes/scope_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions BowerLoad.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#Bower Load#

this is a helper module for pythonium to help with your ide autocompletes and help you explore a bower loaded javascript package.

it does this by downloading the bower package and and constructing a python package skeleton from the downloaded and analysed javascript.


### example ###

from pythonium.BowerLoad import loader as bower

fancyjsscript = bower.load("some-javascript-package")

output = fancyjsscript.javascriptlibrary.javascriptclass.javascriptfunction("pickles-etc")

print(output)

### meaning? ###

that javascript can be coded entirely without looking at any .js files!

python will be able to hijack any javascript module!

## Status ##

pre-alpha. the rest of the pythonium module works fine.

this so far is definitely a work in progress. im currently looking for work contributions, so please fork and push :D


## Requirements ##

setuptools_bower is currently required for this portion of the module

pip install setuptools_bower


## TODO ##

find or make a module that will build a python module skeleton from a predifined structure that is described in a dict or string. (ideas welcome)

## Contact for this portion of the build ##

https://groups.google.com/forum/#!forum/pythonium-users

### initial developer ###

twitter: @deddokatana

github: deddokatana
36 changes: 36 additions & 0 deletions pythonium/BowerLoad/JsLibraryAnalyser.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
__author__ = 'Jason'

import re
import os
import fnmatch


class Mapper:
#map out files{} -> classes{} & Imports{} -> functions{{inputs:[],returns:[]}
#moduleMap = files{{classes{functions{{inputs:[],returns:[]},"imports":[]}
moduleMap = {"files":{}}
RootJsfileList = []
RootDir = os.curdir() #or js library folder path
def __init__(self):
pass
def find_all_js_files(self,RootDir=RootDir):
for root, dirnames, filenames in os.walk(RootDir):
for filename in fnmatch.filter(filenames, '*.js'):
self.moduleMap["files"] += {str(filename):""}
def find_imports_in_file(self):
imports = re.findall()
return imports
def find_all_classes_in_file(self):
pass
def find_all_functions_in_class(self):
pass
def get_inputs_from_function(self):
pass
def parseJSfile(self):
pass


class Skelmaker:
#Create Skeleton Python Modules For Easy Ide Intergration
def __init__(self):
pass
1 change: 1 addition & 0 deletions pythonium/BowerLoad/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__author__ = 'Jason'
19 changes: 19 additions & 0 deletions pythonium/BowerLoad/exceptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from django.core.management.base import CommandError


class BowerNotInstalled(CommandError):
"""Custom command error"""

def __init__(self):
super(BowerNotInstalled, self).__init__(
"Bower not installed, read instruction here - http://bower.io/",
)


class LegacyBowerVersionNotSupported(CommandError):
"""Custom command error"""

def __init__(self):
super(LegacyBowerVersionNotSupported, self).__init__(
"Legacy bower versions not supported, please install bower 1.0+",
)
20 changes: 20 additions & 0 deletions pythonium/BowerLoad/loader.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
__author__ = 'Jason'

from pythonium.BowerLoad import JsLibraryAnalyser
import setuptools_bower
import voodoo

class BowerLoader:
def __init__(self):
if not bower.BowerAdapter.is_bower_exists():
print("please install bower from the system terminal/command prompt with 'npm install bower")
raise Exception("Bower Is Not Installed or Accessable from the system console Path")
bower = setuptools_bower()

def createLibrarySkeletons(self,PackageName):
LibraryMap = JsLibraryAnalyser
return LibraryMap

def load(self,PackageName):
self.createLibrarySkeletons(PackageName)
pass
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
author_email='[email protected]',
url='https://github.com/pythonium/pythonium',
zip_safe=False,
packages=['pythonium', 'pythonium.compliant', 'pythonium.compliant.builtins', 'pythonium.veloce'],
install_requires=['docopt'],
packages=['pythonium', 'pythonium.compliant', 'pythonium.compliant.builtins', 'pythonium.veloce','pythonium.BowerLoad'],
install_requires=['docopt','setuptools-bower'],
entry_points="""
[console_scripts]
pythonium=pythonium.main:main
Expand Down