├── .no-sublime-package
├── CodeComplice.py
├── CodeComplice.sublime-settings
├── Context.sublime-menu
├── Default (Linux).sublime-keymap
├── Default (Linux).sublime-mousemap
├── Default (OSX).sublime-keymap
├── Default (OSX).sublime-mousemap
├── Default (Windows).sublime-keymap
├── Default (Windows).sublime-mousemap
├── Default.sublime-commands
├── LICENSE.txt
├── Main.sublime-menu
├── README.md
├── arch
├── _linux_libcpp6_x86_64_py33
│ ├── _SilverCity.so
│ ├── __init__.py
│ ├── _ielementtree.so
│ └── sgmlop.so
├── _linux_libcpp6_x86_py33
│ ├── _SilverCity.so
│ ├── __init__.py
│ ├── _ielementtree.so
│ └── sgmlop.so
├── _macosx_universal_py33
│ ├── _SilverCity.so
│ ├── __init__.py
│ ├── _ielementtree.so
│ └── sgmlop.so
├── _win32_py33
│ ├── _SilverCity.pyd
│ ├── __init__.py
│ ├── _ielementtree.pyd
│ └── sgmlop.pyd
└── _win64_py33
│ ├── _SilverCity.pyd
│ ├── __init__.py
│ ├── _ielementtree.pyd
│ └── sgmlop.pyd
├── css
├── dark.css
├── default.css
└── light.css
├── libs
├── HTMLTreeParser.py
├── SilverCity
│ ├── CPP.py
│ ├── CSS.py
│ ├── DispatchHandler.py
│ ├── HTMLGenerator.py
│ ├── HyperText.py
│ ├── JavaScript.py
│ ├── Keywords.py
│ ├── LanguageInfo.py
│ ├── Lexer.py
│ ├── NULL.py
│ ├── Perl.py
│ ├── PostScript.py
│ ├── Python.py
│ ├── Ruby.py
│ ├── SQL.py
│ ├── ScintillaConstants.py
│ ├── Utils.py
│ ├── XML.py
│ ├── XSLT.py
│ ├── YAML.py
│ └── __init__.py
├── _SilverCity.py
├── _ielementtree.py
├── cElementTree.py
├── chardet
│ ├── __init__.py
│ ├── big5freq.py
│ ├── big5prober.py
│ ├── chardistribution.py
│ ├── charsetgroupprober.py
│ ├── charsetprober.py
│ ├── codingstatemachine.py
│ ├── constants.py
│ ├── escprober.py
│ ├── escsm.py
│ ├── eucjpprober.py
│ ├── euckrfreq.py
│ ├── euckrprober.py
│ ├── euctwfreq.py
│ ├── euctwprober.py
│ ├── gb2312freq.py
│ ├── gb2312prober.py
│ ├── hebrewprober.py
│ ├── jisfreq.py
│ ├── jpcntx.py
│ ├── langbulgarianmodel.py
│ ├── langcyrillicmodel.py
│ ├── langgreekmodel.py
│ ├── langhebrewmodel.py
│ ├── langhungarianmodel.py
│ ├── langthaimodel.py
│ ├── latin1prober.py
│ ├── mbcharsetprober.py
│ ├── mbcsgroupprober.py
│ ├── mbcssm.py
│ ├── sbcharsetprober.py
│ ├── sbcsgroupprober.py
│ ├── sjisprober.py
│ ├── universaldetector.py
│ └── utf8prober.py
├── ciElementTree.py
├── codeintel2
│ ├── __init__.py
│ ├── accessor.py
│ ├── buffer.py
│ ├── catalogs
│ │ ├── dojo.cix
│ │ ├── drupal.cix
│ │ ├── ext.cix
│ │ ├── html5.cix
│ │ ├── jquery.cix
│ │ ├── mochikit.cix
│ │ ├── mozilla_toolkit.cix
│ │ ├── pecl.cix
│ │ ├── prototype.cix
│ │ ├── python3-pywin32.cix
│ │ ├── pywin32.cix
│ │ ├── rails.cix
│ │ ├── xbl.cix
│ │ ├── xpcom.cix
│ │ └── yui.cix
│ ├── citadel.py
│ ├── citadel_common.py
│ ├── common.py
│ ├── constants_css1.py
│ ├── constants_css2.py
│ ├── constants_css3.py
│ ├── constants_css_microsoft_extensions.py
│ ├── constants_css_moz_extensions.py
│ ├── constants_css_webkit_extensions.py
│ ├── css_linter.py
│ ├── database
│ │ ├── __init__.py
│ │ ├── catalog.py
│ │ ├── database.py
│ │ ├── langlib.py
│ │ ├── langlibbase.py
│ │ ├── multilanglib.py
│ │ ├── projlib.py
│ │ ├── resource.py
│ │ ├── stdlib.py
│ │ └── util.py
│ ├── environment.py
│ ├── gencix_utils.py
│ ├── hooks.py
│ ├── indexer.py
│ ├── jsdoc.py
│ ├── lang_css.py
│ ├── lang_django.py
│ ├── lang_go.py
│ ├── lang_html.py
│ ├── lang_html5.py
│ ├── lang_javascript.py
│ ├── lang_less.py
│ ├── lang_mason.py
│ ├── lang_nodejs.py
│ ├── lang_perl.py
│ ├── lang_php.py
│ ├── lang_python.py
│ ├── lang_python3.py
│ ├── lang_rhtml.py
│ ├── lang_ruby.py
│ ├── lang_ruby_common.py
│ ├── lang_smarty.py
│ ├── lang_tcl.py
│ ├── lang_templatetoolkit.py
│ ├── lang_twig.py
│ ├── lang_xbl.py
│ ├── lang_xml.py
│ ├── lang_xslt.py
│ ├── lang_xul.py
│ ├── langintel.py
│ ├── lexers
│ │ ├── ActionScript.lexres
│ │ ├── Django.lexres
│ │ ├── EJS.lexres
│ │ ├── HTML.lexres
│ │ ├── Haml.lexres
│ │ ├── Kid.lexres
│ │ ├── Komodo_Snippet.lexres
│ │ ├── LaravelBlade.lexres
│ │ ├── Luddite.lexres
│ │ ├── MXML.lexres
│ │ ├── Mason.lexres
│ │ ├── PHP.lexres
│ │ ├── Perl2.lexres
│ │ ├── RHTML.lexres
│ │ ├── Smarty.lexres
│ │ ├── TemplateToolkit.lexres
│ │ ├── TracWiki.lexres
│ │ ├── Twig.lexres
│ │ ├── XBL.lexres
│ │ ├── XML.lexres
│ │ ├── XSLT.lexres
│ │ ├── XUL.lexres
│ │ ├── epMojo.lexres
│ │ └── reStructuredText.lexres
│ ├── lib_srcs
│ │ └── node.js
│ │ │ ├── 0.6
│ │ │ ├── addons.js
│ │ │ ├── assert.js
│ │ │ ├── buffer.js
│ │ │ ├── child_process.js
│ │ │ ├── cluster.js
│ │ │ ├── console.js
│ │ │ ├── crypto.js
│ │ │ ├── dgram.js
│ │ │ ├── dns.js
│ │ │ ├── events.js
│ │ │ ├── fs.js
│ │ │ ├── global_objects.js
│ │ │ ├── http.js
│ │ │ ├── https.js
│ │ │ ├── modules.js
│ │ │ ├── net.js
│ │ │ ├── os.js
│ │ │ ├── path.js
│ │ │ ├── process.js
│ │ │ ├── querystring.js
│ │ │ ├── readline.js
│ │ │ ├── repl.js
│ │ │ ├── stream.js
│ │ │ ├── timers.js
│ │ │ ├── tls.js
│ │ │ ├── tty.js
│ │ │ ├── url.js
│ │ │ ├── util.js
│ │ │ ├── vm.js
│ │ │ └── zlib.js
│ │ │ └── 0.8
│ │ │ ├── addons.js
│ │ │ ├── assert.js
│ │ │ ├── buffer.js
│ │ │ ├── child_process.js
│ │ │ ├── cluster.js
│ │ │ ├── console.js
│ │ │ ├── crypto.js
│ │ │ ├── dgram.js
│ │ │ ├── dns.js
│ │ │ ├── domain.js
│ │ │ ├── events.js
│ │ │ ├── fs.js
│ │ │ ├── global_objects.js
│ │ │ ├── http.js
│ │ │ ├── https.js
│ │ │ ├── modules.js
│ │ │ ├── net.js
│ │ │ ├── os.js
│ │ │ ├── path.js
│ │ │ ├── process.js
│ │ │ ├── querystring.js
│ │ │ ├── readline.js
│ │ │ ├── repl.js
│ │ │ ├── stream.js
│ │ │ ├── string_decoder.js
│ │ │ ├── timers.js
│ │ │ ├── tls.js
│ │ │ ├── tty.js
│ │ │ ├── url.js
│ │ │ ├── util.js
│ │ │ ├── vm.js
│ │ │ └── zlib.js
│ ├── manager.py
│ ├── oop
│ │ ├── __init__.py
│ │ ├── controller.py
│ │ ├── driver.py
│ │ └── memory_reporter.py
│ ├── parser_cix.py
│ ├── parser_data.py
│ ├── parseutil.py
│ ├── perl_lexer.py
│ ├── perl_parser.py
│ ├── perlcile.py
│ ├── phpdoc.py
│ ├── pybinary.py
│ ├── pythoncile.py
│ ├── pythoncile1.py
│ ├── pythoncile2.py
│ ├── ruby_lexer.py
│ ├── ruby_parser.py
│ ├── rubycile.py
│ ├── shared_lexer.py
│ ├── shared_parser.py
│ ├── stdlibs
│ │ ├── javascript.zip
│ │ ├── node.js.zip
│ │ ├── perl-5.10.zip
│ │ ├── perl-5.12.zip
│ │ ├── perl-5.14.zip
│ │ ├── perl-5.16.zip
│ │ ├── perl-5.8.zip
│ │ ├── php-4.4.zip
│ │ ├── php-5.0.zip
│ │ ├── php-5.1.zip
│ │ ├── php-5.2.zip
│ │ ├── php-5.3.zip
│ │ ├── php-5.4.zip
│ │ ├── php-5.5.zip
│ │ ├── python-2.4.zip
│ │ ├── python-2.5.zip
│ │ ├── python-2.6.zip
│ │ ├── python-2.7.zip
│ │ ├── python3-3.1.zip
│ │ ├── python3-3.2.zip
│ │ ├── python3-3.3.zip
│ │ ├── ruby-1.8.zip
│ │ ├── ruby-1.9.2.zip
│ │ └── ruby-1.9.3.zip
│ ├── tcl_lexer.py
│ ├── tcl_parser.py
│ ├── tclcile.py
│ ├── tdparser.py
│ ├── tree.py
│ ├── tree_javascript.py
│ ├── tree_perl.py
│ ├── tree_php.py
│ ├── tree_python.py
│ ├── tree_ruby.py
│ ├── udl.py
│ └── util.py
├── elementtree
│ ├── ElementInclude.py
│ ├── ElementPath.py
│ ├── ElementTree.py
│ ├── HTMLTreeBuilder.py
│ ├── SgmlopXMLTreeBuilder.py
│ ├── SimpleXMLTreeBuilder.py
│ ├── SimpleXMLWriter.py
│ ├── TidyHTMLTreeBuilder.py
│ ├── TidyTools.py
│ ├── XMLTreeBuilder.py
│ └── __init__.py
├── fixed-rules
│ ├── PHP
│ │ ├── Rules
│ │ └── codecomplice.version
│ ├── Python
│ │ ├── Rules
│ │ └── codecomplice.version
│ └── Python3
│ │ ├── Rules
│ │ └── codecomplice.version
├── golib
│ └── outline.go
├── iElementTree.py
├── inflector
│ ├── .gitignore
│ ├── Inflector.py
│ ├── Rules
│ │ ├── Base.py
│ │ ├── English.py
│ │ ├── Spanish.py
│ │ └── __init__.py
│ ├── __init__.py
│ └── tests.py
├── koCatalog.py
├── koDTD.py
├── koRNGElementTree.py
├── koSimpleLexer.py
├── koXMLDatasetInfo.py
├── koXMLTreeService.py
├── langinfo.py
├── langinfo_binary.py
├── langinfo_doc.py
├── langinfo_go.py
├── langinfo_komodo.py
├── langinfo_mozilla.py
├── langinfo_other.py
├── langinfo_prog.py
├── langinfo_template.py
├── langinfo_tiny.py
├── process.py
├── sgmlop.py
├── styles.py
├── textinfo.py
├── which.py
├── winprocess.py
└── zope
│ ├── __init__.py
│ └── cachedescriptors
│ ├── README.txt
│ ├── __init__.py
│ ├── method.py
│ ├── method.txt
│ ├── property.py
│ ├── property.txt
│ └── tests.py
├── messages.json
├── messages
├── 1.1.0.txt
├── 1.1.1.txt
├── 1.1.2.txt
└── 1.1.3.txt
└── packages.json
/.no-sublime-package:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/.no-sublime-package
--------------------------------------------------------------------------------
/Context.sublime-menu:
--------------------------------------------------------------------------------
1 | [
2 | {"caption": "Jump to Symbol Definition", "command": "goto_python_definition"},
3 | {"caption": "Back to Symbol Definition", "command": "back_to_python_definition"}
4 | ]
5 |
--------------------------------------------------------------------------------
/Default (Linux).sublime-keymap:
--------------------------------------------------------------------------------
1 | [
2 | { "keys": ["shift+ctrl+space"], "command": "code_intel_auto_complete" },
3 | { "keys": ["super+alt+ctrl+up"], "command": "goto_python_definition"},
4 | { "keys": ["super+alt+ctrl+left"], "command": "back_to_python_definition"}
5 | ]
--------------------------------------------------------------------------------
/Default (Linux).sublime-mousemap:
--------------------------------------------------------------------------------
1 | [
2 | { "button": "button1", "modifiers": ["super"], "command": "goto_python_definition", "press_command": "drag_select" }
3 | ]
4 |
--------------------------------------------------------------------------------
/Default (OSX).sublime-keymap:
--------------------------------------------------------------------------------
1 | [
2 | { "keys": ["shift+ctrl+space"], "command": "code_intel_auto_complete" },
3 | { "keys": ["super+alt+ctrl+up"], "command": "goto_python_definition"},
4 | { "keys": ["super+alt+ctrl+left"], "command": "back_to_python_definition"}
5 | ]
--------------------------------------------------------------------------------
/Default (OSX).sublime-mousemap:
--------------------------------------------------------------------------------
1 | [
2 | { "button": "button1", "modifiers": ["ctrl"], "command": "goto_python_definition", "press_command": "drag_select" }
3 | ]
4 |
--------------------------------------------------------------------------------
/Default (Windows).sublime-keymap:
--------------------------------------------------------------------------------
1 | [
2 | { "keys": ["shift+ctrl+space"], "command": "code_intel_auto_complete" },
3 | { "keys": ["super+alt+ctrl+up"], "command": "goto_python_definition"},
4 | { "keys": ["super+alt+ctrl+left"], "command": "back_to_python_definition"}
5 | ]
--------------------------------------------------------------------------------
/Default (Windows).sublime-mousemap:
--------------------------------------------------------------------------------
1 | [
2 | { "button": "button1", "modifiers": ["alt"], "command": "goto_python_definition", "press_command": "drag_select" }
3 | ]
4 |
--------------------------------------------------------------------------------
/Default.sublime-commands:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "caption": "CodeComplice: Dump Import Directories",
4 | "command": "sublimecodeintel_dump_import_dirs"
5 | }
6 | ]
7 |
--------------------------------------------------------------------------------
/arch/_linux_libcpp6_x86_64_py33/_SilverCity.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/arch/_linux_libcpp6_x86_64_py33/_SilverCity.so
--------------------------------------------------------------------------------
/arch/_linux_libcpp6_x86_64_py33/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/arch/_linux_libcpp6_x86_64_py33/__init__.py
--------------------------------------------------------------------------------
/arch/_linux_libcpp6_x86_64_py33/_ielementtree.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/arch/_linux_libcpp6_x86_64_py33/_ielementtree.so
--------------------------------------------------------------------------------
/arch/_linux_libcpp6_x86_64_py33/sgmlop.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/arch/_linux_libcpp6_x86_64_py33/sgmlop.so
--------------------------------------------------------------------------------
/arch/_linux_libcpp6_x86_py33/_SilverCity.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/arch/_linux_libcpp6_x86_py33/_SilverCity.so
--------------------------------------------------------------------------------
/arch/_linux_libcpp6_x86_py33/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/arch/_linux_libcpp6_x86_py33/__init__.py
--------------------------------------------------------------------------------
/arch/_linux_libcpp6_x86_py33/_ielementtree.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/arch/_linux_libcpp6_x86_py33/_ielementtree.so
--------------------------------------------------------------------------------
/arch/_linux_libcpp6_x86_py33/sgmlop.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/arch/_linux_libcpp6_x86_py33/sgmlop.so
--------------------------------------------------------------------------------
/arch/_macosx_universal_py33/_SilverCity.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/arch/_macosx_universal_py33/_SilverCity.so
--------------------------------------------------------------------------------
/arch/_macosx_universal_py33/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/arch/_macosx_universal_py33/__init__.py
--------------------------------------------------------------------------------
/arch/_macosx_universal_py33/_ielementtree.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/arch/_macosx_universal_py33/_ielementtree.so
--------------------------------------------------------------------------------
/arch/_macosx_universal_py33/sgmlop.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/arch/_macosx_universal_py33/sgmlop.so
--------------------------------------------------------------------------------
/arch/_win32_py33/_SilverCity.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/arch/_win32_py33/_SilverCity.pyd
--------------------------------------------------------------------------------
/arch/_win32_py33/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/arch/_win32_py33/__init__.py
--------------------------------------------------------------------------------
/arch/_win32_py33/_ielementtree.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/arch/_win32_py33/_ielementtree.pyd
--------------------------------------------------------------------------------
/arch/_win32_py33/sgmlop.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/arch/_win32_py33/sgmlop.pyd
--------------------------------------------------------------------------------
/arch/_win64_py33/_SilverCity.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/arch/_win64_py33/_SilverCity.pyd
--------------------------------------------------------------------------------
/arch/_win64_py33/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/arch/_win64_py33/__init__.py
--------------------------------------------------------------------------------
/arch/_win64_py33/_ielementtree.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/arch/_win64_py33/_ielementtree.pyd
--------------------------------------------------------------------------------
/arch/_win64_py33/sgmlop.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/arch/_win64_py33/sgmlop.pyd
--------------------------------------------------------------------------------
/css/dark.css:
--------------------------------------------------------------------------------
1 | html {
2 | background-color: #232628;
3 | color: #CCCCCC;
4 | }
5 |
6 | body {
7 | font-size: 12px;
8 | }
9 |
10 | a {
11 | color: #6699cc;
12 | }
13 |
14 | b {
15 | color: #cc99cc;
16 | }
17 |
18 | h1 {
19 | color: #99cc99;
20 | font-size: 14px;
21 | }
22 |
--------------------------------------------------------------------------------
/css/default.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-size: 12px;
3 | }
4 |
5 | h1 {
6 | font-size: 14px;
7 | }
8 |
--------------------------------------------------------------------------------
/css/light.css:
--------------------------------------------------------------------------------
1 | html {
2 | background-color: #FAFDFF;
3 | color: #4d4d4c;
4 | }
5 |
6 | body {
7 | font-size: 12px;
8 | }
9 |
10 | a {
11 | color: #3e999f;
12 | }
13 |
14 | b {
15 | color: #8959a8;
16 | }
17 |
18 | h1 {
19 | color: #718c00;
20 | font-size: 14px;
21 | }
22 |
--------------------------------------------------------------------------------
/libs/SilverCity/CPP.py:
--------------------------------------------------------------------------------
1 | from . import HTMLGenerator
2 | from . import Keywords
3 | from . import Lexer
4 | from .DispatchHandler import DispatchHandler
5 | from _SilverCity import find_lexer_module_by_id, PropertySet, WordList
6 | from .ScintillaConstants import SCLEX_CPP
7 | from . import LanguageInfo
8 |
9 |
10 | class CPPLexer(Lexer.Lexer):
11 | def __init__(self, properties=PropertySet()):
12 | self._properties = properties
13 | self._lexer = find_lexer_module_by_id(SCLEX_CPP)
14 | self._keyword_lists = [
15 | WordList(Keywords.cpp_keywords),
16 | WordList(), # User defined (important functions, constants, etc.)
17 | WordList(Keywords.doxygen_keywords),
18 | WordList(), # "Fold header keywords" - whatever that is
19 | WordList(), # Global classes and typedefs
20 | ]
21 |
22 |
23 | class CPPHandler(DispatchHandler):
24 | def __init__(self):
25 | DispatchHandler.__init__(self, 'SCE_C')
26 |
27 |
28 | class CPPHTMLGenerator(HTMLGenerator.SimpleHTMLGenerator, CPPHandler):
29 | name = 'cpp'
30 | description = 'C and C++'
31 |
32 | def __init__(self):
33 | CPPHandler.__init__(self)
34 | HTMLGenerator.SimpleHTMLGenerator.__init__(self, 'SCE_C')
35 |
36 | def generate_html(self, file, buffer, lexer=CPPLexer()):
37 | self._file = file
38 |
39 | lexer.tokenize_by_style(buffer, self.event_handler)
40 |
41 |
42 | cpp_language_info = LanguageInfo.LanguageInfo(
43 | 'C++',
44 | ['c', 'c+', 'c++', 'cpp', 'cxx', 'h', 'hpp'],
45 | [],
46 | [CPPHTMLGenerator]
47 | )
48 |
49 | LanguageInfo.register_language(cpp_language_info)
50 |
--------------------------------------------------------------------------------
/libs/SilverCity/CSS.py:
--------------------------------------------------------------------------------
1 | from . import HTMLGenerator
2 | from . import Keywords
3 | from . import Lexer
4 | from .DispatchHandler import DispatchHandler
5 | from _SilverCity import find_lexer_module_by_id, PropertySet, WordList
6 | from .ScintillaConstants import SCLEX_CSS
7 | from . import LanguageInfo
8 |
9 |
10 | class _CSSLexerTemplate(Lexer.Lexer):
11 | def __init__(self, properties):
12 | self._properties = properties
13 | self._lexer = find_lexer_module_by_id(SCLEX_CSS)
14 | self._keyword_lists = [
15 | WordList(Keywords.css_keywords),
16 | WordList(Keywords.css_pseudo_classes),
17 | WordList(Keywords.css_keywords_2),
18 | WordList(Keywords.css_properties_3),
19 | WordList(Keywords.css_pseudo_elements),
20 | WordList(Keywords.css_browser_specific_properties),
21 | WordList(Keywords.css_browser_specific_pseudo_classes),
22 | WordList(Keywords.css_browser_specific_pseudo_elements),
23 | ]
24 |
25 |
26 | class CSSLexer(_CSSLexerTemplate):
27 | def __init__(self, properties=PropertySet()):
28 | _CSSLexerTemplate.__init__(self, properties)
29 |
30 |
31 | class SCSSLexer(_CSSLexerTemplate):
32 | def __init__(self, properties=PropertySet()):
33 | _CSSLexerTemplate.__init__(self, properties)
34 | properties['lexer.css.scss.language'] = '1'
35 |
36 |
37 | class LessLexer(_CSSLexerTemplate):
38 | def __init__(self, properties=PropertySet()):
39 | _CSSLexerTemplate.__init__(self, properties)
40 | properties['lexer.css.less.language'] = '1'
41 |
42 |
43 | class CSSHandler(DispatchHandler):
44 | def __init__(self):
45 | DispatchHandler.__init__(self, 'SCE_CSS')
46 |
47 |
48 | class CSSHTMLGenerator(HTMLGenerator.SimpleHTMLGenerator, CSSHandler):
49 | name = 'css'
50 | description = 'Cascading Style Sheets'
51 |
52 | def __init__(self):
53 | CSSHandler.__init__(self)
54 | HTMLGenerator.SimpleHTMLGenerator.__init__(self, 'SCE_CSS')
55 |
56 | def generate_html(self, file, buffer, lexer=CSSLexer()):
57 | self._file = file
58 | lexer.tokenize_by_style(buffer, self.event_handler)
59 |
60 | css_language_info = LanguageInfo.LanguageInfo(
61 | 'css',
62 | ['css'],
63 | ['.*?css.*?'],
64 | [CSSHTMLGenerator]
65 | )
66 |
67 | LanguageInfo.register_language(css_language_info)
68 |
--------------------------------------------------------------------------------
/libs/SilverCity/DispatchHandler.py:
--------------------------------------------------------------------------------
1 | from . import ScintillaConstants
2 | from . import Utils
3 |
4 |
5 | def generate_handler_name(state):
6 | return 'handle_' + state[4:].lower()
7 |
8 |
9 | class DispatchHandler:
10 | def __init__(self, state_prefix):
11 | self.handlers = {}
12 | if state_prefix is not None:
13 | for constant in Utils.list_states(state_prefix):
14 | self.handlers[getattr(ScintillaConstants, constant)] = \
15 | generate_handler_name(constant)
16 |
17 | def event_handler(self, style, **kwargs):
18 | kwargs.update({'style': style})
19 | handler = self.handlers.get(style, None)
20 |
21 | if handler is None:
22 | self.handle_other(**kwargs)
23 | else:
24 | getattr(self, handler, self.handle_other)(**kwargs)
25 |
--------------------------------------------------------------------------------
/libs/SilverCity/HTMLGenerator.py:
--------------------------------------------------------------------------------
1 | from . import ScintillaConstants
2 | from . import Utils
3 |
4 |
5 | def replace(text, *replacements):
6 | for old, new in replacements:
7 | text = text.replace(old, new)
8 |
9 | return text
10 |
11 |
12 | class HTMLGenerator:
13 | def escape(self, text):
14 | return replace(text, ('&', '&'), ('<', '<'), ('>', '>'))
15 |
16 | def preformat(self, text):
17 | text = self.escape(text.expandtabs())
18 | return replace(text, (' ', ' '), ('\n', '
\n'))
19 |
20 | def markup(self, text):
21 | # XXX This is stolen from pydoc and is way too python-centric
22 | # there should be some way to extend it
23 | import re
24 |
25 | results = []
26 | here = 0
27 | pattern = re.compile(r'\b((http|ftp)://\S+[\w/]|'
28 | r'RFC[- ]?(\d+)|'
29 | r'PEP[- ]?(\d+))\b')
30 | while 1:
31 | match = pattern.search(text, here)
32 | if not match:
33 | break
34 | start, end = match.span()
35 | results.append(self.preformat(text[here:start]))
36 |
37 | all, scheme, rfc, pep = match.groups()
38 | if scheme:
39 | results.append('%s' % (
40 | all, self.preformat(all)))
41 | elif rfc:
42 | url = 'http://www.rfc-editor.org/rfc/rfc%d.txt' % int(rfc)
43 | results.append('%s' % (
44 | url, self.preformat(all)))
45 | elif pep:
46 | url = 'http://www.python.org/peps/pep-%04d.html' % int(pep)
47 | results.append('%s' % (
48 | url, self.preformat(all)))
49 |
50 | here = end
51 | results.append(self.preformat(text[here:]))
52 | return ''.join(results)
53 |
54 |
55 | def generate_css_name(state):
56 | return state[4:].lower()
57 |
58 |
59 | class SimpleHTMLGenerator(HTMLGenerator):
60 | def __init__(self, state_prefix):
61 | self.css_classes = {}
62 | for constant in Utils.list_states(state_prefix):
63 | self.css_classes[getattr(ScintillaConstants, constant)] = \
64 | generate_css_name(constant)
65 |
66 | def handle_other(self, style, text, **ignored):
67 | css_class = self.css_classes.get(style, '')
68 |
69 | if css_class:
70 | self._file.write('' % css_class)
71 |
72 | self._file.write(self.markup(text))
73 |
74 | if css_class:
75 | self._file.write('')
76 |
--------------------------------------------------------------------------------
/libs/SilverCity/HyperText.py:
--------------------------------------------------------------------------------
1 | from . import HTMLGenerator
2 | from . import Lexer
3 | from .DispatchHandler import DispatchHandler
4 | from . import Keywords
5 | from _SilverCity import find_lexer_module_by_id, PropertySet, WordList
6 | from .ScintillaConstants import SCLEX_HTML
7 | from . import LanguageInfo
8 | import re
9 |
10 |
11 | class HyperTextLexer(Lexer.Lexer):
12 | def __init__(self, properties=PropertySet()):
13 | self._properties = properties
14 | self._lexer = find_lexer_module_by_id(SCLEX_HTML)
15 | self._keyword_lists = [
16 | WordList(Keywords.hypertext_keywords),
17 | WordList(Keywords.js_keywords),
18 | WordList(Keywords.vb_keywords),
19 | WordList(Keywords.python_keywords),
20 | WordList(Keywords.php_keywords),
21 | WordList(Keywords.sgml_keywords)
22 | ]
23 |
24 |
25 | class HyperTextHandler(DispatchHandler):
26 | def __init__(self):
27 | DispatchHandler.__init__(self, 'SCE_H')
28 |
29 |
30 | class HyperTextHTMLGenerator(HTMLGenerator.SimpleHTMLGenerator, HyperTextHandler):
31 | name = 'html'
32 | description = 'HTML and PHP [with embedded: JavaScript, VBScript, Python]'
33 |
34 | def __init__(self):
35 | HyperTextHandler.__init__(self)
36 | HTMLGenerator.SimpleHTMLGenerator.__init__(self, 'SCE_H')
37 |
38 | def generate_html(self, file, buffer, lexer=HyperTextLexer()):
39 | self._file = file
40 |
41 | lexer.tokenize_by_style(buffer, self.event_handler)
42 |
43 | html_language_info = LanguageInfo.LanguageInfo(
44 | 'html',
45 | ['html', 'htm', 'xhtml', re.compile(
46 | '^php(\d)?$', re.IGNORECASE), 'inc'],
47 | ['.*?\ ['SCE_P_DEFAULT', 'SCE_P_COMMENTLINE', ...]
6 |
7 | Return a list of Scintilla constants beginning with the given prefix.
8 | """
9 | return [constant for constant in dir(ScintillaConstants)
10 | if constant.startswith(state_prefix)]
11 |
--------------------------------------------------------------------------------
/libs/SilverCity/XML.py:
--------------------------------------------------------------------------------
1 | from . import HTMLGenerator
2 | from . import Lexer
3 | from .DispatchHandler import DispatchHandler
4 | from . import Keywords
5 | from _SilverCity import find_lexer_module_by_id, PropertySet, WordList
6 | from .ScintillaConstants import SCLEX_XML
7 | from . import LanguageInfo
8 |
9 |
10 | class XMLLexer(Lexer.Lexer):
11 | def __init__(self, properties=PropertySet()):
12 | self._properties = properties
13 | self._lexer = find_lexer_module_by_id(SCLEX_XML)
14 | self._keyword_lists = [
15 | WordList(),
16 | WordList(),
17 | WordList(),
18 | WordList(),
19 | WordList(),
20 | WordList(Keywords.sgml_keywords)
21 | ]
22 |
23 |
24 | class XMLHandler(DispatchHandler):
25 | def __init__(self):
26 | DispatchHandler.__init__(self, 'SCE_H')
27 |
28 |
29 | class XMLHTMLGenerator(HTMLGenerator.SimpleHTMLGenerator, XMLHandler):
30 | name = 'xml'
31 | description = 'XML'
32 |
33 | def __init__(self):
34 | XMLHandler.__init__(self)
35 | HTMLGenerator.SimpleHTMLGenerator.__init__(self, 'SCE_H')
36 |
37 | def generate_html(self, file, buffer, lexer=XMLLexer()):
38 | self._file = file
39 |
40 | lexer.tokenize_by_style(buffer, self.event_handler)
41 |
42 | xml_language_info = LanguageInfo.LanguageInfo(
43 | 'xml',
44 | ['xml', 'dtd'],
45 | [r'.*?\<\?xml.*?'],
46 | [XMLHTMLGenerator]
47 | )
48 |
49 | LanguageInfo.register_language(xml_language_info)
50 |
--------------------------------------------------------------------------------
/libs/SilverCity/XSLT.py:
--------------------------------------------------------------------------------
1 | from . import HTMLGenerator
2 | from . import Lexer
3 | from .DispatchHandler import DispatchHandler
4 | from . import Keywords
5 | from _SilverCity import find_lexer_module_by_id, PropertySet, WordList
6 | from .ScintillaConstants import SCLEX_XML
7 | from . import LanguageInfo
8 |
9 |
10 | class XSLTLexer(Lexer.Lexer):
11 | def __init__(self, properties=PropertySet()):
12 | self._properties = properties
13 | self._lexer = find_lexer_module_by_id(SCLEX_XML)
14 | self._keyword_lists = [
15 | WordList(Keywords.xslt_keywords),
16 | WordList(Keywords.js_keywords),
17 | WordList(Keywords.vb_keywords),
18 | WordList(Keywords.python_keywords),
19 | WordList(Keywords.php_keywords),
20 | WordList(Keywords.sgml_keywords)
21 | ]
22 |
23 |
24 | class XSLTHandler(DispatchHandler):
25 | def __init__(self):
26 | DispatchHandler.__init__(self, 'SCE_H')
27 |
28 |
29 | class XSLTHTMLGenerator(HTMLGenerator.SimpleHTMLGenerator, XSLTHandler):
30 | name = 'xslt'
31 | description = 'XSLT'
32 |
33 | def __init__(self):
34 | XSLTHandler.__init__(self)
35 | HTMLGenerator.SimpleHTMLGenerator.__init__(self, 'SCE_H')
36 |
37 | def generate_html(self, file, buffer, lexer=XSLTLexer()):
38 | self._file = file
39 |
40 | lexer.tokenize_by_style(buffer, self.event_handler)
41 |
42 | xslt_language_info = LanguageInfo.LanguageInfo(
43 | 'xslt',
44 | ['xsl', 'xslt'],
45 | [],
46 | [XSLTHTMLGenerator]
47 | )
48 |
49 | LanguageInfo.register_language(xslt_language_info)
50 |
--------------------------------------------------------------------------------
/libs/SilverCity/YAML.py:
--------------------------------------------------------------------------------
1 | from . import HTMLGenerator
2 | from . import Keywords
3 | from . import Lexer
4 | from .DispatchHandler import DispatchHandler
5 | from _SilverCity import find_lexer_module_by_id, PropertySet, WordList
6 | from .ScintillaConstants import SCLEX_YAML
7 | from . import LanguageInfo
8 |
9 |
10 | class YAMLLexer(Lexer.Lexer):
11 | def __init__(self, properties=PropertySet()):
12 | self._properties = properties
13 | self._lexer = find_lexer_module_by_id(SCLEX_YAML)
14 | self._keyword_lists = [
15 | WordList(Keywords.yaml_keywords),
16 | ]
17 |
18 |
19 | class YAMLHandler(DispatchHandler):
20 | def __init__(self):
21 | DispatchHandler.__init__(self, 'SCE_YAML')
22 |
23 |
24 | class YAMLHTMLGenerator(HTMLGenerator.SimpleHTMLGenerator, YAMLHandler):
25 | name = 'yaml'
26 | description = 'YAML'
27 |
28 | def __init__(self):
29 | YAMLHandler.__init__(self)
30 | HTMLGenerator.SimpleHTMLGenerator.__init__(self, 'SCE_YAML')
31 |
32 | def generate_html(self, file, buffer, lexer=YAMLLexer()):
33 | self._file = file
34 |
35 | lexer.tokenize_by_style(buffer, self.event_handler)
36 |
37 |
38 | yaml_language_info = LanguageInfo.LanguageInfo(
39 | 'YAML',
40 | ['yml', 'yaml'],
41 | [],
42 | [YAMLHTMLGenerator]
43 | )
44 |
45 | LanguageInfo.register_language(yaml_language_info)
46 |
--------------------------------------------------------------------------------
/libs/SilverCity/__init__.py:
--------------------------------------------------------------------------------
1 | import _SilverCity
2 | from _SilverCity import *
3 |
4 |
5 | def get_default_stylesheet_location():
6 | """get_default_stylesheet_location() => file path
7 |
8 | Returns the path of the default cascading style sheet (CSS) file
9 | that is installed with the rest of the SilverCity package."""
10 |
11 | import os
12 |
13 | css_file = os.path.join(os.path.dirname(__file__), 'default.css')
14 | if not os.path.exists(css_file):
15 | raise Exception('Default CSS file could not be found at %s' % css_file)
16 |
17 | return css_file
18 |
19 | from . import LanguageInfo
20 | LanguageInfo.do_registration()
21 |
--------------------------------------------------------------------------------
/libs/_SilverCity.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import struct
3 |
4 | VERSION = sys.version_info[:2]
5 | PLATFORM = sys.platform
6 | ARCH = 'x%d' % (struct.calcsize('P') * 8)
7 |
8 | platform = None
9 |
10 | if VERSION >= (3, 3):
11 | try:
12 | from _local_arch._SilverCity import *
13 | platform = "Local arch"
14 | except ImportError:
15 | if PLATFORM == 'darwin':
16 | from _macosx_universal_py33._SilverCity import *
17 | platform = "MacOS X Universal"
18 | elif PLATFORM.startswith('linux'):
19 | if ARCH == 'x64':
20 | from _linux_libcpp6_x86_64_py33._SilverCity import *
21 | platform = "Linux 64 bits"
22 | elif ARCH == 'x32':
23 | from _linux_libcpp6_x86_py33._SilverCity import *
24 | platform = "Linux 32 bits"
25 | elif PLATFORM.startswith('win'):
26 | if ARCH == 'x64':
27 | from _win64_py33._SilverCity import *
28 | platform = "Windows 64 bits"
29 | elif ARCH == 'x32':
30 | from _win32_py33._SilverCity import *
31 | platform = "Windows 32 bits"
32 | elif VERSION >= (2, 6):
33 | try:
34 | from _local_arch._SilverCity import *
35 | platform = "Local arch"
36 | except ImportError:
37 | if PLATFORM == 'darwin':
38 | from _macosx_universal_py26._SilverCity import *
39 | platform = "MacOS X Universal"
40 | elif PLATFORM.startswith('linux'):
41 | if ARCH == 'x64':
42 | from _linux_libcpp6_x86_64_py26._SilverCity import *
43 | platform = "Linux 64 bits"
44 | elif ARCH == 'x32':
45 | from _linux_libcpp6_x86_py26._SilverCity import *
46 | platform = "Linux 32 bits"
47 | elif PLATFORM.startswith('win'):
48 | if ARCH == 'x64':
49 | from _win64_py26._SilverCity import *
50 | platform = "Windows 64 bits"
51 | elif ARCH == 'x32':
52 | from _win32_py26._SilverCity import *
53 | platform = "Windows 32 bits"
54 |
55 | if not platform:
56 | raise ImportError("Could not find a suitable _SilverCity binary for your platform and architecture.")
57 |
--------------------------------------------------------------------------------
/libs/_ielementtree.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import struct
3 |
4 | VERSION = sys.version_info[:2]
5 | PLATFORM = sys.platform
6 | ARCH = 'x%d' % (struct.calcsize('P') * 8)
7 |
8 | if VERSION >= (3, 3):
9 | platform = None
10 |
11 | try:
12 | from _local_arch._ielementtree import *
13 | platform = "Local arch"
14 | except ImportError:
15 | if PLATFORM == 'darwin':
16 | from _macosx_universal_py33._ielementtree import *
17 | platform = "MacOS X Universal"
18 | elif PLATFORM.startswith('linux'):
19 | if ARCH == 'x64':
20 | from _linux_libcpp6_x86_64_py33._ielementtree import *
21 | platform = "Linux 64 bits"
22 | elif ARCH == 'x32':
23 | from _linux_libcpp6_x86_py33._ielementtree import *
24 | platform = "Linux 32 bits"
25 | elif PLATFORM.startswith('win'):
26 | if ARCH == 'x64':
27 | from _win64_py33._ielementtree import *
28 | platform = "Windows 64 bits"
29 | elif ARCH == 'x32':
30 | from _win32_py33._ielementtree import *
31 | platform = "Windows 32 bits"
32 | if not platform:
33 | raise ImportError("Could not find a suitable _ielementtree binary for your platform and architecture.")
34 | elif VERSION >= (2, 6):
35 | from ciElementTree import *
36 | from ciElementTree import _patched_for_komodo_
37 |
--------------------------------------------------------------------------------
/libs/cElementTree.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import struct
3 |
4 | VERSION = sys.version_info[:2]
5 | PLATFORM = sys.platform
6 | ARCH = 'x%d' % (struct.calcsize('P') * 8)
7 |
8 | if VERSION >= (3, 3):
9 | from iElementTree import *
10 | from iElementTree import _patched_for_komodo_
11 | elif VERSION >= (2, 6):
12 | platform = None
13 |
14 | try:
15 | from _local_arch.cElementTree import *
16 | platform = "Local arch"
17 | except ImportError:
18 | if PLATFORM == 'darwin':
19 | from _macosx_universal_py26.cElementTree import *
20 | platform = "MacOS X Universal"
21 | elif PLATFORM.startswith('linux'):
22 | if ARCH == 'x64':
23 | from _linux_libcpp6_x86_64_py26.cElementTree import *
24 | platform = "Linux 64 bits"
25 | elif ARCH == 'x32':
26 | from _linux_libcpp6_x86_py26.cElementTree import *
27 | platform = "Linux 32 bits"
28 | elif PLATFORM.startswith('win'):
29 | if ARCH == 'x64':
30 | from _win64_py26.cElementTree import *
31 | platform = "Windows 64 bits"
32 | elif ARCH == 'x32':
33 | from _win32_py26.cElementTree import *
34 | platform = "Windows 32 bits"
35 |
36 | if not platform:
37 | raise ImportError("Could not find a suitable cElementTree binary for your platform and architecture.")
38 |
--------------------------------------------------------------------------------
/libs/chardet/__init__.py:
--------------------------------------------------------------------------------
1 | ######################## BEGIN LICENSE BLOCK ########################
2 | # This library is free software; you can redistribute it and/or
3 | # modify it under the terms of the GNU Lesser General Public
4 | # License as published by the Free Software Foundation; either
5 | # version 2.1 of the License, or (at your option) any later version.
6 | #
7 | # This library is distributed in the hope that it will be useful,
8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 | # Lesser General Public License for more details.
11 | #
12 | # You should have received a copy of the GNU Lesser General Public
13 | # License along with this library; if not, write to the Free Software
14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
15 | # 02110-1301 USA
16 | ######################### END LICENSE BLOCK #########################
17 |
18 | __version__ = "2.1.1"
19 |
20 | def detect(aBuf):
21 | from . import universaldetector
22 | u = universaldetector.UniversalDetector()
23 | u.reset()
24 | u.feed(aBuf)
25 | u.close()
26 | return u.result
27 |
--------------------------------------------------------------------------------
/libs/chardet/big5prober.py:
--------------------------------------------------------------------------------
1 | ######################## BEGIN LICENSE BLOCK ########################
2 | # The Original Code is Mozilla Communicator client code.
3 | #
4 | # The Initial Developer of the Original Code is
5 | # Netscape Communications Corporation.
6 | # Portions created by the Initial Developer are Copyright (C) 1998
7 | # the Initial Developer. All Rights Reserved.
8 | #
9 | # Contributor(s):
10 | # Mark Pilgrim - port to Python
11 | #
12 | # This library is free software; you can redistribute it and/or
13 | # modify it under the terms of the GNU Lesser General Public
14 | # License as published by the Free Software Foundation; either
15 | # version 2.1 of the License, or (at your option) any later version.
16 | #
17 | # This library is distributed in the hope that it will be useful,
18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | # Lesser General Public License for more details.
21 | #
22 | # You should have received a copy of the GNU Lesser General Public
23 | # License along with this library; if not, write to the Free Software
24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
25 | # 02110-1301 USA
26 | ######################### END LICENSE BLOCK #########################
27 |
28 | from .mbcharsetprober import MultiByteCharSetProber
29 | from .codingstatemachine import CodingStateMachine
30 | from .chardistribution import Big5DistributionAnalysis
31 | from .mbcssm import Big5SMModel
32 |
33 | class Big5Prober(MultiByteCharSetProber):
34 | def __init__(self):
35 | MultiByteCharSetProber.__init__(self)
36 | self._mCodingSM = CodingStateMachine(Big5SMModel)
37 | self._mDistributionAnalyzer = Big5DistributionAnalysis()
38 | self.reset()
39 |
40 | def get_charset_name(self):
41 | return "Big5"
42 |
--------------------------------------------------------------------------------
/libs/chardet/charsetprober.py:
--------------------------------------------------------------------------------
1 | ######################## BEGIN LICENSE BLOCK ########################
2 | # The Original Code is Mozilla Universal charset detector code.
3 | #
4 | # The Initial Developer of the Original Code is
5 | # Netscape Communications Corporation.
6 | # Portions created by the Initial Developer are Copyright (C) 2001
7 | # the Initial Developer. All Rights Reserved.
8 | #
9 | # Contributor(s):
10 | # Mark Pilgrim - port to Python
11 | # Shy Shalom - original C code
12 | #
13 | # This library is free software; you can redistribute it and/or
14 | # modify it under the terms of the GNU Lesser General Public
15 | # License as published by the Free Software Foundation; either
16 | # version 2.1 of the License, or (at your option) any later version.
17 | #
18 | # This library is distributed in the hope that it will be useful,
19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 | # Lesser General Public License for more details.
22 | #
23 | # You should have received a copy of the GNU Lesser General Public
24 | # License along with this library; if not, write to the Free Software
25 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
26 | # 02110-1301 USA
27 | ######################### END LICENSE BLOCK #########################
28 |
29 | import re
30 |
31 | from . import constants
32 |
33 | class CharSetProber:
34 | def __init__(self):
35 | pass
36 |
37 | def reset(self):
38 | self._mState = constants.eDetecting
39 |
40 | def get_charset_name(self):
41 | return None
42 |
43 | def feed(self, aBuf):
44 | pass
45 |
46 | def get_state(self):
47 | return self._mState
48 |
49 | def get_confidence(self):
50 | return 0.0
51 |
52 | def filter_high_bit_only(self, aBuf):
53 | aBuf = re.sub(b'([\x00-\x7F])+', b' ', aBuf)
54 | return aBuf
55 |
56 | def filter_without_english_letters(self, aBuf):
57 | aBuf = re.sub(b'([A-Za-z])+', b' ', aBuf)
58 | return aBuf
59 |
60 | def filter_with_english_letters(self, aBuf):
61 | # TODO
62 | return aBuf
63 |
--------------------------------------------------------------------------------
/libs/chardet/codingstatemachine.py:
--------------------------------------------------------------------------------
1 | ######################## BEGIN LICENSE BLOCK ########################
2 | # The Original Code is mozilla.org code.
3 | #
4 | # The Initial Developer of the Original Code is
5 | # Netscape Communications Corporation.
6 | # Portions created by the Initial Developer are Copyright (C) 1998
7 | # the Initial Developer. All Rights Reserved.
8 | #
9 | # Contributor(s):
10 | # Mark Pilgrim - port to Python
11 | #
12 | # This library is free software; you can redistribute it and/or
13 | # modify it under the terms of the GNU Lesser General Public
14 | # License as published by the Free Software Foundation; either
15 | # version 2.1 of the License, or (at your option) any later version.
16 | #
17 | # This library is distributed in the hope that it will be useful,
18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | # Lesser General Public License for more details.
21 | #
22 | # You should have received a copy of the GNU Lesser General Public
23 | # License along with this library; if not, write to the Free Software
24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
25 | # 02110-1301 USA
26 | ######################### END LICENSE BLOCK #########################
27 |
28 | from .constants import eStart, eError, eItsMe
29 |
30 | class CodingStateMachine:
31 | def __init__(self, sm):
32 | self._mModel = sm
33 | self._mCurrentBytePos = 0
34 | self._mCurrentCharLen = 0
35 | self.reset()
36 |
37 | def reset(self):
38 | self._mCurrentState = eStart
39 |
40 | def next_state(self, c):
41 | # for each byte we get its class
42 | # if it is first byte, we also get byte length
43 | try:
44 | byteCls = self._mModel['classTable'][c]
45 | except IndexError:
46 | return eError
47 | if self._mCurrentState == eStart:
48 | self._mCurrentBytePos = 0
49 | self._mCurrentCharLen = self._mModel['charLenTable'][byteCls]
50 | # from byte's class and stateTable, we get its next state
51 | self._mCurrentState = self._mModel['stateTable'][self._mCurrentState * self._mModel['classFactor'] + byteCls]
52 | self._mCurrentBytePos += 1
53 | return self._mCurrentState
54 |
55 | def get_current_charlen(self):
56 | return self._mCurrentCharLen
57 |
58 | def get_coding_state_machine(self):
59 | return self._mModel['name']
60 |
--------------------------------------------------------------------------------
/libs/chardet/constants.py:
--------------------------------------------------------------------------------
1 | ######################## BEGIN LICENSE BLOCK ########################
2 | # The Original Code is Mozilla Universal charset detector code.
3 | #
4 | # The Initial Developer of the Original Code is
5 | # Netscape Communications Corporation.
6 | # Portions created by the Initial Developer are Copyright (C) 2001
7 | # the Initial Developer. All Rights Reserved.
8 | #
9 | # Contributor(s):
10 | # Mark Pilgrim - port to Python
11 | # Shy Shalom - original C code
12 | #
13 | # This library is free software; you can redistribute it and/or
14 | # modify it under the terms of the GNU Lesser General Public
15 | # License as published by the Free Software Foundation; either
16 | # version 2.1 of the License, or (at your option) any later version.
17 | #
18 | # This library is distributed in the hope that it will be useful,
19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 | # Lesser General Public License for more details.
22 | #
23 | # You should have received a copy of the GNU Lesser General Public
24 | # License along with this library; if not, write to the Free Software
25 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
26 | # 02110-1301 USA
27 | ######################### END LICENSE BLOCK #########################
28 |
29 | _debug = 0
30 |
31 | eDetecting = 0
32 | eFoundIt = 1
33 | eNotMe = 2
34 |
35 | eStart = 0
36 | eError = 1
37 | eItsMe = 2
38 |
39 | SHORTCUT_THRESHOLD = 0.95
40 |
--------------------------------------------------------------------------------
/libs/chardet/escprober.py:
--------------------------------------------------------------------------------
1 | ######################## BEGIN LICENSE BLOCK ########################
2 | # The Original Code is mozilla.org code.
3 | #
4 | # The Initial Developer of the Original Code is
5 | # Netscape Communications Corporation.
6 | # Portions created by the Initial Developer are Copyright (C) 1998
7 | # the Initial Developer. All Rights Reserved.
8 | #
9 | # Contributor(s):
10 | # Mark Pilgrim - port to Python
11 | #
12 | # This library is free software; you can redistribute it and/or
13 | # modify it under the terms of the GNU Lesser General Public
14 | # License as published by the Free Software Foundation; either
15 | # version 2.1 of the License, or (at your option) any later version.
16 | #
17 | # This library is distributed in the hope that it will be useful,
18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | # Lesser General Public License for more details.
21 | #
22 | # You should have received a copy of the GNU Lesser General Public
23 | # License along with this library; if not, write to the Free Software
24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
25 | # 02110-1301 USA
26 | ######################### END LICENSE BLOCK #########################
27 |
28 | import sys
29 | from . import constants
30 | from .escsm import HZSMModel, ISO2022CNSMModel, ISO2022JPSMModel, ISO2022KRSMModel
31 | from .charsetprober import CharSetProber
32 | from .codingstatemachine import CodingStateMachine
33 |
34 | class EscCharSetProber(CharSetProber):
35 | def __init__(self):
36 | CharSetProber.__init__(self)
37 | self._mCodingSM = [ \
38 | CodingStateMachine(HZSMModel),
39 | CodingStateMachine(ISO2022CNSMModel),
40 | CodingStateMachine(ISO2022JPSMModel),
41 | CodingStateMachine(ISO2022KRSMModel)
42 | ]
43 | self.reset()
44 |
45 | def reset(self):
46 | CharSetProber.reset(self)
47 | for codingSM in self._mCodingSM:
48 | if not codingSM: continue
49 | codingSM.active = True
50 | codingSM.reset()
51 | self._mActiveSM = len(self._mCodingSM)
52 | self._mDetectedCharset = None
53 |
54 | def get_charset_name(self):
55 | return self._mDetectedCharset
56 |
57 | def get_confidence(self):
58 | if self._mDetectedCharset:
59 | return 0.99
60 | else:
61 | return 0.00
62 |
63 | def feed(self, aBuf):
64 | for c in aBuf:
65 | for codingSM in self._mCodingSM:
66 | if not codingSM: continue
67 | if not codingSM.active: continue
68 | codingState = codingSM.next_state(c)
69 | if codingState == constants.eError:
70 | codingSM.active = False
71 | self._mActiveSM -= 1
72 | if self._mActiveSM <= 0:
73 | self._mState = constants.eNotMe
74 | return self.get_state()
75 | elif codingState == constants.eItsMe:
76 | self._mState = constants.eFoundIt
77 | self._mDetectedCharset = codingSM.get_coding_state_machine()
78 | return self.get_state()
79 |
80 | return self.get_state()
81 |
--------------------------------------------------------------------------------
/libs/chardet/euckrprober.py:
--------------------------------------------------------------------------------
1 | ######################## BEGIN LICENSE BLOCK ########################
2 | # The Original Code is mozilla.org code.
3 | #
4 | # The Initial Developer of the Original Code is
5 | # Netscape Communications Corporation.
6 | # Portions created by the Initial Developer are Copyright (C) 1998
7 | # the Initial Developer. All Rights Reserved.
8 | #
9 | # Contributor(s):
10 | # Mark Pilgrim - port to Python
11 | #
12 | # This library is free software; you can redistribute it and/or
13 | # modify it under the terms of the GNU Lesser General Public
14 | # License as published by the Free Software Foundation; either
15 | # version 2.1 of the License, or (at your option) any later version.
16 | #
17 | # This library is distributed in the hope that it will be useful,
18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | # Lesser General Public License for more details.
21 | #
22 | # You should have received a copy of the GNU Lesser General Public
23 | # License along with this library; if not, write to the Free Software
24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
25 | # 02110-1301 USA
26 | ######################### END LICENSE BLOCK #########################
27 |
28 | from .mbcharsetprober import MultiByteCharSetProber
29 | from .codingstatemachine import CodingStateMachine
30 | from .chardistribution import EUCKRDistributionAnalysis
31 | from .mbcssm import EUCKRSMModel
32 |
33 | class EUCKRProber(MultiByteCharSetProber):
34 | def __init__(self):
35 | MultiByteCharSetProber.__init__(self)
36 | self._mCodingSM = CodingStateMachine(EUCKRSMModel)
37 | self._mDistributionAnalyzer = EUCKRDistributionAnalysis()
38 | self.reset()
39 |
40 | def get_charset_name(self):
41 | return "EUC-KR"
42 |
--------------------------------------------------------------------------------
/libs/chardet/euctwprober.py:
--------------------------------------------------------------------------------
1 | ######################## BEGIN LICENSE BLOCK ########################
2 | # The Original Code is mozilla.org code.
3 | #
4 | # The Initial Developer of the Original Code is
5 | # Netscape Communications Corporation.
6 | # Portions created by the Initial Developer are Copyright (C) 1998
7 | # the Initial Developer. All Rights Reserved.
8 | #
9 | # Contributor(s):
10 | # Mark Pilgrim - port to Python
11 | #
12 | # This library is free software; you can redistribute it and/or
13 | # modify it under the terms of the GNU Lesser General Public
14 | # License as published by the Free Software Foundation; either
15 | # version 2.1 of the License, or (at your option) any later version.
16 | #
17 | # This library is distributed in the hope that it will be useful,
18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | # Lesser General Public License for more details.
21 | #
22 | # You should have received a copy of the GNU Lesser General Public
23 | # License along with this library; if not, write to the Free Software
24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
25 | # 02110-1301 USA
26 | ######################### END LICENSE BLOCK #########################
27 |
28 | from .mbcharsetprober import MultiByteCharSetProber
29 | from .codingstatemachine import CodingStateMachine
30 | from .chardistribution import EUCTWDistributionAnalysis
31 | from .mbcssm import EUCTWSMModel
32 |
33 | class EUCTWProber(MultiByteCharSetProber):
34 | def __init__(self):
35 | MultiByteCharSetProber.__init__(self)
36 | self._mCodingSM = CodingStateMachine(EUCTWSMModel)
37 | self._mDistributionAnalyzer = EUCTWDistributionAnalysis()
38 | self.reset()
39 |
40 | def get_charset_name(self):
41 | return "EUC-TW"
42 |
--------------------------------------------------------------------------------
/libs/chardet/gb2312prober.py:
--------------------------------------------------------------------------------
1 | ######################## BEGIN LICENSE BLOCK ########################
2 | # The Original Code is mozilla.org code.
3 | #
4 | # The Initial Developer of the Original Code is
5 | # Netscape Communications Corporation.
6 | # Portions created by the Initial Developer are Copyright (C) 1998
7 | # the Initial Developer. All Rights Reserved.
8 | #
9 | # Contributor(s):
10 | # Mark Pilgrim - port to Python
11 | #
12 | # This library is free software; you can redistribute it and/or
13 | # modify it under the terms of the GNU Lesser General Public
14 | # License as published by the Free Software Foundation; either
15 | # version 2.1 of the License, or (at your option) any later version.
16 | #
17 | # This library is distributed in the hope that it will be useful,
18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | # Lesser General Public License for more details.
21 | #
22 | # You should have received a copy of the GNU Lesser General Public
23 | # License along with this library; if not, write to the Free Software
24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
25 | # 02110-1301 USA
26 | ######################### END LICENSE BLOCK #########################
27 |
28 | from .mbcharsetprober import MultiByteCharSetProber
29 | from .codingstatemachine import CodingStateMachine
30 | from .chardistribution import GB2312DistributionAnalysis
31 | from .mbcssm import GB2312SMModel
32 |
33 | class GB2312Prober(MultiByteCharSetProber):
34 | def __init__(self):
35 | MultiByteCharSetProber.__init__(self)
36 | self._mCodingSM = CodingStateMachine(GB2312SMModel)
37 | self._mDistributionAnalyzer = GB2312DistributionAnalysis()
38 | self.reset()
39 |
40 | def get_charset_name(self):
41 | return "GB2312"
42 |
--------------------------------------------------------------------------------
/libs/chardet/mbcharsetprober.py:
--------------------------------------------------------------------------------
1 | ######################## BEGIN LICENSE BLOCK ########################
2 | # The Original Code is Mozilla Universal charset detector code.
3 | #
4 | # The Initial Developer of the Original Code is
5 | # Netscape Communications Corporation.
6 | # Portions created by the Initial Developer are Copyright (C) 2001
7 | # the Initial Developer. All Rights Reserved.
8 | #
9 | # Contributor(s):
10 | # Mark Pilgrim - port to Python
11 | # Shy Shalom - original C code
12 | # Proofpoint, Inc.
13 | #
14 | # This library is free software; you can redistribute it and/or
15 | # modify it under the terms of the GNU Lesser General Public
16 | # License as published by the Free Software Foundation; either
17 | # version 2.1 of the License, or (at your option) any later version.
18 | #
19 | # This library is distributed in the hope that it will be useful,
20 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 | # Lesser General Public License for more details.
23 | #
24 | # You should have received a copy of the GNU Lesser General Public
25 | # License along with this library; if not, write to the Free Software
26 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
27 | # 02110-1301 USA
28 | ######################### END LICENSE BLOCK #########################
29 |
30 | import sys
31 | from . import constants
32 | from .constants import eStart, eError, eItsMe
33 | from .charsetprober import CharSetProber
34 |
35 | class MultiByteCharSetProber(CharSetProber):
36 | def __init__(self):
37 | CharSetProber.__init__(self)
38 | self._mDistributionAnalyzer = None
39 | self._mCodingSM = None
40 | self._mLastChar = [0, 0]
41 |
42 | def reset(self):
43 | CharSetProber.reset(self)
44 | if self._mCodingSM:
45 | self._mCodingSM.reset()
46 | if self._mDistributionAnalyzer:
47 | self._mDistributionAnalyzer.reset()
48 | self._mLastChar = [0, 0]
49 |
50 | def get_charset_name(self):
51 | pass
52 |
53 | def feed(self, aBuf):
54 | aLen = len(aBuf)
55 | for i in range(0, aLen):
56 | codingState = self._mCodingSM.next_state(aBuf[i])
57 | if codingState == eError:
58 | if constants._debug:
59 | sys.stderr.write(self.get_charset_name() + ' prober hit error at byte ' + str(i) + '\n')
60 | self._mState = constants.eNotMe
61 | break
62 | elif codingState == eItsMe:
63 | self._mState = constants.eFoundIt
64 | break
65 | elif codingState == eStart:
66 | charLen = self._mCodingSM.get_current_charlen()
67 | if i == 0:
68 | self._mLastChar[1] = aBuf[0]
69 | self._mDistributionAnalyzer.feed(self._mLastChar, charLen)
70 | else:
71 | self._mDistributionAnalyzer.feed(aBuf[i-1:i+1], charLen)
72 |
73 | self._mLastChar[0] = aBuf[aLen - 1]
74 |
75 | if self.get_state() == constants.eDetecting:
76 | if self._mDistributionAnalyzer.got_enough_data() and \
77 | (self.get_confidence() > constants.SHORTCUT_THRESHOLD):
78 | self._mState = constants.eFoundIt
79 |
80 | return self.get_state()
81 |
82 | def get_confidence(self):
83 | return self._mDistributionAnalyzer.get_confidence()
84 |
--------------------------------------------------------------------------------
/libs/chardet/mbcsgroupprober.py:
--------------------------------------------------------------------------------
1 | ######################## BEGIN LICENSE BLOCK ########################
2 | # The Original Code is Mozilla Universal charset detector code.
3 | #
4 | # The Initial Developer of the Original Code is
5 | # Netscape Communications Corporation.
6 | # Portions created by the Initial Developer are Copyright (C) 2001
7 | # the Initial Developer. All Rights Reserved.
8 | #
9 | # Contributor(s):
10 | # Mark Pilgrim - port to Python
11 | # Shy Shalom - original C code
12 | # Proofpoint, Inc.
13 | #
14 | # This library is free software; you can redistribute it and/or
15 | # modify it under the terms of the GNU Lesser General Public
16 | # License as published by the Free Software Foundation; either
17 | # version 2.1 of the License, or (at your option) any later version.
18 | #
19 | # This library is distributed in the hope that it will be useful,
20 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 | # Lesser General Public License for more details.
23 | #
24 | # You should have received a copy of the GNU Lesser General Public
25 | # License along with this library; if not, write to the Free Software
26 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
27 | # 02110-1301 USA
28 | ######################### END LICENSE BLOCK #########################
29 |
30 | from .charsetgroupprober import CharSetGroupProber
31 | from .utf8prober import UTF8Prober
32 | from .sjisprober import SJISProber
33 | from .eucjpprober import EUCJPProber
34 | from .gb2312prober import GB2312Prober
35 | from .euckrprober import EUCKRProber
36 | from .big5prober import Big5Prober
37 | from .euctwprober import EUCTWProber
38 |
39 | class MBCSGroupProber(CharSetGroupProber):
40 | def __init__(self):
41 | CharSetGroupProber.__init__(self)
42 | self._mProbers = [ \
43 | UTF8Prober(),
44 | SJISProber(),
45 | EUCJPProber(),
46 | GB2312Prober(),
47 | EUCKRProber(),
48 | Big5Prober(),
49 | EUCTWProber()]
50 | self.reset()
51 |
--------------------------------------------------------------------------------
/libs/chardet/sbcsgroupprober.py:
--------------------------------------------------------------------------------
1 | ######################## BEGIN LICENSE BLOCK ########################
2 | # The Original Code is Mozilla Universal charset detector code.
3 | #
4 | # The Initial Developer of the Original Code is
5 | # Netscape Communications Corporation.
6 | # Portions created by the Initial Developer are Copyright (C) 2001
7 | # the Initial Developer. All Rights Reserved.
8 | #
9 | # Contributor(s):
10 | # Mark Pilgrim - port to Python
11 | # Shy Shalom - original C code
12 | #
13 | # This library is free software; you can redistribute it and/or
14 | # modify it under the terms of the GNU Lesser General Public
15 | # License as published by the Free Software Foundation; either
16 | # version 2.1 of the License, or (at your option) any later version.
17 | #
18 | # This library is distributed in the hope that it will be useful,
19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 | # Lesser General Public License for more details.
22 | #
23 | # You should have received a copy of the GNU Lesser General Public
24 | # License along with this library; if not, write to the Free Software
25 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
26 | # 02110-1301 USA
27 | ######################### END LICENSE BLOCK #########################
28 |
29 | import sys
30 | from . import constants
31 | from .charsetgroupprober import CharSetGroupProber
32 | from .sbcharsetprober import SingleByteCharSetProber
33 | from .langcyrillicmodel import Win1251CyrillicModel, Koi8rModel, Latin5CyrillicModel, MacCyrillicModel, Ibm866Model, Ibm855Model
34 | from .langgreekmodel import Latin7GreekModel, Win1253GreekModel
35 | from .langbulgarianmodel import Latin5BulgarianModel, Win1251BulgarianModel
36 | from .langhungarianmodel import Latin2HungarianModel, Win1250HungarianModel
37 | from .langthaimodel import TIS620ThaiModel
38 | from .langhebrewmodel import Win1255HebrewModel
39 | from .hebrewprober import HebrewProber
40 |
41 | class SBCSGroupProber(CharSetGroupProber):
42 | def __init__(self):
43 | CharSetGroupProber.__init__(self)
44 | self._mProbers = [ \
45 | SingleByteCharSetProber(Win1251CyrillicModel),
46 | SingleByteCharSetProber(Koi8rModel),
47 | SingleByteCharSetProber(Latin5CyrillicModel),
48 | SingleByteCharSetProber(MacCyrillicModel),
49 | SingleByteCharSetProber(Ibm866Model),
50 | SingleByteCharSetProber(Ibm855Model),
51 | SingleByteCharSetProber(Latin7GreekModel),
52 | SingleByteCharSetProber(Win1253GreekModel),
53 | SingleByteCharSetProber(Latin5BulgarianModel),
54 | SingleByteCharSetProber(Win1251BulgarianModel),
55 | SingleByteCharSetProber(Latin2HungarianModel),
56 | SingleByteCharSetProber(Win1250HungarianModel),
57 | SingleByteCharSetProber(TIS620ThaiModel),
58 | ]
59 | hebrewProber = HebrewProber()
60 | logicalHebrewProber = SingleByteCharSetProber(Win1255HebrewModel, False, hebrewProber)
61 | visualHebrewProber = SingleByteCharSetProber(Win1255HebrewModel, True, hebrewProber)
62 | hebrewProber.set_model_probers(logicalHebrewProber, visualHebrewProber)
63 | self._mProbers.extend([hebrewProber, logicalHebrewProber, visualHebrewProber])
64 |
65 | self.reset()
66 |
--------------------------------------------------------------------------------
/libs/chardet/utf8prober.py:
--------------------------------------------------------------------------------
1 | ######################## BEGIN LICENSE BLOCK ########################
2 | # The Original Code is mozilla.org code.
3 | #
4 | # The Initial Developer of the Original Code is
5 | # Netscape Communications Corporation.
6 | # Portions created by the Initial Developer are Copyright (C) 1998
7 | # the Initial Developer. All Rights Reserved.
8 | #
9 | # Contributor(s):
10 | # Mark Pilgrim - port to Python
11 | #
12 | # This library is free software; you can redistribute it and/or
13 | # modify it under the terms of the GNU Lesser General Public
14 | # License as published by the Free Software Foundation; either
15 | # version 2.1 of the License, or (at your option) any later version.
16 | #
17 | # This library is distributed in the hope that it will be useful,
18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | # Lesser General Public License for more details.
21 | #
22 | # You should have received a copy of the GNU Lesser General Public
23 | # License along with this library; if not, write to the Free Software
24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
25 | # 02110-1301 USA
26 | ######################### END LICENSE BLOCK #########################
27 |
28 | import sys
29 | from . import constants
30 | from .constants import eStart, eError, eItsMe
31 | from .charsetprober import CharSetProber
32 | from .codingstatemachine import CodingStateMachine
33 | from .mbcssm import UTF8SMModel
34 |
35 | ONE_CHAR_PROB = 0.5
36 |
37 | class UTF8Prober(CharSetProber):
38 | def __init__(self):
39 | CharSetProber.__init__(self)
40 | self._mCodingSM = CodingStateMachine(UTF8SMModel)
41 | self.reset()
42 |
43 | def reset(self):
44 | CharSetProber.reset(self)
45 | self._mCodingSM.reset()
46 | self._mNumOfMBChar = 0
47 |
48 | def get_charset_name(self):
49 | return "utf-8"
50 |
51 | def feed(self, aBuf):
52 | for c in aBuf:
53 | codingState = self._mCodingSM.next_state(c)
54 | if codingState == eError:
55 | self._mState = constants.eNotMe
56 | break
57 | elif codingState == eItsMe:
58 | self._mState = constants.eFoundIt
59 | break
60 | elif codingState == eStart:
61 | if self._mCodingSM.get_current_charlen() >= 2:
62 | self._mNumOfMBChar += 1
63 |
64 | if self.get_state() == constants.eDetecting:
65 | if self.get_confidence() > constants.SHORTCUT_THRESHOLD:
66 | self._mState = constants.eFoundIt
67 |
68 | return self.get_state()
69 |
70 | def get_confidence(self):
71 | unlike = 0.99
72 | if self._mNumOfMBChar < 6:
73 | for i in range(0, self._mNumOfMBChar):
74 | unlike = unlike * ONE_CHAR_PROB
75 | return 1.0 - unlike
76 | else:
77 | return unlike
78 |
--------------------------------------------------------------------------------
/libs/ciElementTree.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import struct
3 |
4 | VERSION = sys.version_info[:2]
5 | PLATFORM = sys.platform
6 | ARCH = 'x%d' % (struct.calcsize('P') * 8)
7 |
8 | if VERSION >= (3, 3):
9 | from iElementTree import *
10 | from iElementTree import _patched_for_komodo_
11 | elif VERSION >= (2, 6):
12 | platform = None
13 |
14 | try:
15 | from _local_arch.ciElementTree import *
16 | platform = "Local arch"
17 | except ImportError:
18 | if PLATFORM == 'darwin':
19 | from _macosx_universal_py26.ciElementTree import *
20 | platform = "MacOS X Universal"
21 | elif PLATFORM.startswith('linux'):
22 | if ARCH == 'x64':
23 | from _linux_libcpp6_x86_64_py26.ciElementTree import *
24 | platform = "Linux 64 bits"
25 | elif ARCH == 'x32':
26 | from _linux_libcpp6_x86_py26.ciElementTree import *
27 | platform = "Linux 32 bits"
28 | elif PLATFORM.startswith('win'):
29 | if ARCH == 'x64':
30 | from _win64_py26.ciElementTree import *
31 | platform = "Windows 64 bits"
32 | elif ARCH == 'x32':
33 | from _win32_py26.ciElementTree import *
34 | platform = "Windows 32 bits"
35 |
36 | if not platform:
37 | raise ImportError("Could not find a suitable ciElementTree binary for your platform and architecture.")
38 |
--------------------------------------------------------------------------------
/libs/codeintel2/__init__.py:
--------------------------------------------------------------------------------
1 | #!python
2 | # ***** BEGIN LICENSE BLOCK *****
3 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 | #
5 | # The contents of this file are subject to the Mozilla Public License
6 | # Version 1.1 (the "License"); you may not use this file except in
7 | # compliance with the License. You may obtain a copy of the License at
8 | # http://www.mozilla.org/MPL/
9 | #
10 | # Software distributed under the License is distributed on an "AS IS"
11 | # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
12 | # License for the specific language governing rights and limitations
13 | # under the License.
14 | #
15 | # The Original Code is Komodo code.
16 | #
17 | # The Initial Developer of the Original Code is ActiveState Software Inc.
18 | # Portions created by ActiveState Software Inc are Copyright (C) 2000-2007
19 | # ActiveState Software Inc. All Rights Reserved.
20 | #
21 | # Contributor(s):
22 | # ActiveState Software Inc
23 | #
24 | # Alternatively, the contents of this file may be used under the terms of
25 | # either the GNU General Public License Version 2 or later (the "GPL"), or
26 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 | # in which case the provisions of the GPL or the LGPL are applicable instead
28 | # of those above. If you wish to allow use of your version of this file only
29 | # under the terms of either the GPL or the LGPL, and not to allow others to
30 | # use your version of this file under the terms of the MPL, indicate your
31 | # decision by deleting the provisions above and replace them with the notice
32 | # and other provisions required by the GPL or the LGPL. If you do not delete
33 | # the provisions above, a recipient may use your version of this file under
34 | # the terms of any one of the MPL, the GPL or the LGPL.
35 | #
36 | # ***** END LICENSE BLOCK *****
37 |
38 | """Get and manage Code Intelligence data about source code of many languages.
39 |
40 | The Code Intelligence system is one for generating and managing code
41 | structure information on given source code. See the spec for more details:
42 | http://specs.tl.activestate.com/kd/kd-0100.html
43 |
44 | General Usage
45 | -------------
46 |
47 | from codeintel2.manager import Manager
48 | mgr = Manager()
49 | # Alternatively use Database upgrade methods directly for finer control.
50 | mgr.upgrade()
51 | mgr.initialize()
52 | try:
53 | # Get a Buffer object from a scimoz/path/content.
54 | buf = mgr.buf_from_*(...)
55 |
56 | # Use the buffer's API to do codeintel-y stuff. For example:
57 | # - See if you are at a trigger point.
58 | trg = buf.trg_from_pos(...)
59 |
60 | # - Get completions at that trigger. See also
61 | # Buffer.async_eval_at_trg(), Buffer.calltips_from_trg().
62 | cplns = buf.cplns_from_trg(trg, ...)
63 |
64 | # ...
65 | finally:
66 | mgr.finalize() # make sure this gets run on your could get hangs
67 | """
68 |
--------------------------------------------------------------------------------
/libs/codeintel2/catalogs/xbl.cix:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/libs/codeintel2/catalogs/xpcom.cix:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/libs/codeintel2/database/__init__.py:
--------------------------------------------------------------------------------
1 | #!python
2 | # ***** BEGIN LICENSE BLOCK *****
3 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 | #
5 | # The contents of this file are subject to the Mozilla Public License
6 | # Version 1.1 (the "License"); you may not use this file except in
7 | # compliance with the License. You may obtain a copy of the License at
8 | # http://www.mozilla.org/MPL/
9 | #
10 | # Software distributed under the License is distributed on an "AS IS"
11 | # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
12 | # License for the specific language governing rights and limitations
13 | # under the License.
14 | #
15 | # The Original Code is Komodo code.
16 | #
17 | # The Initial Developer of the Original Code is ActiveState Software Inc.
18 | # Portions created by ActiveState Software Inc are Copyright (C) 2000-2007
19 | # ActiveState Software Inc. All Rights Reserved.
20 | #
21 | # Contributor(s):
22 | # ActiveState Software Inc
23 | #
24 | # Alternatively, the contents of this file may be used under the terms of
25 | # either the GNU General Public License Version 2 or later (the "GPL"), or
26 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 | # in which case the provisions of the GPL or the LGPL are applicable instead
28 | # of those above. If you wish to allow use of your version of this file only
29 | # under the terms of either the GPL or the LGPL, and not to allow others to
30 | # use your version of this file under the terms of the MPL, indicate your
31 | # decision by deleting the provisions above and replace them with the notice
32 | # and other provisions required by the GPL or the LGPL. If you do not delete
33 | # the provisions above, a recipient may use your version of this file under
34 | # the terms of any one of the MPL, the GPL or the LGPL.
35 | #
36 | # ***** END LICENSE BLOCK *****
37 |
38 | """the codeintel database (start by reading database/database.py)"""
39 |
--------------------------------------------------------------------------------
/libs/codeintel2/hooks.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # Copyright (c) 2006-2008 ActiveState Software Inc.
3 | # See LICENSE.txt for license details.
4 |
5 | """Parts of the codeintel system may provide hooks for customization
6 | by external modules. Implementing a hook is done by adding a
7 | `CodeIntelHookHandler` instance with the manager, like this:
8 |
9 | ---- codeintel_foo.py ----
10 | # My codeintel 'foo' hook.
11 |
12 | from codeintel2.hooks import HookHandler
13 |
14 | class FooHookHandler(HookHandler):
15 | name = "foo"
16 | langs = ["Python"] # only hook into handling for Python code
17 |
18 | # Add implementation of one or more hooks (see below)...
19 |
20 | def register(mgr):
21 | # This will be called by the Manager on startup.
22 | mgr.add_hook_handler(FooHookHandler(mgr))
23 | --------------------------
24 | """
25 |
26 | from pprint import pformat
27 |
28 | from codeintel2.common import *
29 |
30 |
31 | class HookHandler(object):
32 | """Virtual base class for all hook handlers."""
33 | name = None # sub-classes must define a meaningful name (a string)
34 |
35 | # Sub-classes must define the list of language names they operate
36 | # on. E.g.,
37 | # langs = ["Perl"]
38 | # langs = ["HTML", "XML"]
39 | # langs = ["*"] # Means operate on all languages. Use sparingly!
40 | langs = None
41 |
42 | def __init__(self, mgr):
43 | self.mgr = mgr
44 |
45 | # Hook: `post_db_load_blob(blob)'
46 | #
47 | # Called just after a blob is loaded from the the codeintel database.
48 | # Note that this hook is not currently called for blobs from API
49 | # Catalogs or in language stdlibs.
50 | #
51 | # A "blob" is a ciElementTree (a slight tweak to an ElementTree
52 | # object) representing the scan info for code of a single language
53 | # in a single file.
54 | #
55 | # The hook-handler may modify (in-place) or just look at the blob.
56 | # The resulting changes to the blob, if any, are NOT saved to the
57 | # database.
58 | # Potential uses for this hook might be to add implicit state to
59 | # a file for a certain framework, e.g. adding context info to a
60 | # Django template, adding implicit imports to a PHP Zend Framework
61 | # controller file.
62 | def post_db_load_blob(self, blob):
63 | pass
64 |
--------------------------------------------------------------------------------
/libs/codeintel2/lang_html5.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # Copyright (c) 2010 ActiveState Software Inc.
3 | # See LICENSE.txt for license details.
4 |
5 | """HTML 5 support for CodeIntel"""
6 |
7 | import logging
8 |
9 | from codeintel2.common import _xpcom_
10 | from codeintel2.lang_html import HTMLLexer, HTMLLangIntel, HTMLBuffer, HTMLCILEDriver
11 |
12 | if _xpcom_:
13 | from xpcom.server import UnwrapObject
14 |
15 |
16 | #---- globals
17 |
18 | lang = "HTML5"
19 | log = logging.getLogger("codeintel.html5")
20 | # log.setLevel(logging.DEBUG)
21 |
22 |
23 | #---- language support
24 |
25 | class HTML5Lexer(HTMLLexer):
26 | # This must be defined as "HTML" in order to get autocompletion working.
27 | lang = "HTML"
28 |
29 |
30 | class HTML5LangIntel(HTMLLangIntel):
31 | lang = lang
32 |
33 |
34 | class HTML5Buffer(HTMLBuffer):
35 | lang = lang
36 |
37 | # Override the xml_default_dataset_info in order to change the DTD catalog
38 | # that gets used for HTML completions. The namespace is set through the
39 | # Komodo prefs system (defaultHTML5Decl and
40 | # defaultHTML5DeclSystemIdentifier).
41 | def xml_default_dataset_info(self, node=None):
42 | if self._xml_default_dataset_info is None:
43 | import koXMLDatasetInfo
44 | datasetSvc = koXMLDatasetInfo.getService()
45 | self._xml_default_dataset_info = (
46 | datasetSvc.getDefaultPublicId(lang, self.env),
47 | None,
48 | datasetSvc.getDefaultNamespace(lang, self.env))
49 | return self._xml_default_dataset_info
50 |
51 |
52 | class HTML5CILEDriver(HTMLCILEDriver):
53 | lang = lang
54 |
55 |
56 | #---- registration
57 |
58 | def register(mgr):
59 | """Register language support with the Manager."""
60 | mgr.set_lang_info(lang,
61 | silvercity_lexer=HTML5Lexer(),
62 | buf_class=HTML5Buffer,
63 | langintel_class=HTML5LangIntel,
64 | cile_driver_class=HTML5CILEDriver,
65 | is_cpln_lang=True)
66 |
--------------------------------------------------------------------------------
/libs/codeintel2/lang_mason.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # ***** BEGIN LICENSE BLOCK *****
3 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 | #
5 | # The contents of this file are subject to the Mozilla Public License
6 | # Version 1.1 (the "License"); you may not use this file except in
7 | # compliance with the License. You may obtain a copy of the License at
8 | # http://www.mozilla.org/MPL/
9 | #
10 | # Software distributed under the License is distributed on an "AS IS"
11 | # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
12 | # License for the specific language governing rights and limitations
13 | # under the License.
14 | #
15 | # The Original Code is Komodo code.
16 | #
17 | # The Initial Developer of the Original Code is ActiveState Software Inc.
18 | # Portions created by ActiveState Software Inc are Copyright (C) 2000-2007
19 | # ActiveState Software Inc. All Rights Reserved.
20 | #
21 | # Contributor(s):
22 | # ActiveState Software Inc
23 | #
24 | # Alternatively, the contents of this file may be used under the terms of
25 | # either the GNU General Public License Version 2 or later (the "GPL"), or
26 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 | # in which case the provisions of the GPL or the LGPL are applicable instead
28 | # of those above. If you wish to allow use of your version of this file only
29 | # under the terms of either the GPL or the LGPL, and not to allow others to
30 | # use your version of this file under the terms of the MPL, indicate your
31 | # decision by deleting the provisions above and replace them with the notice
32 | # and other provisions required by the GPL or the LGPL. If you do not delete
33 | # the provisions above, a recipient may use your version of this file under
34 | # the terms of any one of the MPL, the GPL or the LGPL.
35 | #
36 | # ***** END LICENSE BLOCK *****
37 |
38 | """Mason support for codeintel"""
39 |
40 | import logging
41 |
42 | from codeintel2.common import *
43 | from codeintel2.udl import UDLLexer, UDLBuffer, UDLCILEDriver, XMLParsingBufferMixin
44 |
45 | #---- globals
46 |
47 | lang = "Mason"
48 | log = logging.getLogger("codeintel.mason")
49 |
50 |
51 | #---- language support
52 | class MasonLexer(UDLLexer):
53 | lang = lang
54 |
55 |
56 | class MasonBuffer(UDLBuffer, XMLParsingBufferMixin):
57 | lang = lang
58 | tpl_lang = lang
59 | m_lang = "HTML"
60 | css_lang = "CSS"
61 | csl_lang = "JavaScript"
62 | ssl_lang = "Perl"
63 |
64 | # Characters that should close an autocomplete UI:
65 | # - wanted for XML completion: ">'\" "
66 | # - wanted for CSS completion: " ('\";},.>"
67 | # - wanted for JS completion: "~`!@#%^&*()-=+{}[]|\\;:'\",.<>?/ "
68 | # - dropping ':' because I think that may be a problem for XML tag
69 | # completion with namespaces (not sure of that though)
70 | # - dropping '[' because need for "" -> "?/"
75 |
76 |
77 | class MasonCILEDriver(UDLCILEDriver):
78 | lang = lang
79 | csl_lang = "JavaScript"
80 | ssl_lang = "Perl"
81 |
82 |
83 | #---- registration
84 | def register(mgr):
85 | """Register language support with the Manager."""
86 | mgr.set_lang_info(lang,
87 | silvercity_lexer=MasonLexer(),
88 | buf_class=MasonBuffer,
89 | import_handler_class=None,
90 | cile_driver_class=MasonCILEDriver,
91 | is_cpln_lang=True)
92 |
--------------------------------------------------------------------------------
/libs/codeintel2/lang_python3.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # Copyright (c) 2010 ActiveState Software Inc.
3 | # See LICENSE.txt for license details.
4 |
5 | """Python 3 support for CodeIntel"""
6 |
7 | import logging
8 |
9 | from codeintel2.common import LazyClassAttribute
10 | from codeintel2.lang_python import (PythonLexer, PythonLangIntel,
11 | PythonImportsEvaluator, PythonBuffer,
12 | PythonImportHandler, PythonCILEDriver)
13 |
14 |
15 | #---- globals
16 |
17 | lang = "Python3"
18 | log = logging.getLogger("codeintel.python3")
19 | # log.setLevel(logging.DEBUG)
20 |
21 |
22 | #---- language support
23 |
24 | class Python3Lexer(PythonLexer):
25 | lang = lang
26 |
27 |
28 | class Python3LangIntel(PythonLangIntel):
29 | lang = lang
30 | interpreterPrefName = "python3"
31 | extraPathsPrefName = "python3ExtraPaths"
32 |
33 | @LazyClassAttribute
34 | def keywords(self):
35 | from SilverCity.Keywords import python3_keywords
36 | return python3_keywords.split(" ")
37 |
38 |
39 | class Python3Buffer(PythonBuffer):
40 | lang = lang
41 |
42 |
43 | class Python3ImportHandler(PythonImportHandler):
44 | lang = lang
45 |
46 |
47 | class Python3CILEDriver(PythonCILEDriver):
48 | lang = lang
49 |
50 | #---- registration
51 |
52 |
53 | def register(mgr):
54 | """Register language support with the Manager."""
55 | mgr.set_lang_info(lang,
56 | silvercity_lexer=Python3Lexer(),
57 | buf_class=Python3Buffer,
58 | langintel_class=Python3LangIntel,
59 | import_handler_class=Python3ImportHandler,
60 | cile_driver_class=Python3CILEDriver,
61 | is_cpln_lang=True)
62 |
--------------------------------------------------------------------------------
/libs/codeintel2/lang_ruby_common.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # ***** BEGIN LICENSE BLOCK *****
3 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 | #
5 | # The contents of this file are subject to the Mozilla Public License
6 | # Version 1.1 (the "License"); you may not use this file except in
7 | # compliance with the License. You may obtain a copy of the License at
8 | # http://www.mozilla.org/MPL/
9 | #
10 | # Software distributed under the License is distributed on an "AS IS"
11 | # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
12 | # License for the specific language governing rights and limitations
13 | # under the License.
14 | #
15 | # The Original Code is Komodo code.
16 | #
17 | # The Initial Developer of the Original Code is ActiveState Software Inc.
18 | # Portions created by ActiveState Software Inc are Copyright (C) 2000-2007
19 | # ActiveState Software Inc. All Rights Reserved.
20 | #
21 | # Contributor(s):
22 | # ActiveState Software Inc
23 | #
24 | # Alternatively, the contents of this file may be used under the terms of
25 | # either the GNU General Public License Version 2 or later (the "GPL"), or
26 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 | # in which case the provisions of the GPL or the LGPL are applicable instead
28 | # of those above. If you wish to allow use of your version of this file only
29 | # under the terms of either the GPL or the LGPL, and not to allow others to
30 | # use your version of this file under the terms of the MPL, indicate your
31 | # decision by deleting the provisions above and replace them with the notice
32 | # and other provisions required by the GPL or the LGPL. If you do not delete
33 | # the provisions above, a recipient may use your version of this file under
34 | # the terms of any one of the MPL, the GPL or the LGPL.
35 | #
36 | # ***** END LICENSE BLOCK *****
37 |
38 | """Common routines for ruby and ruby/rhtml support for CodeIntel"""
39 |
40 | import os.path
41 | import logging
42 |
43 | log = logging.getLogger("codeintel.ruby.common")
44 | # log.setLevel(logging.DEBUG)
45 |
46 |
47 | class RubyCommonBufferMixin:
48 | def check_for_rails_app_path(self, path):
49 | self.framework_role = None
50 | if path is None:
51 | # log.debug("check_for_rails_app_path: no path given")
52 | return
53 | apath = os.path.abspath(path)
54 | aplist = apath.split(os.path.sep)
55 | role_root = "rails"
56 | if len(aplist) < 3:
57 | return
58 | elif (aplist[-3] == "app" and
59 | (aplist[-2] == "controllers" and aplist[-1].endswith(".rb")
60 | or aplist[-2] == "helpers" and aplist[-1].endswith("_helper.rb")
61 | or aplist[-2] == "models" and aplist[-1].endswith(".rb"))):
62 | role = '.'.join((role_root, aplist[-2]))
63 | elif (len(aplist) >= 4
64 | and aplist[-4] == "app" and aplist[-3] == "views"
65 | and aplist[-1].endswith((".html.erb", ".rhtml"))):
66 | role = '.'.join((role_root, aplist[-3], aplist[-2]))
67 | elif (aplist[-3] == "db" and aplist[-2] == "migrate"
68 | and aplist[-1][0].isdigit()
69 | and aplist[-1].endswith(".rb")):
70 | role = '.'.join((role_root, aplist[-3], aplist[-2]))
71 | elif (aplist[-3] == "test"
72 | and aplist[-2] in ("functional", "unit")
73 | # integration tests not supported until we can find
74 | # ActionController::IntegrationTest
75 | and aplist[-1].endswith("_test.rb")):
76 | role = '.'.join((role_root, aplist[-3], aplist[-2]))
77 | else:
78 | return
79 | self.framework_role = role
80 |
--------------------------------------------------------------------------------
/libs/codeintel2/lang_smarty.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # ***** BEGIN LICENSE BLOCK *****
3 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 | #
5 | # The contents of this file are subject to the Mozilla Public License
6 | # Version 1.1 (the "License"); you may not use this file except in
7 | # compliance with the License. You may obtain a copy of the License at
8 | # http://www.mozilla.org/MPL/
9 | #
10 | # Software distributed under the License is distributed on an "AS IS"
11 | # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
12 | # License for the specific language governing rights and limitations
13 | # under the License.
14 | #
15 | # The Original Code is Komodo code.
16 | #
17 | # The Initial Developer of the Original Code is ActiveState Software Inc.
18 | # Portions created by ActiveState Software Inc are Copyright (C) 2000-2007
19 | # ActiveState Software Inc. All Rights Reserved.
20 | #
21 | # Contributor(s):
22 | # ActiveState Software Inc
23 | #
24 | # Alternatively, the contents of this file may be used under the terms of
25 | # either the GNU General Public License Version 2 or later (the "GPL"), or
26 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 | # in which case the provisions of the GPL or the LGPL are applicable instead
28 | # of those above. If you wish to allow use of your version of this file only
29 | # under the terms of either the GPL or the LGPL, and not to allow others to
30 | # use your version of this file under the terms of the MPL, indicate your
31 | # decision by deleting the provisions above and replace them with the notice
32 | # and other provisions required by the GPL or the LGPL. If you do not delete
33 | # the provisions above, a recipient may use your version of this file under
34 | # the terms of any one of the MPL, the GPL or the LGPL.
35 | #
36 | # ***** END LICENSE BLOCK *****
37 |
38 | """Smarty support for codeintel"""
39 |
40 | import logging
41 |
42 | from codeintel2.common import *
43 | from codeintel2.udl import UDLLexer, UDLBuffer, UDLCILEDriver, XMLParsingBufferMixin
44 |
45 | #---- globals
46 |
47 | lang = "Smarty"
48 | log = logging.getLogger("codeintel.smarty")
49 |
50 |
51 | #---- language support
52 | class SmartyLexer(UDLLexer):
53 | lang = lang
54 |
55 |
56 | class SmartyBuffer(UDLBuffer, XMLParsingBufferMixin):
57 | lang = lang
58 | tpl_lang = lang
59 | m_lang = "HTML"
60 | css_lang = "CSS"
61 | csl_lang = "JavaScript"
62 | ssl_lang = "PHP"
63 |
64 | # Characters that should close an autocomplete UI:
65 | # - wanted for XML completion: ">'\" "
66 | # - wanted for CSS completion: " ('\";},.>"
67 | # - wanted for JS completion: "~`!@#%^&*()-=+{}[]|\\;:'\",.<>?/ "
68 | # - dropping ':' because I think that may be a problem for XML tag
69 | # completion with namespaces (not sure of that though)
70 | # - dropping '[' because need for "" -> "?/"
75 |
76 |
77 | class SmartyCILEDriver(UDLCILEDriver):
78 | lang = lang
79 | csl_lang = "JavaScript"
80 | ssl_lang = "PHP"
81 |
82 |
83 | #---- registration
84 | def register(mgr):
85 | """Register language support with the Manager."""
86 | mgr.set_lang_info(lang,
87 | silvercity_lexer=SmartyLexer(),
88 | buf_class=SmartyBuffer,
89 | import_handler_class=None,
90 | cile_driver_class=SmartyCILEDriver,
91 | is_cpln_lang=True)
92 |
--------------------------------------------------------------------------------
/libs/codeintel2/lang_xbl.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # ***** BEGIN LICENSE BLOCK *****
3 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 | #
5 | # The contents of this file are subject to the Mozilla Public License
6 | # Version 1.1 (the "License"); you may not use this file except in
7 | # compliance with the License. You may obtain a copy of the License at
8 | # http://www.mozilla.org/MPL/
9 | #
10 | # Software distributed under the License is distributed on an "AS IS"
11 | # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
12 | # License for the specific language governing rights and limitations
13 | # under the License.
14 | #
15 | # The Original Code is Komodo code.
16 | #
17 | # The Initial Developer of the Original Code is ActiveState Software Inc.
18 | # Portions created by ActiveState Software Inc are Copyright (C) 2000-2007
19 | # ActiveState Software Inc. All Rights Reserved.
20 | #
21 | # Contributor(s):
22 | # ActiveState Software Inc
23 | #
24 | # Alternatively, the contents of this file may be used under the terms of
25 | # either the GNU General Public License Version 2 or later (the "GPL"), or
26 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 | # in which case the provisions of the GPL or the LGPL are applicable instead
28 | # of those above. If you wish to allow use of your version of this file only
29 | # under the terms of either the GPL or the LGPL, and not to allow others to
30 | # use your version of this file under the terms of the MPL, indicate your
31 | # decision by deleting the provisions above and replace them with the notice
32 | # and other provisions required by the GPL or the LGPL. If you do not delete
33 | # the provisions above, a recipient may use your version of this file under
34 | # the terms of any one of the MPL, the GPL or the LGPL.
35 | #
36 | # ***** END LICENSE BLOCK *****
37 |
38 | """XBL support for codeintel"""
39 |
40 | import logging
41 |
42 | from codeintel2.common import *
43 | from codeintel2.udl import UDLLexer, UDLBuffer, UDLCILEDriver, XMLParsingBufferMixin
44 |
45 |
46 | #---- globals
47 | lang = "XBL"
48 | log = logging.getLogger("codeintel.xbl")
49 |
50 |
51 | #---- language support
52 | class XBLLexer(UDLLexer):
53 | lang = lang
54 |
55 |
56 | class XBLBuffer(UDLBuffer, XMLParsingBufferMixin):
57 | lang = lang
58 | m_lang = "XML"
59 | css_lang = "CSS"
60 | csl_lang = "JavaScript"
61 |
62 | # Characters that should close an autocomplete UI:
63 | # - wanted for XML completion: ">'\" "
64 | # - wanted for CSS completion: " ('\";},.>"
65 | # - wanted for JS completion: "~`!@#%^&*()-=+{}[]|\\;:'\",.<>?/ "
66 | # - dropping ':' because I think that may be a problem for XML tag
67 | # completion with namespaces (not sure of that though)
68 | # - dropping '[' because need for "" -> "?/"
70 |
71 |
72 | # This gives global window completions but does not produce cile
73 | # information, so completions for local variables and functions will
74 | # not work.
75 | class XBLCILEDriver(UDLCILEDriver):
76 | lang = lang
77 | csl_lang = "JavaScript"
78 |
79 |
80 | #---- registration
81 | def register(mgr):
82 | """Register language support with the Manager."""
83 | mgr.set_lang_info(lang,
84 | silvercity_lexer=XBLLexer(),
85 | buf_class=XBLBuffer,
86 | import_handler_class=None,
87 | cile_driver_class=XBLCILEDriver,
88 | is_cpln_lang=True)
89 |
--------------------------------------------------------------------------------
/libs/codeintel2/lang_xul.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # ***** BEGIN LICENSE BLOCK *****
3 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 | #
5 | # The contents of this file are subject to the Mozilla Public License
6 | # Version 1.1 (the "License"); you may not use this file except in
7 | # compliance with the License. You may obtain a copy of the License at
8 | # http://www.mozilla.org/MPL/
9 | #
10 | # Software distributed under the License is distributed on an "AS IS"
11 | # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
12 | # License for the specific language governing rights and limitations
13 | # under the License.
14 | #
15 | # The Original Code is Komodo code.
16 | #
17 | # The Initial Developer of the Original Code is ActiveState Software Inc.
18 | # Portions created by ActiveState Software Inc are Copyright (C) 2000-2007
19 | # ActiveState Software Inc. All Rights Reserved.
20 | #
21 | # Contributor(s):
22 | # ActiveState Software Inc
23 | #
24 | # Alternatively, the contents of this file may be used under the terms of
25 | # either the GNU General Public License Version 2 or later (the "GPL"), or
26 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 | # in which case the provisions of the GPL or the LGPL are applicable instead
28 | # of those above. If you wish to allow use of your version of this file only
29 | # under the terms of either the GPL or the LGPL, and not to allow others to
30 | # use your version of this file under the terms of the MPL, indicate your
31 | # decision by deleting the provisions above and replace them with the notice
32 | # and other provisions required by the GPL or the LGPL. If you do not delete
33 | # the provisions above, a recipient may use your version of this file under
34 | # the terms of any one of the MPL, the GPL or the LGPL.
35 | #
36 | # ***** END LICENSE BLOCK *****
37 |
38 | """XUL support for codeintel"""
39 |
40 | import logging
41 |
42 | from codeintel2.common import *
43 | from codeintel2.udl import UDLLexer, UDLBuffer, UDLCILEDriver, XMLParsingBufferMixin
44 |
45 |
46 | #---- globals
47 |
48 | lang = "XUL"
49 | log = logging.getLogger("codeintel.xul")
50 |
51 |
52 | #---- language support
53 | class XULLexer(UDLLexer):
54 | lang = lang
55 |
56 |
57 | class XULBuffer(UDLBuffer, XMLParsingBufferMixin):
58 | lang = "XUL"
59 | m_lang = "XML"
60 | css_lang = "CSS"
61 | csl_lang = "JavaScript"
62 |
63 | # Characters that should close an autocomplete UI:
64 | # - wanted for XML completion: ">'\" "
65 | # - wanted for CSS completion: " ('\";},.>"
66 | # - wanted for JS completion: "~`!@#%^&*()-=+{}[]|\\;:'\",.<>?/ "
67 | # - dropping ':' because I think that may be a problem for XML tag
68 | # completion with namespaces (not sure of that though)
69 | # - dropping '[' because need for "" -> "?/"
71 |
72 |
73 | class XULCILEDriver(UDLCILEDriver):
74 | lang = lang
75 | csl_lang = "JavaScript"
76 |
77 |
78 | #---- registration
79 | def register(mgr):
80 | """Register language support with the Manager."""
81 | mgr.set_lang_info(lang,
82 | silvercity_lexer=XULLexer(),
83 | buf_class=XULBuffer,
84 | import_handler_class=None,
85 | cile_driver_class=XULCILEDriver,
86 | is_cpln_lang=True)
87 |
--------------------------------------------------------------------------------
/libs/codeintel2/lexers/Luddite.lexres:
--------------------------------------------------------------------------------
1 | 1:lexer resource
2 | 2:1
3 | 3:2
4 | 4:0
5 | 48:1:2:0
6 | 11:7
7 | 12:Luddite
8 | 13
9 | 14:0:0
10 | 16:0:5
11 | 15:0:1
12 | 14:1:15
13 | 16:1:21
14 | 15:1:0
15 | 14:2:22
16 | 16:2:29
17 | 15:2:2
18 | 14:3:31
19 | 16:3:46
20 | 15:3:0
21 | 14:4:49
22 | 16:4:56
23 | 15:4:0
24 | 17:2
25 | 18:0
26 | 19:1
27 | 18:2
28 | 19:2
29 | 11:327
30 | 12:accept all at_eol delimiter end_style family fold include initial keep_deli
31 | 12:miter keyword_style keywords language namespace no_keyword paint pattern pu
32 | 12:blic_id publicid redo reject set_delimiter set_opposite_delimiter skip spop
33 | 12:_check spush_check start_style state sub_language sublanguage system_id sys
34 | 12:temid token_check upto upto
35 | 21
36 | 22:28:27
37 | 11:3
38 | 12:#{{
39 | 20:0:23:1
40 | 11:3
41 | 12:#}}
42 | 20:1:23:-1
43 | 32:2
44 | 33:0:22:2
45 | 33:1:30:3
46 | 34:6
47 | 35:1
48 | 11:1
49 | 12:.
50 | 36:2:-1:-1:1:2:0:0:0
51 | 40
52 | 37:2
53 | 35:2
54 | 11:3
55 | 12:#.*
56 | 36:2:22:23:0:-1:0:0:0
57 | 40
58 | 11:1
59 | 12:/
60 | 36:1:22:-1:0:3:0:0:0
61 | 40
62 | 11:1
63 | 12:"
64 | 36:1:22:-1:0:4:0:0:0
65 | 40
66 | 11:1
67 | 12:'
68 | 36:1:22:-1:0:5:0:0:0
69 | 40
70 | 11:12
71 | 12:[\w][\w\d_]*
72 | 36:2:22:28:0:-1:0:0:0
73 | 40
74 | 11:7
75 | 12:[,=>:]+
76 | 36:2:22:29:0:-1:0:0:0
77 | 40
78 | 11:4
79 | 12:NULL
80 | 36:4:22:-1:0:-1:0:0:0
81 | 41
82 | 35:3
83 | 11:3
84 | 12:\\.
85 | 36:2:-1:-1:0:-1:0:0:0
86 | 40
87 | 11:7
88 | 12:\/[\w]*
89 | 36:2:-1:30:0:2:0:0:0
90 | 40
91 | 11:6
92 | 12:[\r\n]
93 | 36:2:-1:30:0:2:0:0:0
94 | 40
95 | 11:4
96 | 12:NULL
97 | 36:4:30:-1:0:-1:0:0:0
98 | 41
99 | 35:4
100 | 11:1
101 | 12:"
102 | 36:1:-1:26:0:2:0:0:0
103 | 40
104 | 11:3
105 | 12:\\.
106 | 36:2:-1:-1:0:-1:0:0:0
107 | 40
108 | 11:1
109 | 12:$
110 | 36:2:26:-1:0:2:0:0:0
111 | 40
112 | 11:2
113 | 12:\r
114 | 36:1:26:-1:0:2:0:0:0
115 | 40
116 | 11:4
117 | 12:NULL
118 | 36:4:26:-1:0:-1:0:0:0
119 | 41
120 | 35:5
121 | 11:1
122 | 12:'
123 | 36:1:-1:26:0:2:0:0:0
124 | 40
125 | 11:3
126 | 12:\\.
127 | 36:2:-1:-1:0:-1:0:0:0
128 | 40
129 | 11:1
130 | 12:$
131 | 36:2:26:-1:0:2:0:0:0
132 | 40
133 | 11:2
134 | 12:\r
135 | 36:1:26:-1:0:2:0:0:0
136 | 40
137 | 11:4
138 | 12:NULL
139 | 36:4:26:-1:0:-1:0:0:0
140 | 41
141 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.6/addons.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Addons are dynamically linked shared objects. They can provide glue to C
3 | * and C++ libraries. The API (at the moment) is rather complex, involving
4 | * knowledge of several libraries:
5 | */
6 | var addons = {};
7 |
8 | exports = addons;
9 |
10 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.6/assert.js:
--------------------------------------------------------------------------------
1 | /**
2 | * This module is used for writing unit tests for your applications, you
3 | * can access it with require('assert').
4 | */
5 | var assert = {};
6 |
7 | /**
8 | * Tests shallow, coercive non-equality with the not equal comparison
9 | * operator ( != ).
10 | * @param actual
11 | * @param expected
12 | * @param message
13 | */
14 | assert.notEqual = function(actual, expected, message) {}
15 |
16 | /**
17 | * Expects block not to throw an error, see assert.throws for details.
18 | * @param block
19 | * @param error
20 | * @param message
21 | */
22 | assert.doesNotThrow = function(block, error, message) {}
23 |
24 | /**
25 | * Tests if value is a true value, it is equivalent to assert.equal(true,
26 | * value, message);
27 | * @param value
28 | * @param message
29 | */
30 | assert.ok = function(value, message) {}
31 |
32 | /**
33 | * Tests if value is not a false value, throws if it is a true value.
34 | * Useful when testing the first argument, error in callbacks.
35 | * @param value
36 | */
37 | assert.ifError = function(value) {}
38 |
39 | /**
40 | * Tests shallow, coercive equality with the equal comparison operator ( ==
41 | * ).
42 | * @param actual
43 | * @param expected
44 | * @param message
45 | */
46 | assert.equal = function(actual, expected, message) {}
47 |
48 | /**
49 | * Tests for any deep inequality.
50 | * @param actual
51 | * @param expected
52 | * @param message
53 | */
54 | assert.notDeepEqual = function(actual, expected, message) {}
55 |
56 | /**
57 | * Tests strict non-equality, as determined by the strict not equal
58 | * operator ( !== )
59 | * @param actual
60 | * @param expected
61 | * @param message
62 | */
63 | assert.notStrictEqual = function(actual, expected, message) {}
64 |
65 | /**
66 | * Throws an exception that displays the values for actual and expected
67 | * separated by the provided operator.
68 | * @param actual
69 | * @param expected
70 | * @param message
71 | * @param operator
72 | */
73 | assert.fail = function(actual, expected, message, operator) {}
74 |
75 | /**
76 | * Expects block to throw an error. error can be constructor, regexp or
77 | * validation function.
78 | * @param block
79 | * @param error
80 | * @param message
81 | */
82 | assert.throws = function(block, error, message) {}
83 |
84 | /**
85 | * Tests strict equality, as determined by the strict equality operator (
86 | * === )
87 | * @param actual
88 | * @param expected
89 | * @param message
90 | */
91 | assert.strictEqual = function(actual, expected, message) {}
92 |
93 | /**
94 | * Tests for deep equality.
95 | * @param actual
96 | * @param expected
97 | * @param message
98 | */
99 | assert.deepEqual = function(actual, expected, message) {}
100 |
101 | exports = assert;
102 |
103 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.6/cluster.js:
--------------------------------------------------------------------------------
1 | /**
2 | * A single instance of Node runs in a single thread. To take advantage of
3 | * multi-core systems the user will sometimes want to launch a cluster of
4 | * Node processes to handle the load.
5 | */
6 | var cluster = {};
7 |
8 | /**
9 | * Spawn a new worker process. This can only be called from the master
10 | * process.
11 | */
12 | cluster.fork = function() {}
13 |
14 | /**
15 | * Boolean flags to determine if the current process is a master or a
16 | * worker process in a cluster. A process isMaster if
17 | * process.env.NODE_WORKER_ID is undefined.
18 | */
19 | cluster.isMaster = 0;
20 |
21 | /**
22 | * Boolean flags to determine if the current process is a master or a
23 | * worker process in a cluster. A process isMaster if
24 | * process.env.NODE_WORKER_ID is undefined.
25 | */
26 | cluster.isWorker = 0;
27 |
28 | exports = cluster;
29 |
30 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.6/console.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * For printing to stdout and stderr. Similar to the console object
4 | * functions provided by most web browsers, here the output is sent to
5 | * stdout or stderr.
6 | * @type {Object}
7 | */
8 | var console = {};
9 |
10 | /**
11 | * Same as console.log.
12 | */
13 | console.info = function() {}
14 |
15 | /**
16 | * Same as assert.ok().
17 | */
18 | console.assert = function() {}
19 |
20 | /**
21 | * Prints to stdout with newline. This function can take multiple arguments
22 | * in a printf()-like way. Example:
23 | */
24 | console.log = function() {}
25 |
26 | /**
27 | * Print a stack trace to stderr of the current position.
28 | */
29 | console.trace = function() {}
30 |
31 | /**
32 | * Same as console.log but prints to stderr.
33 | */
34 | console.error = function() {}
35 |
36 | /**
37 | * Finish timer, record output. Example
38 | * @param label
39 | */
40 | console.timeEnd = function(label) {}
41 |
42 | /**
43 | * Same as console.log but prints to stderr.
44 | */
45 | console.warn = function() {}
46 |
47 | /**
48 | * Mark a time.
49 | * @param label
50 | */
51 | console.time = function(label) {}
52 |
53 | /**
54 | * Uses util.inspect on obj and prints resulting string to stderr.
55 | * @param obj
56 | */
57 | console.dir = function(obj) {}
58 |
59 | exports = console;
60 |
61 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.6/dns.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Use require('dns') to access this module. All methods in the dns module
3 | * use C-Ares except for dns.lookup which uses getaddrinfo(3) in a thread
4 | * pool. C-Ares is much faster than getaddrinfo but the system resolver is
5 | * more constant with how other programs operate. When a user does
6 | * net.connect(80, 'google.com') or http.get({ host: 'google.com' }) the
7 | * dns.lookup method is used. Users who need to do a large number of look
8 | * ups quickly should use the methods that go through C-Ares.
9 | */
10 | var dns = {};
11 |
12 | /**
13 | * Resolves a domain (e.g. 'google.com') into an array of the record types
14 | * specified by rrtype. Valid rrtypes are 'A' (IPV4 addresses, default),
15 | * 'AAAA' (IPV6 addresses), 'MX' (mail exchange records), 'TXT' (text
16 | * records), 'SRV' (SRV records), 'PTR' (used for reverse IP lookups), 'NS'
17 | * (name server records) and 'CNAME' (canonical name records).
18 | * @param domain
19 | * @param rrtype
20 | * @param callback
21 | */
22 | dns.resolve = function(domain, rrtype, callback) {}
23 |
24 | /**
25 | * Reverse resolves an ip address to an array of domain names.
26 | * @param ip
27 | * @param callback
28 | */
29 | dns.reverse = function(ip, callback) {}
30 |
31 | /**
32 | * The same as dns.resolve(), but only for mail exchange queries (MX
33 | * records).
34 | * @param domain
35 | * @param callback
36 | */
37 | dns.resolveMx = function(domain, callback) {}
38 |
39 | /**
40 | * The same as dns.resolve(), but only for text queries (TXT records).
41 | * @param domain
42 | * @param callback
43 | */
44 | dns.resolveTxt = function(domain, callback) {}
45 |
46 | /**
47 | * The same as dns.resolve(), but only for IPv4 queries (A records).
48 | * @param domain
49 | * @param callback
50 | */
51 | dns.resolve4 = function(domain, callback) {}
52 |
53 | /**
54 | * The same as dns.resolve(), but only for service records (SRV records).
55 | * @param domain
56 | * @param callback
57 | */
58 | dns.resolveSrv = function(domain, callback) {}
59 |
60 | /**
61 | * The same as dns.resolve4() except for IPv6 queries (an AAAA query).
62 | * @param domain
63 | * @param callback
64 | */
65 | dns.resolve6 = function(domain, callback) {}
66 |
67 | /**
68 | * Resolves a domain (e.g. 'google.com') into the first found A (IPv4) or
69 | * AAAA (IPv6) record.
70 | * @param domain
71 | * @param family
72 | * @param callback
73 | */
74 | dns.lookup = function(domain, family, callback) {}
75 |
76 | /**
77 | * The same as dns.resolve(), but only for canonical name records (CNAME
78 | * records). addresses is an array of the canonical name records available
79 | * for domain (e.g., ['bar.example.com']).
80 | * @param domain
81 | * @param callback
82 | */
83 | dns.resolveCname = function(domain, callback) {}
84 |
85 | /**
86 | * The same as dns.resolve(), but only for name server records (NS
87 | * records).
88 | * @param domain
89 | * @param callback
90 | */
91 | dns.resolveNs = function(domain, callback) {}
92 |
93 | exports = dns;
94 |
95 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.6/events.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Many objects in Node emit events: a net.Server emits an event each time
3 | * a peer connects to it, a fs.readStream emits an event when the file is
4 | * opened. All objects which emit events are instances of
5 | * events.EventEmitter.
6 | */
7 | var events = {};
8 |
9 | /**
10 | * To access the EventEmitter class, require('events').EventEmitter.
11 | * @constructor
12 | */
13 | events.EventEmitter = function() {}
14 |
15 | /**
16 | * Adds a listener to the end of the listeners array for the specified
17 | * event.
18 | * @param event
19 | * @param listener
20 | */
21 | events.EventEmitter.prototype.addListener = function(event, listener) {}
22 |
23 | /**
24 | * Removes all listeners, or those of the specified event.
25 | * @param event
26 | */
27 | events.EventEmitter.prototype.removeAllListeners = function(event) {}
28 |
29 | /**
30 | * By default EventEmitters will print a warning if more than 10 listeners
31 | * are added for a particular event. This is a useful default which helps
32 | * finding memory leaks.
33 | * @param n
34 | */
35 | events.EventEmitter.prototype.setMaxListeners = function(n) {}
36 |
37 | /**
38 | * Returns an array of listeners for the specified event. This array can be
39 | * manipulated, e.g. to remove listeners.
40 | * @param event
41 | * @returns {Array} an array of listeners for the specified event
42 | */
43 | events.EventEmitter.prototype.listeners = function(event) {}
44 |
45 | /**
46 | * Execute each of the listeners in order with the supplied arguments.
47 | * @param event
48 | * @param arg1
49 | * @param arg2
50 | */
51 | events.EventEmitter.prototype.emit = function(event, arg1, arg2) {}
52 |
53 | /**
54 | * Remove a listener from the listener array for the specified event.
55 | * @param event
56 | * @param listener
57 | */
58 | events.EventEmitter.prototype.removeListener = function(event, listener) {}
59 |
60 | /**
61 | * Adds a one time listener for the event. This listener is invoked only
62 | * the next time the event is fired, after which it is removed.
63 | * @param event
64 | * @param listener
65 | */
66 | events.EventEmitter.prototype.once = function(event, listener) {}
67 |
68 | /**
69 | * Adds a listener to the end of the listeners array for the specified
70 | * event.
71 | * @param event
72 | * @param listener
73 | */
74 | events.EventEmitter.prototype.on = function(event, listener) {}
75 |
76 | /** @__local__ */ events.EventEmitter.__events__ = {};
77 |
78 | /**
79 | * This event is emitted any time someone adds a new listener.
80 | * @param event {String}
81 | * @param listener {Function}
82 | */
83 | events.EventEmitter.__events__.newListener = function(event, listener) {};
84 |
85 | exports = events;
86 |
87 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.6/global_objects.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * In browsers, the top-level scope is the global scope. That means that in
4 | * browsers if you're in the global scope var something will define a
5 | * global variable. In Node this is different. The top-level scope is not
6 | * the global scope; var something inside a Node module will be local to
7 | * that module.
8 | */
9 | var global = {};
10 |
11 | /**
12 | * Used to print to stdout and stderr. See the stdio section.
13 | */
14 | var console = {};
15 |
16 | /**
17 | * The process object. See the process object section.
18 | * @type {process}
19 | */
20 | var process = {};
21 |
22 | /**
23 | * To require modules. See the Modules section.
24 | */
25 | require = function() {}
26 |
27 | /**
28 | * Use the internal require() machinery to look up the location of a
29 | * module, but rather than loading the module, just return the resolved
30 | * filename.
31 | */
32 | require.resolve = function() {}
33 |
34 | /**
35 | * Modules are cached in this object when they are required. By deleting a
36 | * key value from this object, the next require will reload the module.
37 | */
38 | require.cache = 0;
39 |
40 | /**
41 | * The filename of the code being executed. This is the resolved absolute
42 | * path of this code file. For a main program this is not necessarily the
43 | * same filename used in the command line. The value inside a module is the
44 | * path to that module file.
45 | */
46 | var __filename = {};
47 |
48 | /**
49 | * The timer functions are global variables. See the timers section.
50 | */
51 | clearInterval = function() {}
52 |
53 | /**
54 | * A reference to the current module. In particular module.exports is the
55 | * same as the exports object. See src/node.js for more information.
56 | */
57 | var module = {};
58 |
59 | /**
60 | * The timer functions are global variables. See the timers section.
61 | * @param cb
62 | * @param ms
63 | */
64 | setInterval = function(cb, ms) {}
65 |
66 | /**
67 | * The name of the directory that the currently executing script resides
68 | * in.
69 | */
70 | var __dirname = {};
71 |
72 | /**
73 | * Used to handle binary data. See the buffer section.
74 | */
75 | var Buffer = {};
76 |
77 | exports = global_objects;
78 |
79 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.6/https.js:
--------------------------------------------------------------------------------
1 | /**
2 | * HTTPS is the HTTP protocol over TLS/SSL. In Node this is implemented as
3 | * a separate module.
4 | */
5 | var https = {};
6 |
7 | /**
8 | * Returns a new HTTPS web server object. The options is similar to
9 | * tls.createServer(). The requestListener is a function which is
10 | * automatically added to the 'request' event.
11 | * @param options
12 | * @param requestListener
13 | * @returns {https.Server}
14 | */
15 | https.createServer = function(options, requestListener) {}
16 |
17 | /**
18 | * Like http.get() but for HTTPS.
19 | * @param options
20 | * @param callback
21 | * @returns {http.ClientRequest}
22 | */
23 | https.get = function(options, callback) {}
24 |
25 | /**
26 | * Makes a request to a secure web server.
27 | * @param options
28 | * @param callback
29 | * @returns {http.ClientRequest}
30 | */
31 | https.request = function(options, callback) {}
32 |
33 | /**
34 | * Global instance of https.Agent which is used as the default for all
35 | * HTTPS client requests.
36 | * @type {https.Agent}
37 | */
38 | https.globalAgent = 0;
39 |
40 | /**
41 | * An Agent object for HTTPS similar to http.Agent.
42 | * @constructor
43 | */
44 | https.Agent = function() {}
45 | https.Agent.prototype = new http.Agent();
46 |
47 | /**
48 | * This class is a subclass of tls.Server and emits events same as
49 | * http.Server. See http.Server for more information.
50 | * @constructor
51 | */
52 | https.Server = function() {}
53 | https.Server.prototype = new tls.Server();
54 | https.Server.prototype = new http.Server();
55 |
56 | var http = require('http');
57 |
58 | exports = https;
59 |
60 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.6/modules.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Node has a simple module loading system. In Node, files and modules are
3 | * in one-to-one correspondence. As an example, foo.js loads the module
4 | * circle.js in the same directory.
5 | */
6 | var module = {};
7 |
8 | exports = modules;
9 |
10 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.6/os.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides a few basic operating-system related utility functions.
3 | */
4 | var os = {};
5 |
6 | /**
7 | * Returns the system uptime in seconds.
8 | * @returns the system uptime in seconds
9 | */
10 | os.uptime = function() {}
11 |
12 | /**
13 | * Returns the total amount of system memory in bytes.
14 | * @returns the total amount of system memory in bytes
15 | */
16 | os.totalmem = function() {}
17 |
18 | /**
19 | * Returns the hostname of the operating system.
20 | * @returns the hostname of the operating system
21 | */
22 | os.hostname = function() {}
23 |
24 | /**
25 | * Returns an array of objects containing information about each CPU/core
26 | * installed: model, speed (in MHz), and times (an object containing the
27 | * number of CPU ticks spent in: user, nice, sys, idle, and irq).
28 | * @returns {Array} an array of objects containing information about each CPU/core installed: model, speed (in MHz), and times (an object containing the number of CPU ticks spent in: user, nice, sys, idle, and irq)
29 | */
30 | os.cpus = function() {}
31 |
32 | /**
33 | * Returns an array containing the 1, 5, and 15 minute load averages.
34 | * @returns an array containing the 1, 5, and 15 minute load averages
35 | */
36 | os.loadavg = function() {}
37 |
38 | /**
39 | * Returns the operating system release.
40 | * @returns the operating system release
41 | */
42 | os.release = function() {}
43 |
44 | /**
45 | * Returns the operating system name.
46 | * @returns the operating system name
47 | */
48 | os.type = function() {}
49 |
50 | /**
51 | * Returns the amount of free system memory in bytes.
52 | * @returns the amount of free system memory in bytes
53 | */
54 | os.freemem = function() {}
55 |
56 | /**
57 | * Returns the operating system CPU architecture.
58 | * @returns the operating system CPU architecture
59 | */
60 | os.arch = function() {}
61 |
62 | /**
63 | * Get a list of network interfaces:
64 | */
65 | os.networkInterfaces = function() {}
66 |
67 | /**
68 | * Returns the operating system platform.
69 | * @returns the operating system platform
70 | */
71 | os.platform = function() {}
72 |
73 | exports = os;
74 |
75 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.6/path.js:
--------------------------------------------------------------------------------
1 | /**
2 | * This module contains utilities for handling and transforming file paths.
3 | * Almost all these methods perform only string transformations.
4 | */
5 | var path = {};
6 |
7 | /**
8 | * Normalize a string path, taking care of '..' and '.' parts.
9 | * @param p
10 | */
11 | path.normalize = function(p) {}
12 |
13 | /**
14 | * Resolves to to an absolute path.
15 | * @param from
16 | * @param to
17 | */
18 | path.resolve = function(from , to) {}
19 |
20 | /**
21 | * Join all arguments together and normalize the resulting path.
22 | * @param path1
23 | * @param path2
24 | */
25 | path.join = function(path1, path2) {}
26 |
27 | /**
28 | * Test whether or not the given path exists by checking with the file
29 | * system.
30 | * @param p
31 | * @param callback
32 | */
33 | path.exists = function(p, callback) {}
34 |
35 | /**
36 | * Return the last portion of a path. Similar to the Unix basename command.
37 | * @param p
38 | * @param ext
39 | */
40 | path.basename = function(p, ext) {}
41 |
42 | /**
43 | * Return the extension of the path, from the last '.' to end of string in
44 | * the last portion of the path. If there is no '.' in the last portion of
45 | * the path or the first character of it is '.', then it returns an empty
46 | * string. Examples:
47 | * @param p
48 | */
49 | path.extname = function(p) {}
50 |
51 | /**
52 | * Synchronous version of path.exists.
53 | * @param p
54 | */
55 | path.existsSync = function(p) {}
56 |
57 | /**
58 | * Return the directory name of a path. Similar to the Unix dirname
59 | * command.
60 | * @param p
61 | */
62 | path.dirname = function(p) {}
63 |
64 | /**
65 | * Solve the relative path from from to to.
66 | * @param from
67 | * @param to
68 | */
69 | path.relative = function(from, to) {}
70 |
71 | exports = path;
72 |
73 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.6/querystring.js:
--------------------------------------------------------------------------------
1 | /**
2 | * This module provides utilities for dealing with query strings.
3 | */
4 | var querystring = {};
5 |
6 | /**
7 | * Deserialize a query string to an object.
8 | * @param str
9 | * @param sep
10 | * @param eq
11 | */
12 | querystring.parse = function(str, sep, eq) {}
13 |
14 | /**
15 | * Serialize an object to a query string.
16 | * @param obj
17 | * @param sep
18 | * @param eq
19 | */
20 | querystring.stringify = function(obj, sep, eq) {}
21 |
22 | /**
23 | * The unescape function used by querystring.parse, provided so that it
24 | * could be overridden if necessary.
25 | */
26 | querystring.unescape = function() {}
27 |
28 | /**
29 | * The escape function used by querystring.stringify, provided so that it
30 | * could be overridden if necessary.
31 | */
32 | querystring.escape = function() {}
33 |
34 | exports = querystring;
35 |
36 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.6/readline.js:
--------------------------------------------------------------------------------
1 | /**
2 | * To use this module, do require('readline'). Readline allows reading of a
3 | * stream (such as STDIN) on a line-by-line basis.
4 | */
5 | var readline = {};
6 |
7 | /**
8 | * Takes two streams and creates a readline interface. The completer
9 | * function is used for autocompletion. When given a substring, it returns
10 | * [[substr1, substr2, ...], originalsubstring].
11 | * @param input
12 | * @param output
13 | * @param completer
14 | * @returns {readline.Interface}
15 | */
16 | readline.createInterface = function(input, output, completer) {}
17 |
18 | /**
19 | * The class that represents a readline interface with a stdin and stdout
20 | * stream.
21 | * @constructor
22 | */
23 | readline.Interface = function() {}
24 | readline.Interface.prototype = new events.EventEmitter();
25 |
26 | /**
27 | * Sets the prompt, for example when you run node on the command line, you
28 | * see > , which is node's prompt.
29 | * @param prompt
30 | * @param length
31 | */
32 | readline.Interface.prototype.setPrompt = function(prompt, length) {}
33 |
34 | /**
35 | * Readies readline for input from the user, putting the current setPrompt
36 | * options on a new line, giving the user a new spot to write.
37 | */
38 | readline.Interface.prototype.prompt = function() {}
39 |
40 | /**
41 | * Prepends the prompt with query and invokes callback with the user's
42 | * response. Displays the query to the user, and then invokes callback with
43 | * the user's response after it has been typed.
44 | * @param query
45 | * @param callback
46 | */
47 | readline.Interface.prototype.question = function(query, callback) {}
48 |
49 | /**
50 | * Closes tty.
51 | */
52 | readline.Interface.prototype.close = function() {}
53 |
54 | /**
55 | * Pauses tty.
56 | */
57 | readline.Interface.prototype.pause = function() {}
58 |
59 | /**
60 | * Resumes tty.
61 | */
62 | readline.Interface.prototype.resume = function() {}
63 |
64 | /**
65 | * Writes to tty.
66 | */
67 | readline.Interface.prototype.write = function() {}
68 |
69 | /** @__local__ */ readline.Interface.__events__ = {};
70 |
71 | /**
72 | * Emitted whenever the in stream receives a \n, usually received when the
73 | * user hits enter, or return. This is a good hook to listen for user
74 | * input. Example of listening for line:
75 | * @param line {String}
76 | */
77 | readline.Interface.__events__.line = function(line) {};
78 |
79 | /**
80 | * Emitted whenever the in stream receives a ^C or ^D, respectively known
81 | * as SIGINT and EOT. This is a good way to know the user is finished using
82 | * your program. Example of listening for close, and exiting the program
83 | * afterward: Here's an example of how to use all these together to craft a
84 | * tiny command line interface: Take a look at this slightly more
85 | * complicated example, and http-console for a real-life use case.
86 | */
87 | readline.Interface.__events__.close = function() {};
88 |
89 | var events = require('events');
90 |
91 | exports = readline;
92 |
93 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.6/repl.js:
--------------------------------------------------------------------------------
1 | /**
2 | * A Read-Eval-Print-Loop (REPL) is available both as a standalone program
3 | * and easily includable in other programs. REPL provides a way to
4 | * interactively run JavaScript and see the results. It can be used for
5 | * debugging, testing, or just trying things out.
6 | */
7 | var repl = {};
8 |
9 | /**
10 | * Starts a REPL with prompt as the prompt and stream for all I/O. prompt
11 | * is optional and defaults to > . stream is optional and defaults to
12 | * process.stdin. eval is optional too and defaults to async wrapper for
13 | * eval().
14 | * @param prompt
15 | * @param stream
16 | * @param eval
17 | * @param useGlobal
18 | * @param ignoreUndefined
19 | */
20 | repl.start = function(prompt, stream, eval, useGlobal, ignoreUndefined) {}
21 |
22 | exports = repl;
23 |
24 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.6/timers.js:
--------------------------------------------------------------------------------
1 | /**
2 | * All of the timer functions are globals. You do not need to require()
3 | * this module in order to use them.
4 | */
5 | var timers = {};
6 |
7 | /**
8 | * To schedule the repeated execution of callback every delay milliseconds.
9 | * @param callback
10 | * @param delay
11 | * @param arg
12 | */
13 | timers.setInterval = function(callback, delay, arg) {}
14 |
15 | /**
16 | * To schedule execution of a one-time callback after delay milliseconds.
17 | * Returns a timeoutId for possible use with clearTimeout(). Optionally you
18 | * can also pass arguments to the callback.
19 | * @param callback
20 | * @param delay
21 | * @param arg
22 | * @returns a timeoutId for possible use with clearTimeout()
23 | */
24 | timers.setTimeout = function(callback, delay, arg) {}
25 |
26 | /**
27 | * Prevents a timeout from triggering.
28 | * @param timeoutId
29 | */
30 | timers.clearTimeout = function(timeoutId) {}
31 |
32 | /**
33 | * Stops a interval from triggering.
34 | * @param intervalId
35 | */
36 | timers.clearInterval = function(intervalId) {}
37 |
38 | exports = timers;
39 |
40 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.6/tty.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Use require('tty') to access this module.
3 | */
4 | var tty = {};
5 |
6 | /**
7 | * Returns true or false depending on if the fd is associated with a
8 | * terminal.
9 | * @param fd
10 | * @returns true or false depending on if the fd is associated with a terminal
11 | */
12 | tty.isatty = function(fd) {}
13 |
14 | /**
15 | * mode should be true or false. This sets the properties of the current
16 | * process's stdin fd to act either as a raw device or default.
17 | * @param mode
18 | */
19 | tty.setRawMode = function(mode) {}
20 |
21 | exports = tty;
22 |
23 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.6/url.js:
--------------------------------------------------------------------------------
1 | /**
2 | * This module has utilities for URL resolution and parsing.
3 | */
4 | var url = {};
5 |
6 | /**
7 | * Take a URL string, and return an object.
8 | * @param urlStr
9 | * @param parseQueryString
10 | * @param slashesDenoteHost
11 | * @returns {URL}
12 | */
13 | url.parse = function(urlStr, parseQueryString, slashesDenoteHost) {}
14 |
15 | /**
16 | * Take a base URL, and a href URL, and resolve them as a browser would for
17 | * an anchor tag.
18 | * @param from
19 | * @param to
20 | */
21 | url.resolve = function(from, to) {}
22 |
23 | /**
24 | * Take a parsed URL object, and return a formatted URL string.
25 | * @param urlObj
26 | */
27 | url.format = function(urlObj) {}
28 |
29 | /* see http://nodejs.org/docs/v0.6.12/api/url.html#url_url */
30 | function URL() {}
31 | URL.prototype = {
32 | "href": "",
33 | "protocol": "",
34 | "host": "",
35 | "auth": "",
36 | "hostname": "",
37 | "port": "",
38 | "pathname": "",
39 | "search": "",
40 | "path": "",
41 | "query": "",
42 | "hash": "",
43 | };
44 |
45 | exports = url;
46 |
47 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.6/util.js:
--------------------------------------------------------------------------------
1 | /**
2 | * These functions are in the module 'util'. Use require('util') to access
3 | * them.
4 | */
5 | var util = {};
6 |
7 | /**
8 | * A synchronous output function. Will block the process and output string
9 | * immediately to stderr.
10 | * @param string
11 | */
12 | util.debug = function(string) {}
13 |
14 | /**
15 | * Inherit the prototype methods from one constructor into another. The
16 | * prototype of constructor will be set to a new object created from
17 | * superConstructor.
18 | * @param constructor
19 | * @param superConstructor
20 | */
21 | util.inherits = function(constructor, superConstructor) {}
22 |
23 | /**
24 | * Experimental
25 | * @param readableStream
26 | * @param writableStream
27 | * @param callback
28 | */
29 | util.pump = function(readableStream, writableStream, callback) {}
30 |
31 | /**
32 | * Return a string representation of object, which is useful for debugging.
33 | * @param object
34 | * @param showHidden
35 | * @param depth
36 | * @param colors
37 | */
38 | util.inspect = function(object, showHidden, depth, colors) {}
39 |
40 | /**
41 | * Output with timestamp on stdout.
42 | * @param string
43 | */
44 | util.log = function(string) {}
45 |
46 | /**
47 | * Returns a formatted string using the first argument as a printf-like
48 | * format.
49 | * @returns a formatted string using the first argument as a printf-like format
50 | */
51 | util.format = function() {}
52 |
53 | /**
54 | * Returns true if the given "object" is an Array. false otherwise.
55 | * @param object
56 | * @returns true if the given "object" is an Array
57 | */
58 | util.isArray = function(object) {}
59 |
60 | /**
61 | * Returns true if the given "object" is a Date. false otherwise.
62 | * @param object
63 | * @returns true if the given "object" is a Date
64 | */
65 | util.isDate = function(object) {}
66 |
67 | /**
68 | * Returns true if the given "object" is an Error. false otherwise.
69 | * @param object
70 | * @returns true if the given "object" is an Error
71 | */
72 | util.isError = function(object) {}
73 |
74 | /**
75 | * Returns true if the given "object" is a RegExp. false otherwise.
76 | * @param object
77 | * @returns true if the given "object" is a RegExp
78 | */
79 | util.isRegExp = function(object) {}
80 |
81 | exports = util;
82 |
83 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.6/vm.js:
--------------------------------------------------------------------------------
1 | /**
2 | * You can access this module with:
3 | */
4 | var vm = {};
5 |
6 | /**
7 | * createScript compiles code but does not run it. Instead, it returns a
8 | * vm.Script object representing this compiled code. This script can be run
9 | * later many times using methods below. The returned script is not bound
10 | * to any global object. It is bound before each run, just for that run.
11 | * filename is optional, it's only used in stack traces.
12 | * @param code
13 | * @param filename
14 | * @returns {vm.Script}
15 | */
16 | vm.createScript = function(code, filename) {}
17 |
18 | /**
19 | * vm.runInThisContext() compiles code, runs it and returns the result.
20 | * Running code does not have access to local scope. filename is optional,
21 | * it's used only in stack traces.
22 | * @param code
23 | * @param filename
24 | */
25 | vm.runInThisContext = function(code, filename) {}
26 |
27 | /**
28 | * vm.runInNewContext compiles code, then runs it in sandbox and returns
29 | * the result. Running code does not have access to local scope. The object
30 | * sandbox will be used as the global object for code.
31 | * @param code
32 | * @param sandbox
33 | * @param filename
34 | */
35 | vm.runInNewContext = function(code, sandbox, filename) {}
36 |
37 | /**
38 | * A class for running scripts. Returned by vm.createScript.
39 | * @constructor
40 | */
41 | vm.Script = function() {}
42 |
43 | /**
44 | * Similar to vm.runInThisContext but a method of a precompiled Script
45 | * object.
46 | */
47 | vm.Script.prototype.runInThisContext = function() {}
48 |
49 | /**
50 | * Similar to vm.runInNewContext a method of a precompiled Script object.
51 | * @param sandbox
52 | */
53 | vm.Script.prototype.runInNewContext = function(sandbox) {}
54 |
55 | /**
56 | * vm.createContext creates a new context which is suitable for use as the
57 | * 2nd argument of a subsequent call to vm.runInContext. A (V8) context
58 | * comprises a global object together with a set of build-in objects and
59 | * functions. The optional argument initSandbox will be shallow-copied to
60 | * seed the initial contents of the global object used by the context.
61 | * @param initSandbox
62 | */
63 | vm.createContext = function(initSandbox) {}
64 |
65 | /**
66 | * vm.runInContext compiles code, then runs it in context and returns the
67 | * result. A (V8) context comprises a global object, together with a set of
68 | * built-in objects and functions. Running code does not have access to
69 | * local scope and the global object held within context will be used as
70 | * the global object for code.
71 | * @param code
72 | * @param context
73 | * @param filename
74 | */
75 | vm.runInContext = function(code, context, filename) {}
76 |
77 | exports = vm;
78 |
79 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.8/addons.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Addons are dynamically linked shared objects. They can provide glue to C
3 | * and C++ libraries. The API (at the moment) is rather complex, involving
4 | * knowledge of several libraries:
5 | */
6 | var addons = {};
7 |
8 | exports = addons;
9 |
10 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.8/assert.js:
--------------------------------------------------------------------------------
1 | /**
2 | * This module is used for writing unit tests for your applications, you
3 | * can access it with require('assert').
4 | */
5 | var assert = {};
6 |
7 | /**
8 | * Tests shallow, coercive non-equality with the not equal comparison
9 | * operator ( != ).
10 | * @param actual
11 | * @param expected
12 | * @param message
13 | */
14 | assert.notEqual = function(actual, expected, message) {}
15 |
16 | /**
17 | * Expects block not to throw an error, see assert.throws for details.
18 | * @param block
19 | * @param error
20 | * @param message
21 | */
22 | assert.doesNotThrow = function(block, error, message) {}
23 |
24 | /**
25 | * Tests if value is truthy, it is equivalent to assert.equal(true,
26 | * !!value, message);
27 | * @param value
28 | * @param message
29 | */
30 | assert.ok = function(value, message) {}
31 |
32 | /**
33 | * Tests if value is not a false value, throws if it is a true value.
34 | * Useful when testing the first argument, error in callbacks.
35 | * @param value
36 | */
37 | assert.ifError = function(value) {}
38 |
39 | /**
40 | * Tests shallow, coercive equality with the equal comparison operator ( ==
41 | * ).
42 | * @param actual
43 | * @param expected
44 | * @param message
45 | */
46 | assert.equal = function(actual, expected, message) {}
47 |
48 | /**
49 | * Tests for any deep inequality.
50 | * @param actual
51 | * @param expected
52 | * @param message
53 | */
54 | assert.notDeepEqual = function(actual, expected, message) {}
55 |
56 | /**
57 | * Tests strict non-equality, as determined by the strict not equal
58 | * operator ( !== )
59 | * @param actual
60 | * @param expected
61 | * @param message
62 | */
63 | assert.notStrictEqual = function(actual, expected, message) {}
64 |
65 | /**
66 | * Throws an exception that displays the values for actual and expected
67 | * separated by the provided operator.
68 | * @param actual
69 | * @param expected
70 | * @param message
71 | * @param operator
72 | */
73 | assert.fail = function(actual, expected, message, operator) {}
74 |
75 | /**
76 | * Expects block to throw an error. error can be constructor, regexp or
77 | * validation function.
78 | * @param block
79 | * @param error
80 | * @param message
81 | */
82 | assert.throws = function(block, error, message) {}
83 |
84 | /**
85 | * Tests strict equality, as determined by the strict equality operator (
86 | * === )
87 | * @param actual
88 | * @param expected
89 | * @param message
90 | */
91 | assert.strictEqual = function(actual, expected, message) {}
92 |
93 | /**
94 | * Tests for deep equality.
95 | * @param actual
96 | * @param expected
97 | * @param message
98 | */
99 | assert.deepEqual = function(actual, expected, message) {}
100 |
101 | exports = assert;
102 |
103 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.8/console.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * For printing to stdout and stderr. Similar to the console object
4 | * functions provided by most web browsers, here the output is sent to
5 | * stdout or stderr.
6 | * @type {Object}
7 | */
8 | var console = {};
9 |
10 | /**
11 | * Same as console.log.
12 | * @param data
13 | */
14 | console.info = function(data) {}
15 |
16 | /**
17 | * Same as [assert.ok()][] where if the expression evaluates as false throw
18 | * an AssertionError with message.
19 | * @param expression
20 | * @param message
21 | */
22 | console.assert = function(expression, message) {}
23 |
24 | /**
25 | * Prints to stdout with newline. This function can take multiple arguments
26 | * in a printf()-like way. Example:
27 | * @param data
28 | */
29 | console.log = function(data) {}
30 |
31 | /**
32 | * Print a stack trace to stderr of the current position.
33 | * @param label
34 | */
35 | console.trace = function(label) {}
36 |
37 | /**
38 | * Same as console.log but prints to stderr.
39 | * @param data
40 | */
41 | console.error = function(data) {}
42 |
43 | /**
44 | * Finish timer, record output. Example:
45 | * @param label
46 | */
47 | console.timeEnd = function(label) {}
48 |
49 | /**
50 | * Same as console.error.
51 | * @param data
52 | */
53 | console.warn = function(data) {}
54 |
55 | /**
56 | * Mark a time.
57 | * @param label
58 | */
59 | console.time = function(label) {}
60 |
61 | /**
62 | * Uses util.inspect on obj and prints resulting string to stdout.
63 | * @param obj
64 | */
65 | console.dir = function(obj) {}
66 |
67 | exports = console;
68 |
69 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.8/dns.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Use require('dns') to access this module. All methods in the dns module
3 | * use C-Ares except for dns.lookup which uses getaddrinfo(3) in a thread
4 | * pool. C-Ares is much faster than getaddrinfo but the system resolver is
5 | * more constant with how other programs operate. When a user does
6 | * net.connect(80, 'google.com') or http.get({ host: 'google.com' }) the
7 | * dns.lookup method is used. Users who need to do a large number of look
8 | * ups quickly should use the methods that go through C-Ares.
9 | */
10 | var dns = {};
11 |
12 | /**
13 | * Resolves a domain (e.g. 'google.com') into an array of the record types
14 | * specified by rrtype. Valid rrtypes are 'A' (IPV4 addresses, default),
15 | * 'AAAA' (IPV6 addresses), 'MX' (mail exchange records), 'TXT' (text
16 | * records), 'SRV' (SRV records), 'PTR' (used for reverse IP lookups), 'NS'
17 | * (name server records) and 'CNAME' (canonical name records).
18 | * @param domain
19 | * @param rrtype
20 | * @param callback
21 | */
22 | dns.resolve = function(domain, rrtype, callback) {}
23 |
24 | /**
25 | * Reverse resolves an ip address to an array of domain names.
26 | * @param ip
27 | * @param callback
28 | */
29 | dns.reverse = function(ip, callback) {}
30 |
31 | /**
32 | * The same as dns.resolve(), but only for mail exchange queries (MX
33 | * records).
34 | * @param domain
35 | * @param callback
36 | */
37 | dns.resolveMx = function(domain, callback) {}
38 |
39 | /**
40 | * The same as dns.resolve(), but only for text queries (TXT records).
41 | * @param domain
42 | * @param callback
43 | */
44 | dns.resolveTxt = function(domain, callback) {}
45 |
46 | /**
47 | * The same as dns.resolve(), but only for IPv4 queries (A records).
48 | * @param domain
49 | * @param callback
50 | */
51 | dns.resolve4 = function(domain, callback) {}
52 |
53 | /**
54 | * The same as dns.resolve(), but only for service records (SRV records).
55 | * @param domain
56 | * @param callback
57 | */
58 | dns.resolveSrv = function(domain, callback) {}
59 |
60 | /**
61 | * The same as dns.resolve4() except for IPv6 queries (an AAAA query).
62 | * @param domain
63 | * @param callback
64 | */
65 | dns.resolve6 = function(domain, callback) {}
66 |
67 | /**
68 | * Resolves a domain (e.g. 'google.com') into the first found A (IPv4) or
69 | * AAAA (IPv6) record.
70 | * @param domain
71 | * @param family
72 | * @param callback
73 | */
74 | dns.lookup = function(domain, family, callback) {}
75 |
76 | /**
77 | * The same as dns.resolve(), but only for canonical name records (CNAME
78 | * records). addresses is an array of the canonical name records available
79 | * for domain (e.g., ['bar.example.com']).
80 | * @param domain
81 | * @param callback
82 | */
83 | dns.resolveCname = function(domain, callback) {}
84 |
85 | /**
86 | * The same as dns.resolve(), but only for name server records (NS
87 | * records).
88 | * @param domain
89 | * @param callback
90 | */
91 | dns.resolveNs = function(domain, callback) {}
92 |
93 | exports = dns;
94 |
95 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.8/domain.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Domains provide a way to handle multiple different IO operations as a
3 | * single group. If any of the event emitters or callbacks registered to a
4 | * domain emit an error event, or throw an error, then the domain object
5 | * will be notified, rather than losing the context of the error in the
6 | * process.on('uncaughtException') handler, or causing the program to exit
7 | * with an error code.
8 | */
9 | var domain = {};
10 |
11 | /**
12 | * Returns a new Domain object.
13 | * @returns {domain.Domain} a new Domain object
14 | */
15 | domain.create = function() {}
16 |
17 | /**
18 | * The Domain class encapsulates the functionality of routing errors and
19 | * uncaught exceptions to the active Domain object.
20 | * @constructor
21 | */
22 | domain.Domain = function() {}
23 |
24 | /**
25 | * Run the supplied function in the context of the domain, implicitly
26 | * binding all event emitters, timers, and lowlevel requests that are
27 | * created in that context.
28 | * @param fn {Function}
29 | */
30 | domain.Domain.prototype.run = function(fn) {}
31 |
32 | /**
33 | * Explicitly adds an emitter to the domain. If any event handlers called
34 | * by the emitter throw an error, or if the emitter emits an error event,
35 | * it will be routed to the domain's error event, just like with implicit
36 | * binding.
37 | * @param emitter {EventEmitter | Timer}
38 | */
39 | domain.Domain.prototype.add = function(emitter) {}
40 |
41 | /**
42 | * The opposite of domain.add(emitter). Removes domain handling from the
43 | * specified emitter.
44 | * @param emitter {EventEmitter | Timer}
45 | */
46 | domain.Domain.prototype.remove = function(emitter) {}
47 |
48 | /**
49 | * The returned function will be a wrapper around the supplied callback
50 | * function. When the returned function is called, any errors that are
51 | * thrown will be routed to the domain's error event.
52 | * @param cb {Function}
53 | * @returns The bound function
54 | */
55 | domain.Domain.prototype.bind = function(cb) {}
56 |
57 | /**
58 | * This method is almost identical to domain.bind(cb). However, in addition
59 | * to catching thrown errors, it will also intercept Error objects sent as
60 | * the first argument to the function.
61 | * @param cb {Function}
62 | * @returns The intercepted function
63 | */
64 | domain.Domain.prototype.intercept = function(cb) {}
65 |
66 | /**
67 | * The dispose method destroys a domain, and makes a best effort attempt to
68 | * clean up any and all IO that is associated with the domain. Streams are
69 | * aborted, ended, closed, and/or destroyed. Timers are cleared.
70 | */
71 | domain.Domain.prototype.dispose = function() {}
72 |
73 | /**
74 | * An array of timers and event emitters that have been explicitly added to
75 | * the domain.
76 | */
77 | domain.Domain.prototype.members = 0;
78 |
79 | exports = domain;
80 |
81 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.8/events.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Many objects in Node emit events: a net.Server emits an event each time
3 | * a peer connects to it, a fs.readStream emits an event when the file is
4 | * opened. All objects which emit events are instances of
5 | * events.EventEmitter.
6 | */
7 | var events = {};
8 |
9 | /**
10 | * To access the EventEmitter class, require('events').EventEmitter.
11 | * @constructor
12 | */
13 | events.EventEmitter = function() {}
14 |
15 | /**
16 | * Adds a listener to the end of the listeners array for the specified
17 | * event.
18 | * @param event
19 | * @param listener
20 | */
21 | events.EventEmitter.prototype.addListener = function(event, listener) {}
22 |
23 | /**
24 | * Removes all listeners, or those of the specified event.
25 | * @param event
26 | */
27 | events.EventEmitter.prototype.removeAllListeners = function(event) {}
28 |
29 | /**
30 | * By default EventEmitters will print a warning if more than 10 listeners
31 | * are added for a particular event. This is a useful default which helps
32 | * finding memory leaks.
33 | * @param n
34 | */
35 | events.EventEmitter.prototype.setMaxListeners = function(n) {}
36 |
37 | /**
38 | * Returns an array of listeners for the specified event.
39 | * @param event
40 | * @returns {Array} an array of listeners for the specified event
41 | */
42 | events.EventEmitter.prototype.listeners = function(event) {}
43 |
44 | /**
45 | * Execute each of the listeners in order with the supplied arguments.
46 | * @param event
47 | * @param arg1
48 | * @param arg2
49 | */
50 | events.EventEmitter.prototype.emit = function(event, arg1, arg2) {}
51 |
52 | /**
53 | * Remove a listener from the listener array for the specified event.
54 | * @param event
55 | * @param listener
56 | */
57 | events.EventEmitter.prototype.removeListener = function(event, listener) {}
58 |
59 | /**
60 | * Adds a one time listener for the event. This listener is invoked only
61 | * the next time the event is fired, after which it is removed.
62 | * @param event
63 | * @param listener
64 | */
65 | events.EventEmitter.prototype.once = function(event, listener) {}
66 |
67 | /**
68 | * Adds a listener to the end of the listeners array for the specified
69 | * event.
70 | * @param event
71 | * @param listener
72 | */
73 | events.EventEmitter.prototype.on = function(event, listener) {}
74 |
75 | /** @__local__ */ events.EventEmitter.__events__ = {};
76 |
77 | /**
78 | * This event is emitted any time someone adds a new listener.
79 | * @param event {String}
80 | * @param listener {Function}
81 | */
82 | events.EventEmitter.__events__.newListener = function(event, listener) {};
83 |
84 | exports = events;
85 |
86 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.8/global_objects.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * In browsers, the top-level scope is the global scope. That means that in
4 | * browsers if you're in the global scope var something will define a
5 | * global variable. In Node this is different. The top-level scope is not
6 | * the global scope; var something inside a Node module will be local to
7 | * that module.
8 | */
9 | var global = {};
10 |
11 | /**
12 | * Used to print to stdout and stderr. See the [stdio][] section.
13 | */
14 | var console = {};
15 |
16 | /**
17 | * The process object. See the [process object][] section.
18 | * @type {process}
19 | */
20 | var process = {};
21 |
22 | /**
23 | * To require modules. See the [Modules][] section. require isn't actually
24 | * a global but rather local to each module.
25 | */
26 | require = function() {}
27 |
28 | /**
29 | * Use the internal require() machinery to look up the location of a
30 | * module, but rather than loading the module, just return the resolved
31 | * filename.
32 | */
33 | require.resolve = function() {}
34 |
35 | /**
36 | * Modules are cached in this object when they are required. By deleting a
37 | * key value from this object, the next require will reload the module.
38 | */
39 | require.cache = 0;
40 |
41 | /**
42 | * Instruct require on how to handle certain file extensions.
43 | */
44 | require.extensions = 0;
45 |
46 | /**
47 | * The filename of the code being executed. This is the resolved absolute
48 | * path of this code file. For a main program this is not necessarily the
49 | * same filename used in the command line. The value inside a module is the
50 | * path to that module file.
51 | */
52 | var __filename = {};
53 |
54 | /**
55 | * The timer functions are global variables. See the [timers][] section.
56 | */
57 | clearInterval = function() {}
58 |
59 | /**
60 | * A reference to the current module. In particular module.exports is the
61 | * same as the exports object.
62 | */
63 | var module = {};
64 |
65 | /**
66 | * The timer functions are global variables. See the [timers][] section.
67 | * @param cb
68 | * @param ms
69 | */
70 | setInterval = function(cb, ms) {}
71 |
72 | /**
73 | * The name of the directory that the currently executing script resides
74 | * in.
75 | */
76 | var __dirname = {};
77 |
78 | /**
79 | * Used to handle binary data. See the [buffer section][]
80 | */
81 | var Buffer = {};
82 |
83 | exports = global_objects;
84 |
85 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.8/https.js:
--------------------------------------------------------------------------------
1 | /**
2 | * HTTPS is the HTTP protocol over TLS/SSL. In Node this is implemented as
3 | * a separate module.
4 | */
5 | var https = {};
6 |
7 | /**
8 | * Returns a new HTTPS web server object. The options is similar to
9 | * [tls.createServer()][]. The requestListener is a function which is
10 | * automatically added to the 'request' event.
11 | * @param options
12 | * @param requestListener
13 | * @returns {https.Server}
14 | */
15 | https.createServer = function(options, requestListener) {}
16 |
17 | /**
18 | * Like http.get() but for HTTPS.
19 | * @param options
20 | * @param callback
21 | * @returns {http.ClientRequest}
22 | */
23 | https.get = function(options, callback) {}
24 |
25 | /**
26 | * Makes a request to a secure web server. All options from
27 | * [http.request()][] are valid.
28 | * @param options
29 | * @param callback
30 | * @returns {http.ClientRequest}
31 | */
32 | https.request = function(options, callback) {}
33 |
34 | /**
35 | * Global instance of [https.Agent][] for all HTTPS client requests.
36 | * @type {https.Agent}
37 | */
38 | https.globalAgent = 0;
39 |
40 | /**
41 | * An Agent object for HTTPS similar to [http.Agent][]. See
42 | * [https.request()][] for more information.
43 | * @constructor
44 | */
45 | https.Agent = function() {}
46 | https.Agent.prototype = new http.Agent();
47 |
48 | /**
49 | * This class is a subclass of tls.Server and emits events same as
50 | * http.Server. See http.Server for more information.
51 | * @constructor
52 | */
53 | https.Server = function() {}
54 | https.Server.prototype = new tls.Server();
55 | https.Server.prototype = new http.Server();
56 |
57 | var http = require('http');
58 |
59 | exports = https;
60 |
61 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.8/modules.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Node has a simple module loading system. In Node, files and modules are
3 | * in one-to-one correspondence. As an example, foo.js loads the module
4 | * circle.js in the same directory.
5 | */
6 | var module = {};
7 |
8 | exports = modules;
9 |
10 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.8/os.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides a few basic operating-system related utility functions.
3 | */
4 | var os = {};
5 |
6 | /**
7 | * Returns the system uptime in seconds.
8 | * @returns the system uptime in seconds
9 | */
10 | os.uptime = function() {}
11 |
12 | /**
13 | * Returns the total amount of system memory in bytes.
14 | * @returns the total amount of system memory in bytes
15 | */
16 | os.totalmem = function() {}
17 |
18 | /**
19 | * Returns the hostname of the operating system.
20 | * @returns the hostname of the operating system
21 | */
22 | os.hostname = function() {}
23 |
24 | /**
25 | * Returns an array of objects containing information about each CPU/core
26 | * installed: model, speed (in MHz), and times (an object containing the
27 | * number of CPU ticks spent in: user, nice, sys, idle, and irq).
28 | * @returns {Array} an array of objects containing information about each CPU/core installed: model, speed (in MHz), and times (an object containing the number of CPU ticks spent in: user, nice, sys, idle, and irq)
29 | */
30 | os.cpus = function() {}
31 |
32 | /**
33 | * Returns an array containing the 1, 5, and 15 minute load averages.
34 | * @returns an array containing the 1, 5, and 15 minute load averages
35 | */
36 | os.loadavg = function() {}
37 |
38 | /**
39 | * Returns the operating system release.
40 | * @returns the operating system release
41 | */
42 | os.release = function() {}
43 |
44 | /**
45 | * Returns the operating system name.
46 | * @returns the operating system name
47 | */
48 | os.type = function() {}
49 |
50 | /**
51 | * Returns the amount of free system memory in bytes.
52 | * @returns the amount of free system memory in bytes
53 | */
54 | os.freemem = function() {}
55 |
56 | /**
57 | * A constant defining the appropriate End-of-line marker for the operating
58 | * system.
59 | */
60 | os.EOL = 0;
61 |
62 | /**
63 | * Returns the operating system CPU architecture.
64 | * @returns the operating system CPU architecture
65 | */
66 | os.arch = function() {}
67 |
68 | /**
69 | * Get a list of network interfaces:
70 | */
71 | os.networkInterfaces = function() {}
72 |
73 | /**
74 | * Returns the operating system platform.
75 | * @returns the operating system platform
76 | */
77 | os.platform = function() {}
78 |
79 | /**
80 | * Returns the operating system's default directory for temp files.
81 | * @returns the operating system's default directory for temp files
82 | */
83 | os.tmpDir = function() {}
84 |
85 | exports = os;
86 |
87 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.8/path.js:
--------------------------------------------------------------------------------
1 | /**
2 | * This module contains utilities for handling and transforming file paths.
3 | * Almost all these methods perform only string transformations.
4 | */
5 | var path = {};
6 |
7 | /**
8 | * Normalize a string path, taking care of '..' and '.' parts.
9 | * @param p
10 | */
11 | path.normalize = function(p) {}
12 |
13 | /**
14 | * Resolves to to an absolute path.
15 | * @param from
16 | * @param to
17 | */
18 | path.resolve = function(from , to) {}
19 |
20 | /**
21 | * Join all arguments together and normalize the resulting path.
22 | * @param path1
23 | * @param path2
24 | */
25 | path.join = function(path1, path2) {}
26 |
27 | /**
28 | * Return the last portion of a path. Similar to the Unix basename command.
29 | * @param p
30 | * @param ext
31 | */
32 | path.basename = function(p, ext) {}
33 |
34 | /**
35 | * Return the extension of the path, from the last '.' to end of string in
36 | * the last portion of the path. If there is no '.' in the last portion of
37 | * the path or the first character of it is '.', then it returns an empty
38 | * string. Examples:
39 | * @param p
40 | */
41 | path.extname = function(p) {}
42 |
43 | /**
44 | * Return the directory name of a path. Similar to the Unix dirname
45 | * command.
46 | * @param p
47 | */
48 | path.dirname = function(p) {}
49 |
50 | /**
51 | * Solve the relative path from from to to.
52 | * @param from
53 | * @param to
54 | */
55 | path.relative = function(from, to) {}
56 |
57 | /**
58 | * The platform-specific file separator. '\\' or '/'.
59 | */
60 | path.sep = 0;
61 |
62 | exports = path;
63 |
64 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.8/querystring.js:
--------------------------------------------------------------------------------
1 | /**
2 | * This module provides utilities for dealing with query strings.
3 | */
4 | var querystring = {};
5 |
6 | /**
7 | * Deserialize a query string to an object.
8 | * @param str
9 | * @param sep
10 | * @param eq
11 | * @param options
12 | */
13 | querystring.parse = function(str, sep, eq, options) {}
14 |
15 | /**
16 | * Serialize an object to a query string.
17 | * @param obj
18 | * @param sep
19 | * @param eq
20 | */
21 | querystring.stringify = function(obj, sep, eq) {}
22 |
23 | /**
24 | * The unescape function used by querystring.parse, provided so that it
25 | * could be overridden if necessary.
26 | */
27 | querystring.unescape = function() {}
28 |
29 | /**
30 | * The escape function used by querystring.stringify, provided so that it
31 | * could be overridden if necessary.
32 | */
33 | querystring.escape = function() {}
34 |
35 | exports = querystring;
36 |
37 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.8/readline.js:
--------------------------------------------------------------------------------
1 | /**
2 | * To use this module, do require('readline'). Readline allows reading of a
3 | * stream (such as process.stdin) on a line-by-line basis.
4 | */
5 | var readline = {};
6 |
7 | /**
8 | * Creates a readline Interface instance. Accepts an "options" Object that
9 | * takes the following values:
10 | * @param options
11 | * @returns {readline.Interface}
12 | */
13 | readline.createInterface = function(options) {}
14 |
15 | /**
16 | * The class that represents a readline interface with an input and output
17 | * stream.
18 | * @constructor
19 | */
20 | readline.Interface = function() {}
21 | readline.Interface.prototype = new events.EventEmitter();
22 |
23 | /**
24 | * Sets the prompt, for example when you run node on the command line, you
25 | * see > , which is node's prompt.
26 | * @param prompt
27 | * @param length
28 | */
29 | readline.Interface.prototype.setPrompt = function(prompt, length) {}
30 |
31 | /**
32 | * Readies readline for input from the user, putting the current setPrompt
33 | * options on a new line, giving the user a new spot to write. Set
34 | * preserveCursor to true to prevent the cursor placement being reset to 0.
35 | * @param preserveCursor
36 | */
37 | readline.Interface.prototype.prompt = function(preserveCursor) {}
38 |
39 | /**
40 | * Prepends the prompt with query and invokes callback with the user's
41 | * response. Displays the query to the user, and then invokes callback with
42 | * the user's response after it has been typed.
43 | * @param query
44 | * @param callback
45 | */
46 | readline.Interface.prototype.question = function(query, callback) {}
47 |
48 | /**
49 | * Pauses the readline input stream, allowing it to be resumed later if
50 | * needed.
51 | */
52 | readline.Interface.prototype.pause = function() {}
53 |
54 | /**
55 | * Resumes the readline input stream.
56 | */
57 | readline.Interface.prototype.resume = function() {}
58 |
59 | /**
60 | * Closes the Interface instance, relinquishing control on the input and
61 | * output streams. The "close" event will also be emitted.
62 | */
63 | readline.Interface.prototype.close = function() {}
64 |
65 | /**
66 | * Writes data to output stream. key is an object literal to represent a
67 | * key sequence; available if the terminal is a TTY.
68 | * @param data
69 | * @param key
70 | */
71 | readline.Interface.prototype.write = function(data, key) {}
72 |
73 | var events = require('events');
74 |
75 | exports = readline;
76 |
77 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.8/repl.js:
--------------------------------------------------------------------------------
1 | /**
2 | * A Read-Eval-Print-Loop (REPL) is available both as a standalone program
3 | * and easily includable in other programs. The REPL provides a way to
4 | * interactively run JavaScript and see the results. It can be used for
5 | * debugging, testing, or just trying things out.
6 | */
7 | var repl = {};
8 |
9 | /**
10 | * Returns and starts a REPLServer instance. Accepts an "options" Object
11 | * that takes the following values:
12 | * @param options
13 | * @returns and starts a REPLServer instance
14 | */
15 | repl.start = function(options) {}
16 |
17 | exports = repl;
18 |
19 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.8/string_decoder.js:
--------------------------------------------------------------------------------
1 | /**
2 | * To use this module, do require('string_decoder'). StringDecoder decodes
3 | * a buffer to a string. It is a simple interface to buffer.toString() but
4 | * provides additional support for utf8.
5 | */
6 | var string_decoder = {};
7 |
8 | /**
9 | * Accepts a single argument, encoding which defaults to utf8.
10 | * @constructor
11 | */
12 | string_decoder.StringDecoder = function() {}
13 |
14 | /**
15 | * Returns a decoded string.
16 | * @param buffer
17 | * @returns a decoded string
18 | */
19 | string_decoder.StringDecoder.prototype.write = function(buffer) {}
20 |
21 | exports = string_decoder;
22 |
23 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.8/timers.js:
--------------------------------------------------------------------------------
1 | /**
2 | * All of the timer functions are globals. You do not need to require()
3 | * this module in order to use them.
4 | */
5 | var timers = {};
6 |
7 | /**
8 | * To schedule the repeated execution of callback every delay milliseconds.
9 | * @param callback
10 | * @param delay
11 | * @param arg
12 | */
13 | timers.setInterval = function(callback, delay, arg) {}
14 |
15 | /**
16 | * To schedule execution of a one-time callback after delay milliseconds.
17 | * Returns a timeoutId for possible use with clearTimeout(). Optionally you
18 | * can also pass arguments to the callback.
19 | * @param callback
20 | * @param delay
21 | * @param arg
22 | * @returns a timeoutId for possible use with clearTimeout()
23 | */
24 | timers.setTimeout = function(callback, delay, arg) {}
25 |
26 | /**
27 | * Prevents a timeout from triggering.
28 | * @param timeoutId
29 | */
30 | timers.clearTimeout = function(timeoutId) {}
31 |
32 | /**
33 | * Stops a interval from triggering.
34 | * @param intervalId
35 | */
36 | timers.clearInterval = function(intervalId) {}
37 |
38 | exports = timers;
39 |
40 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.8/tty.js:
--------------------------------------------------------------------------------
1 | /**
2 | * The tty module houses the tty.ReadStream and tty.WriteStream classes. In
3 | * most cases, you will not need to use this module directly.
4 | */
5 | var tty = {};
6 |
7 | /**
8 | * Returns true or false depending on if the fd is associated with a
9 | * terminal.
10 | * @param fd
11 | * @returns true or false depending on if the fd is associated with a terminal
12 | */
13 | tty.isatty = function(fd) {}
14 |
15 | /**
16 | * Deprecated. Use tty.ReadStream#setRawMode() (i.e.
17 | * process.stdin.setRawMode()) instead.
18 | * @param mode
19 | */
20 | tty.setRawMode = function(mode) {}
21 |
22 | /**
23 | * A net.Socket subclass that represents the readable portion of a tty. In
24 | * normal circumstances, process.stdin will be the only tty.ReadStream
25 | * instance in any node program (only when isatty(0) is true).
26 | * @constructor
27 | */
28 | tty.ReadStream = function() {}
29 | tty.ReadStream.prototype = new net.Socket();
30 |
31 | /**
32 | * mode should be true or false. This sets the properties of the
33 | * tty.ReadStream to act either as a raw device or default. isRaw will be
34 | * set to the resulting mode.
35 | * @param mode
36 | */
37 | tty.ReadStream.prototype.setRawMode = function(mode) {}
38 |
39 | /**
40 | * A Boolean that is initialized to false. It represents the current "raw"
41 | * state of the tty.ReadStream instance.
42 | * @type {Boolean}
43 | */
44 | tty.ReadStream.prototype.isRaw = 0;
45 |
46 | /**
47 | * A net.Socket subclass that represents the writable portion of a tty. In
48 | * normal circumstances, process.stdout will be the only tty.WriteStream
49 | * instance ever created (and only when isatty(1) is true).
50 | * @constructor
51 | */
52 | tty.WriteStream = function() {}
53 | tty.WriteStream.prototype = new net.Socket();
54 |
55 | /**
56 | * A Number that gives the number of columns the TTY currently has. This
57 | * property gets updated on "resize" events.
58 | * @type {Number}
59 | */
60 | tty.WriteStream.prototype.columns = 0;
61 |
62 | /**
63 | * A Number that gives the number of rows the TTY currently has. This
64 | * property gets updated on "resize" events.
65 | * @type {Number}
66 | */
67 | tty.WriteStream.prototype.rows = 0;
68 |
69 | /** @__local__ */ tty.WriteStream.__events__ = {};
70 |
71 | /**
72 | * Emitted by refreshSize() when either of the columns or rows properties
73 | * has changed.
74 | */
75 | tty.WriteStream.__events__.resize = function() {};
76 |
77 | {} // workaround for bug 94560
78 | net = require('net');
79 |
80 | exports = tty;
81 |
82 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.8/url.js:
--------------------------------------------------------------------------------
1 | /**
2 | * This module has utilities for URL resolution and parsing.
3 | */
4 | var url = {};
5 |
6 | /**
7 | * Take a URL string, and return an object.
8 | * @param urlStr
9 | * @param parseQueryString
10 | * @param slashesDenoteHost
11 | * @returns {URL}
12 | */
13 | url.parse = function(urlStr, parseQueryString, slashesDenoteHost) {}
14 |
15 | /**
16 | * Take a base URL, and a href URL, and resolve them as a browser would for
17 | * an anchor tag.
18 | * @param from
19 | * @param to
20 | */
21 | url.resolve = function(from, to) {}
22 |
23 | /**
24 | * Take a parsed URL object, and return a formatted URL string.
25 | * @param urlObj
26 | */
27 | url.format = function(urlObj) {}
28 |
29 | /* see http://nodejs.org/docs/v0.6.12/api/url.html#url_url */
30 | function URL() {}
31 | URL.prototype = {
32 | "href": "",
33 | "protocol": "",
34 | "host": "",
35 | "auth": "",
36 | "hostname": "",
37 | "port": "",
38 | "pathname": "",
39 | "search": "",
40 | "path": "",
41 | "query": "",
42 | "hash": "",
43 | };
44 |
45 | exports = url;
46 |
47 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.8/util.js:
--------------------------------------------------------------------------------
1 | /**
2 | * These functions are in the module 'util'. Use require('util') to access
3 | * them.
4 | */
5 | var util = {};
6 |
7 | /**
8 | * A synchronous output function. Will block the process and output string
9 | * immediately to stderr.
10 | * @param string
11 | */
12 | util.debug = function(string) {}
13 |
14 | /**
15 | * Inherit the prototype methods from one constructor into another. The
16 | * prototype of constructor will be set to a new object created from
17 | * superConstructor.
18 | * @param constructor
19 | * @param superConstructor
20 | */
21 | util.inherits = function(constructor, superConstructor) {}
22 |
23 | /**
24 | * Experimental
25 | * @param readableStream
26 | * @param writableStream
27 | * @param callback
28 | */
29 | util.pump = function(readableStream, writableStream, callback) {}
30 |
31 | /**
32 | * Return a string representation of object, which is useful for debugging.
33 | * @param object
34 | * @param showHidden
35 | * @param depth
36 | * @param colors
37 | */
38 | util.inspect = function(object, showHidden, depth, colors) {}
39 |
40 | /**
41 | * Output with timestamp on stdout.
42 | * @param string
43 | */
44 | util.log = function(string) {}
45 |
46 | /**
47 | * Same as util.debug() except this will output all arguments immediately
48 | * to stderr.
49 | */
50 | util.error = function() {}
51 |
52 | /**
53 | * Returns a formatted string using the first argument as a printf-like
54 | * format.
55 | * @param format
56 | * @returns a formatted string using the first argument as a printf-like format
57 | */
58 | util.format = function(format) {}
59 |
60 | /**
61 | * Returns true if the given "object" is an Array. false otherwise.
62 | * @param object
63 | * @returns true if the given "object" is an Array
64 | */
65 | util.isArray = function(object) {}
66 |
67 | /**
68 | * Returns true if the given "object" is a Date. false otherwise.
69 | * @param object
70 | * @returns true if the given "object" is a Date
71 | */
72 | util.isDate = function(object) {}
73 |
74 | /**
75 | * Returns true if the given "object" is an Error. false otherwise.
76 | * @param object
77 | * @returns true if the given "object" is an Error
78 | */
79 | util.isError = function(object) {}
80 |
81 | /**
82 | * Returns true if the given "object" is a RegExp. false otherwise.
83 | * @param object
84 | * @returns true if the given "object" is a RegExp
85 | */
86 | util.isRegExp = function(object) {}
87 |
88 | /**
89 | * A synchronous output function. Will block the process, cast each
90 | * argument to a string then output to stdout. Does not place newlines
91 | * after each argument.
92 | */
93 | util.print = function() {}
94 |
95 | /**
96 | * A synchronous output function. Will block the process and output all
97 | * arguments to stdout with newlines after each argument.
98 | */
99 | util.puts = function() {}
100 |
101 | exports = util;
102 |
103 |
--------------------------------------------------------------------------------
/libs/codeintel2/lib_srcs/node.js/0.8/vm.js:
--------------------------------------------------------------------------------
1 | /**
2 | * You can access this module with:
3 | */
4 | var vm = {};
5 |
6 | /**
7 | * createScript compiles code but does not run it. Instead, it returns a
8 | * vm.Script object representing this compiled code. This script can be run
9 | * later many times using methods below. The returned script is not bound
10 | * to any global object. It is bound before each run, just for that run.
11 | * filename is optional, it's only used in stack traces.
12 | * @param code
13 | * @param filename
14 | * @returns {vm.Script}
15 | */
16 | vm.createScript = function(code, filename) {}
17 |
18 | /**
19 | * vm.runInThisContext() compiles code, runs it and returns the result.
20 | * Running code does not have access to local scope. filename is optional,
21 | * it's used only in stack traces.
22 | * @param code
23 | * @param filename
24 | */
25 | vm.runInThisContext = function(code, filename) {}
26 |
27 | /**
28 | * vm.runInNewContext compiles code, then runs it in sandbox and returns
29 | * the result. Running code does not have access to local scope. The object
30 | * sandbox will be used as the global object for code.
31 | * @param code
32 | * @param sandbox
33 | * @param filename
34 | */
35 | vm.runInNewContext = function(code, sandbox, filename) {}
36 |
37 | /**
38 | * A class for running scripts. Returned by vm.createScript.
39 | * @constructor
40 | */
41 | vm.Script = function() {}
42 |
43 | /**
44 | * Similar to vm.runInThisContext but a method of a precompiled Script
45 | * object.
46 | */
47 | vm.Script.prototype.runInThisContext = function() {}
48 |
49 | /**
50 | * Similar to vm.runInNewContext a method of a precompiled Script object.
51 | * @param sandbox
52 | */
53 | vm.Script.prototype.runInNewContext = function(sandbox) {}
54 |
55 | /**
56 | * vm.createContext creates a new context which is suitable for use as the
57 | * 2nd argument of a subsequent call to vm.runInContext. A (V8) context
58 | * comprises a global object together with a set of build-in objects and
59 | * functions. The optional argument initSandbox will be shallow-copied to
60 | * seed the initial contents of the global object used by the context.
61 | * @param initSandbox
62 | */
63 | vm.createContext = function(initSandbox) {}
64 |
65 | /**
66 | * vm.runInContext compiles code, then runs it in context and returns the
67 | * result. A (V8) context comprises a global object, together with a set of
68 | * built-in objects and functions. Running code does not have access to
69 | * local scope and the global object held within context will be used as
70 | * the global object for code.
71 | * @param code
72 | * @param context
73 | * @param filename
74 | */
75 | vm.runInContext = function(code, context, filename) {}
76 |
77 | exports = vm;
78 |
79 |
--------------------------------------------------------------------------------
/libs/codeintel2/oop/__init__.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python2
2 |
3 | """
4 | This module includes the out-of-process support code for codeintel2
5 |
6 | Reference: http://bugs.activestate.com/show_bug.cgi?id=93455
7 | """
8 |
9 | from .driver import Driver
10 |
--------------------------------------------------------------------------------
/libs/codeintel2/pybinary.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # Copyright (c) 2010 ActiveState Software Inc.
3 | # See LICENSE.txt for license details.
4 |
5 | """Python binary file scanner for CodeIntel"""
6 |
7 | import os
8 | import sys
9 | import io as io
10 | import optparse
11 |
12 | from process import ProcessOpen
13 |
14 |
15 | SCAN_PROCESS_TIMEOUT = 2.0
16 |
17 |
18 | class BinaryScanError(Exception):
19 | pass
20 |
21 |
22 | class TimedPopen(ProcessOpen):
23 | def wait(self):
24 | return super(TimedPopen, self).wait(SCAN_PROCESS_TIMEOUT)
25 |
26 |
27 | def safe_scan(path, python):
28 | """
29 | Performs a "safe" out-of-process scan.
30 | It is more safe because if the module being scanned runs amuck,
31 | it will not ruin the main Komodo interpreter.
32 |
33 | "path" - is a path to a binary module
34 | "python" - an absolute path to the interpreter to run the scanner
35 |
36 | Returns a CIX 2.0 string.
37 |
38 | In case of errors raises a BinaryScanError.
39 | """
40 | # indirectly calls "_main" defined below
41 |
42 | # this is needed to avoid picking up a stale .pyc file.
43 | myself = os.path.join(os.path.dirname(os.path.abspath(__file__)),
44 | "pybinary.py")
45 |
46 | proc = TimedPopen(cmd="%s %s %s" % (python, myself, path),
47 | env=dict(PYTHONPATH=os.pathsep.join(sys.path)))
48 |
49 | out, err = proc.communicate()
50 | if err:
51 | raise BinaryScanError(err)
52 |
53 | return out
54 |
55 |
56 | def scan(path):
57 | """
58 | Performs an in-process binary module scan. That means the module is
59 | loaded (imported) into the current Python interpreter.
60 |
61 | "path" - a path to a binary module to scan
62 |
63 | Returns a CIX 2.0 XML string.
64 | """
65 |
66 | from gencix.python import gencixcore as gencix
67 |
68 | name, _ = os.path.splitext(os.path.basename(path))
69 | dir = os.path.dirname(path)
70 |
71 | root = gencix.Element('codeintel', version='2.0', name=name)
72 |
73 | gencix.docmodule(name, root, usefile=True, dir=dir)
74 | gencix.perform_smart_analysis(root)
75 | gencix.prettify(root)
76 |
77 | tree = gencix.ElementTree(root)
78 |
79 | stream = io.StringIO()
80 | try:
81 | stream.write('\n')
82 | tree.write(stream)
83 | return stream.getvalue()
84 | finally:
85 | stream.close()
86 |
87 |
88 | def _main(argv):
89 | parser = optparse.OptionParser(usage="%prog mdoulepath")
90 | (options, args) = parser.parse_args(args=argv)
91 | if len(args) != 1:
92 | parser.error("Incorrect number of args")
93 |
94 | mod_path = os.path.abspath(args[0])
95 | if not os.path.isfile(mod_path):
96 | parser.error("'%s' is not a file" % mod_path)
97 |
98 | cix = scan(mod_path)
99 | #print(cix)
100 |
101 |
102 | if __name__ == '__main__':
103 | _main(sys.argv[1:])
104 |
--------------------------------------------------------------------------------
/libs/codeintel2/pythoncile.py:
--------------------------------------------------------------------------------
1 | import os
2 |
3 | from codeintel2.pythoncile1 import *
4 |
--------------------------------------------------------------------------------
/libs/codeintel2/stdlibs/javascript.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/libs/codeintel2/stdlibs/javascript.zip
--------------------------------------------------------------------------------
/libs/codeintel2/stdlibs/node.js.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/libs/codeintel2/stdlibs/node.js.zip
--------------------------------------------------------------------------------
/libs/codeintel2/stdlibs/perl-5.10.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/libs/codeintel2/stdlibs/perl-5.10.zip
--------------------------------------------------------------------------------
/libs/codeintel2/stdlibs/perl-5.12.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/libs/codeintel2/stdlibs/perl-5.12.zip
--------------------------------------------------------------------------------
/libs/codeintel2/stdlibs/perl-5.14.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/libs/codeintel2/stdlibs/perl-5.14.zip
--------------------------------------------------------------------------------
/libs/codeintel2/stdlibs/perl-5.16.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/libs/codeintel2/stdlibs/perl-5.16.zip
--------------------------------------------------------------------------------
/libs/codeintel2/stdlibs/perl-5.8.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/libs/codeintel2/stdlibs/perl-5.8.zip
--------------------------------------------------------------------------------
/libs/codeintel2/stdlibs/php-4.4.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/libs/codeintel2/stdlibs/php-4.4.zip
--------------------------------------------------------------------------------
/libs/codeintel2/stdlibs/php-5.0.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/libs/codeintel2/stdlibs/php-5.0.zip
--------------------------------------------------------------------------------
/libs/codeintel2/stdlibs/php-5.1.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/libs/codeintel2/stdlibs/php-5.1.zip
--------------------------------------------------------------------------------
/libs/codeintel2/stdlibs/php-5.2.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/libs/codeintel2/stdlibs/php-5.2.zip
--------------------------------------------------------------------------------
/libs/codeintel2/stdlibs/php-5.3.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/libs/codeintel2/stdlibs/php-5.3.zip
--------------------------------------------------------------------------------
/libs/codeintel2/stdlibs/php-5.4.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/libs/codeintel2/stdlibs/php-5.4.zip
--------------------------------------------------------------------------------
/libs/codeintel2/stdlibs/php-5.5.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/libs/codeintel2/stdlibs/php-5.5.zip
--------------------------------------------------------------------------------
/libs/codeintel2/stdlibs/python-2.4.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/libs/codeintel2/stdlibs/python-2.4.zip
--------------------------------------------------------------------------------
/libs/codeintel2/stdlibs/python-2.5.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/libs/codeintel2/stdlibs/python-2.5.zip
--------------------------------------------------------------------------------
/libs/codeintel2/stdlibs/python-2.6.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/libs/codeintel2/stdlibs/python-2.6.zip
--------------------------------------------------------------------------------
/libs/codeintel2/stdlibs/python-2.7.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/libs/codeintel2/stdlibs/python-2.7.zip
--------------------------------------------------------------------------------
/libs/codeintel2/stdlibs/python3-3.1.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/libs/codeintel2/stdlibs/python3-3.1.zip
--------------------------------------------------------------------------------
/libs/codeintel2/stdlibs/python3-3.2.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/libs/codeintel2/stdlibs/python3-3.2.zip
--------------------------------------------------------------------------------
/libs/codeintel2/stdlibs/python3-3.3.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/libs/codeintel2/stdlibs/python3-3.3.zip
--------------------------------------------------------------------------------
/libs/codeintel2/stdlibs/ruby-1.8.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/libs/codeintel2/stdlibs/ruby-1.8.zip
--------------------------------------------------------------------------------
/libs/codeintel2/stdlibs/ruby-1.9.2.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/libs/codeintel2/stdlibs/ruby-1.9.2.zip
--------------------------------------------------------------------------------
/libs/codeintel2/stdlibs/ruby-1.9.3.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/libs/codeintel2/stdlibs/ruby-1.9.3.zip
--------------------------------------------------------------------------------
/libs/elementtree/SgmlopXMLTreeBuilder.py:
--------------------------------------------------------------------------------
1 | #
2 | # ElementTree
3 | # $Id$
4 | #
5 | # A simple XML tree builder, based on the sgmlop library.
6 | #
7 | # Note that this version does not support namespaces. This may be
8 | # changed in future versions.
9 | #
10 | # history:
11 | # 2004-03-28 fl created
12 | #
13 | # Copyright (c) 1999-2004 by Fredrik Lundh. All rights reserved.
14 | #
15 | # fredrik@pythonware.com
16 | # http://www.pythonware.com
17 | #
18 | # --------------------------------------------------------------------
19 | # The ElementTree toolkit is
20 | #
21 | # Copyright (c) 1999-2004 by Fredrik Lundh
22 | #
23 | # By obtaining, using, and/or copying this software and/or its
24 | # associated documentation, you agree that you have read, understood,
25 | # and will comply with the following terms and conditions:
26 | #
27 | # Permission to use, copy, modify, and distribute this software and
28 | # its associated documentation for any purpose and without fee is
29 | # hereby granted, provided that the above copyright notice appears in
30 | # all copies, and that both that copyright notice and this permission
31 | # notice appear in supporting documentation, and that the name of
32 | # Secret Labs AB or the author not be used in advertising or publicity
33 | # pertaining to distribution of the software without specific, written
34 | # prior permission.
35 | #
36 | # SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
37 | # TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
38 | # ABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
39 | # BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
40 | # DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
41 | # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
42 | # ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
43 | # OF THIS SOFTWARE.
44 | # --------------------------------------------------------------------
45 |
46 | ##
47 | # Tools to build element trees from XML, based on the SGMLOP parser.
48 | #
49 | # The current version does not support XML namespaces.
50 | #
51 | # This tree builder requires the sgmlop extension module
52 | # (available from
53 | # http://effbot.org/downloads).
54 | ##
55 |
56 | from . import ElementTree
57 |
58 | ##
59 | # ElementTree builder for XML source data, based on the SGMLOP parser.
60 | #
61 | # @see elementtree.ElementTree
62 |
63 |
64 | class TreeBuilder:
65 |
66 | def __init__(self, html=0):
67 | try:
68 | import sgmlop
69 | except ImportError:
70 | raise RuntimeError("sgmlop parser not available")
71 | self.__builder = ElementTree.TreeBuilder()
72 | if html:
73 | import html.entities
74 | self.entitydefs.update(html.entities.entitydefs)
75 | self.__parser = sgmlop.XMLParser()
76 | self.__parser.register(self)
77 |
78 | ##
79 | # Feeds data to the parser.
80 | #
81 | # @param data Encoded data.
82 |
83 | def feed(self, data):
84 | self.__parser.feed(data)
85 |
86 | ##
87 | # Finishes feeding data to the parser.
88 | #
89 | # @return An element structure.
90 | # @defreturn Element
91 |
92 | def close(self):
93 | self.__parser.close()
94 | self.__parser = None
95 | return self.__builder.close()
96 |
97 | def finish_starttag(self, tag, attrib):
98 | self.__builder.start(tag, attrib)
99 |
100 | def finish_endtag(self, tag):
101 | self.__builder.end(tag)
102 |
103 | def handle_data(self, data):
104 | self.__builder.data(data)
105 |
--------------------------------------------------------------------------------
/libs/elementtree/TidyHTMLTreeBuilder.py:
--------------------------------------------------------------------------------
1 | #
2 | # ElementTree
3 | # $Id$
4 | #
5 |
6 | from elementtidy.TidyHTMLTreeBuilder import *
7 |
--------------------------------------------------------------------------------
/libs/elementtree/__init__.py:
--------------------------------------------------------------------------------
1 | # $Id$
2 | # elementtree package
3 |
4 | # --------------------------------------------------------------------
5 | # The ElementTree toolkit is
6 | #
7 | # Copyright (c) 1999-2004 by Fredrik Lundh
8 | #
9 | # By obtaining, using, and/or copying this software and/or its
10 | # associated documentation, you agree that you have read, understood,
11 | # and will comply with the following terms and conditions:
12 | #
13 | # Permission to use, copy, modify, and distribute this software and
14 | # its associated documentation for any purpose and without fee is
15 | # hereby granted, provided that the above copyright notice appears in
16 | # all copies, and that both that copyright notice and this permission
17 | # notice appear in supporting documentation, and that the name of
18 | # Secret Labs AB or the author not be used in advertising or publicity
19 | # pertaining to distribution of the software without specific, written
20 | # prior permission.
21 | #
22 | # SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
23 | # TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
24 | # ABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
25 | # BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
26 | # DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
27 | # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
28 | # ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
29 | # OF THIS SOFTWARE.
30 | # --------------------------------------------------------------------
31 |
--------------------------------------------------------------------------------
/libs/fixed-rules/PHP/Rules:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | scope
6 | source.php
7 | settings
8 |
9 | cancelCompletion
10 | ^\s*(\}?\s*(else|do|try)|(function)\s*[a-zA-Z_0-9]+)$
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/libs/fixed-rules/PHP/codecomplice.version:
--------------------------------------------------------------------------------
1 | 1
2 |
--------------------------------------------------------------------------------
/libs/fixed-rules/Python/Rules:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | scope
6 | source.python
7 | settings
8 |
9 | cancelCompletion
10 | ^(.*\b(and|or)$)|(\s*(pass|return|and|or|(class|def)\s*[a-zA-Z_0-9]+)$)
11 |
12 |
13 |
--------------------------------------------------------------------------------
/libs/fixed-rules/Python/codecomplice.version:
--------------------------------------------------------------------------------
1 | 1
2 |
--------------------------------------------------------------------------------
/libs/fixed-rules/Python3/Rules:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | scope
6 | source.python
7 | settings
8 |
9 | cancelCompletion
10 | ^(.*\b(and|or)$)|(\s*(pass|return|and|or|(class|def)\s*[a-zA-Z_0-9]+)$)
11 |
12 |
13 |
--------------------------------------------------------------------------------
/libs/fixed-rules/Python3/codecomplice.version:
--------------------------------------------------------------------------------
1 | 1
2 |
--------------------------------------------------------------------------------
/libs/inflector/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 |
3 | .git
4 | .hg
5 | .svn
6 |
7 | *.pyc
8 | *.pyo
9 | *.o
10 | *.so
11 |
--------------------------------------------------------------------------------
/libs/inflector/Rules/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/libs/inflector/Rules/__init__.py
--------------------------------------------------------------------------------
/libs/inflector/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/libs/inflector/__init__.py
--------------------------------------------------------------------------------
/libs/langinfo_go.py:
--------------------------------------------------------------------------------
1 |
2 | """LangInfo definition for "Go" language."""
3 |
4 | from langinfo import LangInfo
5 |
6 | lang = "Go"
7 | import styles
8 | if not lang in styles.StateMap:
9 | map = styles.StateMap['C++'].copy()
10 | styles.addSharedStyles(map)
11 | styles.StateMap[lang] = map
12 |
13 |
14 | class GoLangInfo(LangInfo):
15 | """http://golang.org"""
16 | name = lang
17 | conforms_to_bases = ["Text"]
18 | exts = [".go"]
19 | # From http://golang.org/ref/spec#Keywords
20 | reserved_keywords = set("""
21 | break default func interface select
22 | case defer go map struct
23 | chan else goto package switch
24 | const fallthrough if range type
25 | continue for import return var
26 | """.split())
27 | # From http://golang.org/ref/spec#Predeclared_identifiers
28 | predeclared_identifiers = set("""
29 | bool byte complex64 complex128 error float32 float64
30 | int int8 int16 int32 int64 rune string
31 | uint uint8 uint16 uint32 uint64 uintptr
32 |
33 | true false iota nil""".split())
34 | predeclared_functions = set("""
35 | append cap close complex copy delete imag len
36 | make new panic print println real recover
37 | """.split())
38 | default_encoding = "utf-8"
39 |
--------------------------------------------------------------------------------
/libs/langinfo_komodo.py:
--------------------------------------------------------------------------------
1 | # ***** BEGIN LICENSE BLOCK *****
2 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1
3 | #
4 | # The contents of this file are subject to the Mozilla Public License
5 | # Version 1.1 (the "License"); you may not use this file except in
6 | # compliance with the License. You may obtain a copy of the License at
7 | # http://www.mozilla.org/MPL/
8 | #
9 | # Software distributed under the License is distributed on an "AS IS"
10 | # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
11 | # License for the specific language governing rights and limitations
12 | # under the License.
13 | #
14 | # The Original Code is Komodo code.
15 | #
16 | # The Initial Developer of the Original Code is ActiveState Software Inc.
17 | # Portions created by ActiveState Software Inc are Copyright (C) 2000-2007
18 | # ActiveState Software Inc. All Rights Reserved.
19 | #
20 | # Contributor(s):
21 | # ActiveState Software Inc
22 | #
23 | # Alternatively, the contents of this file may be used under the terms of
24 | # either the GNU General Public License Version 2 or later (the "GPL"), or
25 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
26 | # in which case the provisions of the GPL or the LGPL are applicable instead
27 | # of those above. If you wish to allow use of your version of this file only
28 | # under the terms of either the GPL or the LGPL, and not to allow others to
29 | # use your version of this file under the terms of the MPL, indicate your
30 | # decision by deleting the provisions above and replace them with the notice
31 | # and other provisions required by the GPL or the LGPL. If you do not delete
32 | # the provisions above, a recipient may use your version of this file under
33 | # the terms of any one of the MPL, the GPL or the LGPL.
34 | #
35 | # ***** END LICENSE BLOCK *****
36 |
37 | """LangInfo definitions specific to Komodo."""
38 |
39 | from langinfo import LangInfo
40 |
41 |
42 | class KomodoProjectLangInfo(LangInfo):
43 | name = "Komodo Project"
44 | exts = [".kpf"]
45 | conforms_to_bases = ["XML"]
46 |
47 |
48 | class KomodoColorSchemeLangInfo(LangInfo):
49 | name = "Komodo Color Scheme"
50 | exts = [".ksf"]
51 | conforms_to_bases = ["Python"]
52 |
53 |
54 | class KomodoKeybindingSchemeLangInfo(LangInfo):
55 | name = "Komodo Keybinding Scheme"
56 | exts = [".kkf"]
57 | conforms_to_bases = ["Text"]
58 |
59 |
60 | class UDLLangInfo(LangInfo):
61 | name = "UDL"
62 | komodo_name = "Luddite"
63 | exts = [".udl"]
64 | conforms_to_bases = ["Text"]
65 |
--------------------------------------------------------------------------------
/libs/langinfo_mozilla.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2009 ActiveState Software Inc.
2 | # See the file LICENSE.txt for licensing information.
3 |
4 | """LangInfo definitions for languages coming out of the Mozilla project and
5 | that don't logically fit in the other `langinfo_*.py` files.
6 | """
7 |
8 | import re
9 | from langinfo import LangInfo
10 |
11 |
12 | class StringPropertiesLangInfo(LangInfo):
13 | """A properties file commonly used in the Mozilla project with
14 | `nsIStringBundleService`.
15 |
16 | Note: The Java world also uses ".properties".
17 | http://java.sun.com/docs/books/tutorial/i18n/resbundle/propfile.html
18 | This looks to be the same format. I'm guessing that Mozilla's use
19 | of the extension for string bundles is derived from this.
20 | """
21 | name = "String Properties"
22 | conforms_to_bases = ["Text"]
23 | exts = [".properties"]
24 |
25 |
26 | class ChromeManifestLangInfo(LangInfo):
27 | """A Mozilla chrome manifest file."""
28 | name = "Chrome Manifest"
29 | conforms_to_bases = ["Text"]
30 | # Can't claim ".manifest" extension, because ".manifest" XML files are
31 | # common on Windows for UAC.
32 | filename_patterns = [
33 | "chrome.manifest",
34 | # These for Komodo's benefit:
35 | "chrome.p.manifest", # Suggested usage by 'koext' tool.
36 | "devbuild.manifest", # Komodo: in common usage
37 | ]
38 |
39 |
40 | class XPTLangInfo(LangInfo):
41 | """Mozilla XPCOM Type info file.
42 |
43 | XPT files are the result of compiling .idl files with "xpidl".
44 | http://www.mozilla.org/scriptable/typelib_tools.html
45 | """
46 | name = "XPT"
47 | exts = [".xpt"]
48 |
--------------------------------------------------------------------------------
/libs/langinfo_tiny.py:
--------------------------------------------------------------------------------
1 | # ***** BEGIN LICENSE BLOCK *****
2 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1
3 | #
4 | # The contents of this file are subject to the Mozilla Public License
5 | # Version 1.1 (the "License"); you may not use this file except in
6 | # compliance with the License. You may obtain a copy of the License at
7 | # http://www.mozilla.org/MPL/
8 | #
9 | # Software distributed under the License is distributed on an "AS IS"
10 | # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
11 | # License for the specific language governing rights and limitations
12 | # under the License.
13 | #
14 | # The Original Code is Komodo code.
15 | #
16 | # The Initial Developer of the Original Code is ActiveState Software Inc.
17 | # Portions created by ActiveState Software Inc are Copyright (C) 2000-2007
18 | # ActiveState Software Inc. All Rights Reserved.
19 | #
20 | # Contributor(s):
21 | # ActiveState Software Inc
22 | #
23 | # Alternatively, the contents of this file may be used under the terms of
24 | # either the GNU General Public License Version 2 or later (the "GPL"), or
25 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
26 | # in which case the provisions of the GPL or the LGPL are applicable instead
27 | # of those above. If you wish to allow use of your version of this file only
28 | # under the terms of either the GPL or the LGPL, and not to allow others to
29 | # use your version of this file under the terms of the MPL, indicate your
30 | # decision by deleting the provisions above and replace them with the notice
31 | # and other provisions required by the GPL or the LGPL. If you do not delete
32 | # the provisions above, a recipient may use your version of this file under
33 | # the terms of any one of the MPL, the GPL or the LGPL.
34 | #
35 | # ***** END LICENSE BLOCK *****
36 |
37 | """LangInfo definitions for some "tiny" languages.
38 |
39 | Examples are one-off file types (specific to some software project or something),
40 | specific config files, etc.
41 | """
42 |
43 | from langinfo import LangInfo
44 |
45 |
46 | class ConsignLangInfo(LangInfo):
47 | """.consign files used by the Cons build tool."""
48 | name = "Cons cache"
49 | conforms_to_bases = ["Text"]
50 | filename_patterns = [".consign"]
51 |
--------------------------------------------------------------------------------
/libs/sgmlop.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import struct
3 |
4 | VERSION = sys.version_info[:2]
5 | PLATFORM = sys.platform
6 | ARCH = 'x%d' % (struct.calcsize('P') * 8)
7 |
8 | platform = None
9 |
10 | if VERSION >= (3, 3):
11 | try:
12 | from _local_arch.sgmlop import *
13 | platform = "Local arch"
14 | except ImportError:
15 | if PLATFORM == 'darwin':
16 | from _macosx_universal_py33.sgmlop import *
17 | platform = "MacOS X Universal"
18 | elif PLATFORM.startswith('linux'):
19 | if ARCH == 'x64':
20 | from _linux_libcpp6_x86_64_py33.sgmlop import *
21 | platform = "Linux 64 bits"
22 | elif ARCH == 'x32':
23 | from _linux_libcpp6_x86_py33.sgmlop import *
24 | platform = "Linux 32 bits"
25 | elif PLATFORM.startswith('win'):
26 | if ARCH == 'x64':
27 | from _win64_py33.sgmlop import *
28 | platform = "Windows 64 bits"
29 | elif ARCH == 'x32':
30 | from _win32_py33.sgmlop import *
31 | platform = "Windows 32 bits"
32 | elif VERSION >= (2, 6):
33 | try:
34 | from _local_arch.sgmlop import *
35 | platform = "Local arch"
36 | except ImportError:
37 | if PLATFORM == 'darwin':
38 | from _macosx_universal_py26.sgmlop import *
39 | platform = "MacOS X Universal"
40 | elif PLATFORM.startswith('linux'):
41 | if ARCH == 'x64':
42 | from _linux_libcpp6_x86_64_py26.sgmlop import *
43 | platform = "Linux 64 bits"
44 | elif ARCH == 'x32':
45 | from _linux_libcpp6_x86_py26.sgmlop import *
46 | platform = "Linux 32 bits"
47 | elif PLATFORM.startswith('win'):
48 | if ARCH == 'x64':
49 | from _win64_py26.sgmlop import *
50 | platform = "Windows 64 bits"
51 | elif ARCH == 'x32':
52 | from _win32_py26.sgmlop import *
53 | platform = "Windows 32 bits"
54 |
55 | if not platform:
56 | raise ImportError("Could not find a suitable sgmlop binary for your platform and architecture.")
57 |
--------------------------------------------------------------------------------
/libs/zope/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spectacles/CodeComplice/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/libs/zope/__init__.py
--------------------------------------------------------------------------------
/libs/zope/cachedescriptors/README.txt:
--------------------------------------------------------------------------------
1 | ==================
2 | Cached descriptors
3 | ==================
4 |
5 | Cached descriptors cache their output. They take into account
6 | instance attributes that they depend on, so when the instance
7 | attributes change, the descriptors will change the values they
8 | return.
9 |
10 | Cached descriptors cache their data in _v_ attributes, so they are
11 | also useful for managing the computation of volatile attributes for
12 | persistent objects.
13 |
14 | Persistent descriptors:
15 |
16 | property
17 |
18 | A simple computed property. See property.txt.
19 |
20 | method
21 |
22 | Idempotent method. The return values are cached based on method
23 | arguments and on any instance attributes that the methods are
24 | defined to depend on.
25 |
26 | **Note**, only a cache based on arguments has been implemented so far.
27 |
28 | See method.txt.
29 |
--------------------------------------------------------------------------------
/libs/zope/cachedescriptors/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 |
--------------------------------------------------------------------------------
/libs/zope/cachedescriptors/method.py:
--------------------------------------------------------------------------------
1 | ##############################################################################
2 | # Copyright (c) 2007 Zope Foundation and Contributors.
3 | # All Rights Reserved.
4 | #
5 | # This software is subject to the provisions of the Zope Public License,
6 | # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
7 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
8 | # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
9 | # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
10 | # FOR A PARTICULAR PURPOSE.
11 | ##############################################################################
12 | """Cached Methods
13 | """
14 |
15 | class cachedIn(object):
16 | """Cached method with given cache attribute."""
17 |
18 | def __init__(self, attribute_name, factory=dict):
19 | self.attribute_name = attribute_name
20 | self.factory = factory
21 |
22 | def __call__(self, func):
23 |
24 | def decorated(instance, *args, **kwargs):
25 | cache = self.cache(instance)
26 | key = self._get_cache_key(*args, **kwargs)
27 | try:
28 | v = cache[key]
29 | except KeyError:
30 | v = cache[key] = func(instance, *args, **kwargs)
31 | return v
32 |
33 | decorated.invalidate = self.invalidate
34 | return decorated
35 |
36 | def invalidate(self, instance, *args, **kwargs):
37 | cache = self.cache(instance)
38 | key = self._get_cache_key(*args, **kwargs)
39 | try:
40 | del cache[key]
41 | except KeyError:
42 | pass
43 |
44 | def cache(self, instance):
45 | try:
46 | cache = getattr(instance, self.attribute_name)
47 | except AttributeError:
48 | cache = self.factory()
49 | setattr(instance, self.attribute_name, cache)
50 | return cache
51 |
52 | @staticmethod
53 | def _get_cache_key(*args, **kwargs):
54 | kw = kwargs.items()
55 | key = (args, tuple(sorted(kw)))
56 | return key
57 |
--------------------------------------------------------------------------------
/libs/zope/cachedescriptors/method.txt:
--------------------------------------------------------------------------------
1 | Method Cache
2 | ------------
3 |
4 | cachedIn
5 | ~~~~~~~~
6 |
7 | The `cachedIn` property allows to specify the attribute where to store the
8 | computed value:
9 |
10 | >>> import math
11 | >>> from zope.cachedescriptors import method
12 |
13 | >>> class Point(object):
14 | ...
15 | ... def __init__(self, x, y):
16 | ... self.x, self.y = x, y
17 | ...
18 | ... @method.cachedIn('_cache')
19 | ... def distance(self, x, y):
20 | ... print('computing distance')
21 | ... return math.hypot(self.x - x, self.y - y)
22 | ...
23 | >>> point = Point(1.0, 2.0)
24 |
25 | The value is computed once:
26 |
27 | >>> point.distance(2, 2)
28 | computing distance
29 | 1.0
30 | >>> point.distance(2, 2)
31 | 1.0
32 |
33 |
34 | Using different arguments calculates a new distance:
35 |
36 | >>> point.distance(5, 2)
37 | computing distance
38 | 4.0
39 | >>> point.distance(5, 2)
40 | 4.0
41 |
42 |
43 | The data is stored at the given `_cache` attribute:
44 |
45 | >>> isinstance(point._cache, dict)
46 | True
47 |
48 | >>> sorted(point._cache.items())
49 | [(((2, 2), ()), 1.0), (((5, 2), ()), 4.0)]
50 |
51 |
52 | It is possible to exlicitly invalidate the data:
53 |
54 | >>> point.distance.invalidate(point, 5, 2)
55 | >>> point.distance(5, 2)
56 | computing distance
57 | 4.0
58 |
59 | Invalidating keys which are not in the cache, does not result in an error:
60 |
61 | >>> point.distance.invalidate(point, 47, 11)
62 |
63 |
64 | It is possible to pass in a factory for the cache attribute. Create another
65 | Point class:
66 |
67 |
68 | >>> class MyDict(dict):
69 | ... pass
70 | >>> class Point(object):
71 | ...
72 | ... def __init__(self, x, y):
73 | ... self.x, self.y = x, y
74 | ...
75 | ... @method.cachedIn('_cache', MyDict)
76 | ... def distance(self, x, y):
77 | ... print('computing distance')
78 | ... return math.sqrt((self.x - x)**2 + (self.y - y)**2)
79 | ...
80 | >>> point = Point(1.0, 2.0)
81 | >>> point.distance(2, 2)
82 | computing distance
83 | 1.0
84 |
85 | Now the cache is a MyDict instance:
86 |
87 | >>> isinstance(point._cache, MyDict)
88 | True
89 |
--------------------------------------------------------------------------------
/libs/zope/cachedescriptors/property.py:
--------------------------------------------------------------------------------
1 | ##############################################################################
2 | # Copyright (c) 2003 Zope Foundation and Contributors.
3 | # All Rights Reserved.
4 | #
5 | # This software is subject to the provisions of the Zope Public License,
6 | # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
7 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
8 | # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
9 | # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
10 | # FOR A PARTICULAR PURPOSE.
11 | ##############################################################################
12 | """Cached properties
13 |
14 | See the CachedProperty class.
15 | """
16 |
17 | ncaches = 0
18 |
19 |
20 | class CachedProperty(object):
21 | """Cached Properties.
22 | """
23 |
24 | def __init__(self, func, *names):
25 | global ncaches
26 | ncaches += 1
27 | self.data = (func, names,
28 | "_v_cached_property_key_%s" % ncaches,
29 | "_v_cached_property_value_%s" % ncaches)
30 |
31 | def __get__(self, inst, class_):
32 | if inst is None:
33 | return self
34 |
35 | func, names, key_name, value_name = self.data
36 |
37 | key = names and [getattr(inst, name) for name in names]
38 | value = getattr(inst, value_name, self)
39 |
40 | if value is not self:
41 | # We have a cached value
42 | if key == getattr(inst, key_name, self):
43 | # Cache is still good!
44 | return value
45 |
46 | # We need to compute and cache the value
47 |
48 | value = func(inst)
49 | setattr(inst, key_name, key)
50 | setattr(inst, value_name, value)
51 |
52 | return value
53 |
54 |
55 | class Lazy(object):
56 | """Lazy Attributes.
57 | """
58 |
59 | def __init__(self, func, name=None):
60 | if name is None:
61 | name = func.__name__
62 | self.data = (func, name)
63 |
64 | def __get__(self, inst, class_):
65 | if inst is None:
66 | return self
67 |
68 | func, name = self.data
69 | value = func(inst)
70 | inst.__dict__[name] = value
71 |
72 | return value
73 |
74 |
75 | class readproperty(object):
76 |
77 | def __init__(self, func):
78 | self.func = func
79 |
80 | def __get__(self, inst, class_):
81 | if inst is None:
82 | return self
83 |
84 | func = self.func
85 | return func(inst)
86 |
87 |
88 | class cachedIn(object):
89 | """Cached property with given cache attribute."""
90 |
91 | def __init__(self, attribute_name):
92 | self.attribute_name = attribute_name
93 |
94 | def __call__(self, func):
95 |
96 | def get(instance):
97 | try:
98 | value = getattr(instance, self.attribute_name)
99 | except AttributeError:
100 | value = func(instance)
101 | setattr(instance, self.attribute_name, value)
102 | return value
103 |
104 | return property(get)
105 |
--------------------------------------------------------------------------------
/libs/zope/cachedescriptors/tests.py:
--------------------------------------------------------------------------------
1 | ##############################################################################
2 | #
3 | # Copyright (c) 2004 Zope Foundation and Contributors.
4 | # All Rights Reserved.
5 | #
6 | # This software is subject to the provisions of the Zope Public License,
7 | # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
8 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
9 | # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
10 | # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
11 | # FOR A PARTICULAR PURPOSE.
12 | #
13 | ##############################################################################
14 | """Test hookup
15 | """
16 |
17 | import doctest
18 |
19 |
20 | def test_suite():
21 | return doctest.DocFileSuite(
22 | 'property.txt', 'method.txt',
23 | optionflags=doctest.ELLIPSIS)
24 |
--------------------------------------------------------------------------------
/messages.json:
--------------------------------------------------------------------------------
1 | {
2 | "1.1.0": "messages/1.1.0.txt",
3 | "1.1.1": "messages/1.1.1.txt",
4 | "1.1.2": "messages/1.1.2.txt",
5 | "1.1.3": "messages/1.1.3.txt"
6 | }
--------------------------------------------------------------------------------
/messages/1.1.0.txt:
--------------------------------------------------------------------------------
1 | CodeComplice v1.1.0 Release Notes
2 | =====================================
3 |
4 |
5 | CHANGES/FIXES
6 | -------------
7 | v1.1.0 (2015-02-15):
8 |
9 | + added support for golang. ported from [komodo-go](https://github.com/Komodo/komodo-go)
10 |
11 | + avoid unnecessary trigger evaluation
12 | this will be a appreciable speedup on older systems
--------------------------------------------------------------------------------
/messages/1.1.1.txt:
--------------------------------------------------------------------------------
1 | CodeComplice v1.1.1 Release Notes
2 | =====================================
3 |
4 |
5 | CHANGES/FIXES
6 | -------------
7 | v1.1.1 (2015-02-18):
8 |
9 | + JavaScript: adjust minimal trigger length from 4 to 3 chars.
10 |
11 | + remove extensive JavaScript info logging -> speedup
12 |
13 | + fix doublettes in JavaScript calltips
--------------------------------------------------------------------------------
/messages/1.1.2.txt:
--------------------------------------------------------------------------------
1 | CodeComplice v1.1.2 Release Notes
2 | =====================================
3 |
4 |
5 | CHANGES/FIXES
6 | -------------
7 |
8 | v1.1.2 (2015-03-09):
9 |
10 | + fix Ruby support and Rails catalog
11 |
12 | + improve working with very large buffers (>10000 lines)
13 |
14 | + PHP: fix goto_defn of extended class, if interface is also implemented
15 |
16 | + JS: improve jQuery catalog with Deferred, Promise and jqXHR objects
--------------------------------------------------------------------------------
/messages/1.1.3.txt:
--------------------------------------------------------------------------------
1 | CodeComplice v1.1.3 Release Notes
2 | =====================================
3 |
4 |
5 | CHANGES/FIXES
6 | -------------
7 |
8 | v1.1.3 (2015-03-09):
9 |
10 | + finally tracked down the issue that was responsible for a lot of UI freezing
11 |
--------------------------------------------------------------------------------
/packages.json:
--------------------------------------------------------------------------------
1 | {
2 | "schema_version": "3.0.0",
3 | "packages": [
4 | {
5 | "name": "CodeComplice",
6 | "details": "https://github.com/spectacles/CodeComplice",
7 | "releases": [
8 | {
9 | "sublime_text": "<3000",
10 | "version": "1.1.3",
11 | "url": "https://github.com/spectacles/CodeComplice/archive/v1.1.3+st2.zip",
12 | "date": "2015-03-10 00:00:00"
13 | },
14 | {
15 | "sublime_text": ">=3000",
16 | "version": "1.1.3",
17 | "url": "https://github.com/spectacles/CodeComplice/archive/v1.1.3.zip",
18 | "date": "2015-03-10 00:00:00"
19 | }
20 | ]
21 | }
22 | ]
23 | }
24 |
--------------------------------------------------------------------------------