├── salesforce
├── __init__.py
├── api
│ ├── __init__.py
│ └── partner.py
├── lib
│ ├── __init__.py
│ ├── dateutil
│ │ ├── zoneinfo
│ │ │ ├── zoneinfo-2011d.tar.gz
│ │ │ └── __init__.py
│ │ ├── __init__.py
│ │ └── easter.py
│ ├── diff.py
│ └── panel.py
└── message.py
├── libs
├── cherrypy
│ ├── __init__.py
│ ├── wsgiserver
│ │ ├── __init__.py
│ │ └── ssl_builtin.py
│ └── LICENSE.txt
└── auth.py
├── config
├── templates
│ ├── AuraElement
│ │ ├── Style.css
│ │ ├── Design.design
│ │ ├── Renderer.js
│ │ ├── Helper.js
│ │ ├── Controller.js
│ │ ├── Documentation.auradoc
│ │ └── SVG.svg
│ ├── LwcElement
│ │ ├── Style.css
│ │ ├── Additional.js
│ │ └── SVG.svg
│ ├── Lwc
│ │ ├── lwc.html
│ │ ├── lwc.js
│ │ └── lwc.js-meta.xml
│ ├── ApexPage
│ │ └── Basic.page
│ ├── Aura
│ │ ├── Component.cmp
│ │ ├── Application.app
│ │ ├── Event.evt
│ │ └── Interface.intf
│ ├── ApexClass
│ │ ├── Exception.cls
│ │ ├── Basic.cls
│ │ ├── Controller.cls
│ │ ├── Aura.cls
│ │ ├── Test.cls
│ │ ├── Schedule.cls
│ │ ├── Queueable.cls
│ │ ├── Triggers Implementation.cls
│ │ ├── StandardController Extension.cls
│ │ ├── StandardSetController Extension.cls
│ │ ├── Inbound Email Service.cls
│ │ ├── Apex Rest.cls
│ │ ├── Batch.cls
│ │ └── Triggers Template.cls
│ ├── ApexComponent
│ │ └── Basic.component
│ └── ApexTrigger
│ │ ├── Basic.trigger
│ │ └── Template.trigger
├── settings
│ ├── XML.sublime-settings
│ ├── JavaScript.sublime-settings
│ ├── Java.sublime-settings
│ ├── app.sublime-settings
│ ├── HTML.sublime-settings
│ ├── package.sublime-settings
│ └── Preferences.sublime-settings
├── messages
│ ├── 3.5.4.md
│ ├── 3.4.2.md
│ ├── 3.5.1.md
│ ├── 3.4.4.md
│ ├── 3.4.6.md
│ ├── 3.6.2.md
│ ├── 3.5.5.md
│ ├── 3.6.1.md
│ ├── 3.4.1.md
│ ├── 3.5.8.md
│ ├── 3.5.3.md
│ ├── 3.4.5.md
│ ├── 3.5.9.md
│ ├── 3.4.7.md
│ ├── 3.6.0.md
│ ├── 3.5.0.md
│ ├── 3.5.2.md
│ ├── 3.4.3.md
│ ├── 3.5.6.md
│ ├── 3.5.7.md
│ ├── install.txt
│ └── 3.4.0.md
├── snippets
│ ├── XML
│ │ ├── XML - members.sublime-snippet
│ │ └── XML - types.sublime-snippet
│ ├── Apex
│ │ ├── Bracket - medium bracket.sublime-snippet
│ │ ├── Bracket - small bracket.sublime-snippet
│ │ ├── Collection - map.sublime-snippet
│ │ ├── Collection - set.sublime-snippet
│ │ ├── Collection - list.sublime-snippet
│ │ ├── Loops - for each.sublime-snippet
│ │ ├── Sobject - sobject bracket.sublime-snippet
│ │ ├── Condition Control - if.sublime-snippet
│ │ ├── Debug - debug.sublime-snippet
│ │ ├── Loops - do while.sublime-snippet
│ │ ├── Method - test method.sublime-snippet
│ │ ├── Debug - debug error.sublime-snippet
│ │ ├── Sobject - create new sobject variable.sublime-snippet
│ │ ├── Debug - debug info.sublime-snippet
│ │ ├── Loops - while.sublime-snippet
│ │ ├── Page Variable - get and set in one line.sublime-snippet
│ │ ├── Class Body - exception class body.sublime-snippet
│ │ ├── Collection - list bracket.sublime-snippet
│ │ ├── Bracket - sobject parenthesis.sublime-snippet
│ │ ├── Collection - map bracket.sublime-snippet
│ │ ├── Debug - debug json.sublime-snippet
│ │ ├── Controller - get parameter in vf.sublime-snippet
│ │ ├── Trigger - after delete.sublime-snippet
│ │ ├── Trigger - after insert.sublime-snippet
│ │ ├── Trigger - after update.sublime-snippet
│ │ ├── Trigger - before delete.sublime-snippet
│ │ ├── Trigger - before insert.sublime-snippet
│ │ ├── Trigger - before update.sublime-snippet
│ │ ├── Exception - try catch.sublime-snippet
│ │ ├── Trigger - after undelete.sublime-snippet
│ │ ├── Condition Control - if else.sublime-snippet
│ │ ├── Controller - add page message in vf.sublime-snippet
│ │ ├── DML - transaction control.sublime-snippet
│ │ ├── Class Body - trigger template bind.sublime-snippet
│ │ ├── Exception - try catch finally.sublime-snippet
│ │ ├── Custom Button - Disable Button.sublime-snippet
│ │ ├── Debug - debug collection.sublime-snippet
│ │ ├── Page Variable - get and set in multiply line.sublime-snippet
│ │ ├── Class Body - schedule class body.sublime-snippet
│ │ ├── Class Body - trigger template implment.sublime-snippet
│ │ ├── Class Body - queueable class body.sublime-snippet
│ │ ├── Ajax Apex - ajax apex.sublime-snippet
│ │ ├── Class Body - test class body-sublime-snippet.sublime-snippet
│ │ ├── Trigger - delete sobjects.sublime-snippet
│ │ ├── Trigger - insert sobjects.sublime-snippet
│ │ ├── Trigger - update sobjects.sublime-snippet
│ │ ├── Rest Service - rest service class body.sublime-snippet
│ │ ├── Class Body - class body.sublime-snippet
│ │ ├── Interface - comparable.sublime-snippet
│ │ ├── Salesforce2Salesforce - SF2SF for connection user.sublime-snippet
│ │ ├── ReRender Form in JavaScript.sublime-snippet
│ │ ├── Comments.sublime-snippet
│ │ ├── Class Header - class header.sublime-snippet
│ │ ├── Class Body - batchable class body.sublime-snippet
│ │ ├── HttpRequest - Callout.sublime-snippet
│ │ ├── Debug - schedule test.sublime-snippet
│ │ ├── Ant - package.sublime-snippet
│ │ ├── Class Body - get child roles.sublime-snippet
│ │ ├── Page - select all checkbox.sublime-snippet
│ │ ├── Ant - build properties.sublime-snippet
│ │ ├── Class Body - send csv email.sublime-snippet
│ │ ├── Ant - build.sublime-snippet
│ │ ├── Class Body - trigger template.sublime-snippet
│ │ └── Class Body - roll up summary utility.sublime-snippet
│ ├── LWC
│ │ ├── import.sublime-snippet
│ │ ├── import default.sublime-snippet
│ │ └── targets.sublime-snippet
│ ├── Page
│ │ ├── Page - object label.sublime-snippet
│ │ ├── Page - field label.sublime-snippet
│ │ ├── Page - close window and refresh opener.sublime-snippet
│ │ └── Page - loading action status.sublime-snippet
│ ├── SOQL
│ │ └── SOQL - SELECT Fields FROM Sobject.sublime-snippet
│ └── Console
│ │ ├── Console - open subtab in formula.sublime-snippet
│ │ ├── Console - set subtab title and icon.sublime-snippet
│ │ ├── Console - set primary tab title and icon.sublime-snippet
│ │ ├── Console - open subtab in custom button.sublime-snippet
│ │ └── Console - close tab and refresh primary tab.sublime-snippet
└── mousemap
│ ├── Default (OSX).sublime-mousemap
│ ├── Default (Linux).sublime-mousemap
│ └── Default (Windows).sublime-mousemap
├── requests
├── packages
│ ├── urllib3
│ │ ├── contrib
│ │ │ └── __init__.py
│ │ ├── packages
│ │ │ ├── ssl_match_hostname
│ │ │ │ ├── .gitignore
│ │ │ │ └── __init__.py
│ │ │ └── __init__.py
│ │ ├── util
│ │ │ ├── __init__.py
│ │ │ ├── request.py
│ │ │ ├── response.py
│ │ │ └── connection.py
│ │ ├── filepost.py
│ │ └── __init__.py
│ ├── README.rst
│ ├── chardet
│ │ ├── compat.py
│ │ ├── __init__.py
│ │ ├── constants.py
│ │ ├── euctwprober.py
│ │ ├── euckrprober.py
│ │ ├── gb2312prober.py
│ │ ├── big5prober.py
│ │ ├── cp949prober.py
│ │ ├── charsetprober.py
│ │ ├── mbcsgroupprober.py
│ │ ├── codingstatemachine.py
│ │ ├── chardetect.py
│ │ ├── utf8prober.py
│ │ ├── escprober.py
│ │ ├── sbcsgroupprober.py
│ │ ├── mbcharsetprober.py
│ │ ├── eucjpprober.py
│ │ └── sjisprober.py
│ └── __init__.py
├── certs.py
├── hooks.py
├── compat.py
├── __init__.py
├── exceptions.py
├── structures.py
└── status_codes.py
├── messages.json
├── .gitignore
├── docs
├── staticresource.md
├── dataloader.md
├── issue.md
├── plugin.md
├── document.md
├── tooling.md
├── retrieve.md
├── json2apex.md
├── lwc.md
├── export.md
└── deploy.md
├── MIT-LICENSE
└── bulk.py
/salesforce/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/libs/cherrypy/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/salesforce/api/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/salesforce/api/partner.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/salesforce/lib/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/config/templates/AuraElement/Style.css:
--------------------------------------------------------------------------------
1 | .THIS {}
--------------------------------------------------------------------------------
/requests/packages/urllib3/contrib/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/config/templates/LwcElement/Style.css:
--------------------------------------------------------------------------------
1 | /* sample css file */
--------------------------------------------------------------------------------
/config/templates/Lwc/lwc.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/config/templates/ApexPage/Basic.page:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/requests/packages/urllib3/packages/ssl_match_hostname/.gitignore:
--------------------------------------------------------------------------------
1 | env
2 |
--------------------------------------------------------------------------------
/config/templates/LwcElement/Additional.js:
--------------------------------------------------------------------------------
1 | export class {class_name} {
2 | }
--------------------------------------------------------------------------------
/config/templates/Aura/Component.cmp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/config/templates/ApexClass/Exception.cls:
--------------------------------------------------------------------------------
1 | public class Class_Name__c extends Exception {}
--------------------------------------------------------------------------------
/config/templates/ApexComponent/Basic.component:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/config/templates/Aura/Application.app:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/config/settings/XML.sublime-settings:
--------------------------------------------------------------------------------
1 | {
2 | "extensions": [
3 | "svg"
4 | ]
5 | }
--------------------------------------------------------------------------------
/config/templates/ApexClass/Basic.cls:
--------------------------------------------------------------------------------
1 | public with sharing class Class_Name__c {
2 |
3 | }
--------------------------------------------------------------------------------
/config/templates/AuraElement/Design.design:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/config/templates/AuraElement/Renderer.js:
--------------------------------------------------------------------------------
1 | ({
2 | // Your renderer method overrides go here
3 | })
--------------------------------------------------------------------------------
/config/settings/JavaScript.sublime-settings:
--------------------------------------------------------------------------------
1 | {
2 | "extensions": [
3 | "resource"
4 | ]
5 | }
--------------------------------------------------------------------------------
/config/templates/AuraElement/Helper.js:
--------------------------------------------------------------------------------
1 | ({
2 | helperMethod : function() {
3 |
4 | }
5 | })
--------------------------------------------------------------------------------
/config/templates/Aura/Event.evt:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/config/templates/ApexTrigger/Basic.trigger:
--------------------------------------------------------------------------------
1 | trigger Trigger_Name__c on Sobject_Name__c(before insert) {
2 |
3 | }
--------------------------------------------------------------------------------
/config/settings/Java.sublime-settings:
--------------------------------------------------------------------------------
1 | {
2 | "extensions": [
3 | "cls",
4 | "trigger"
5 | ]
6 | }
--------------------------------------------------------------------------------
/config/messages/3.5.4.md:
--------------------------------------------------------------------------------
1 | Build 3.5.4
2 | -----------
3 | Release Date: 12 Feb 2018
4 |
5 | * Fix issue #172
6 | * Fix issue #173
--------------------------------------------------------------------------------
/config/templates/AuraElement/Controller.js:
--------------------------------------------------------------------------------
1 | ({
2 | myAction : function(component, event, helper) {
3 |
4 | }
5 | })
--------------------------------------------------------------------------------
/config/messages/3.4.2.md:
--------------------------------------------------------------------------------
1 | Build 3.4.2
2 | -----------
3 | Release Date: 23 May 2016
4 |
5 | * Change api version back to 35, fix issue #116
--------------------------------------------------------------------------------
/config/templates/ApexClass/Controller.cls:
--------------------------------------------------------------------------------
1 | public with sharing class Class_Name__c {
2 | public Class_Name__c() {
3 |
4 | }
5 | }
--------------------------------------------------------------------------------
/config/messages/3.5.1.md:
--------------------------------------------------------------------------------
1 | Build 3.5.1
2 | -----------
3 | Release Date: 25 Jan 2018
4 |
5 | * Basic completion support for component controller or helper
--------------------------------------------------------------------------------
/config/templates/ApexClass/Aura.cls:
--------------------------------------------------------------------------------
1 | public class Class_Name__c {
2 | @AuraEnabled
3 | public static void method() {
4 |
5 | }
6 | }
--------------------------------------------------------------------------------
/config/templates/ApexClass/Test.cls:
--------------------------------------------------------------------------------
1 | @isTest
2 | private class Class_Name__c {
3 | static testMethod void testMethod1() {
4 |
5 | }
6 | }
--------------------------------------------------------------------------------
/config/templates/Lwc/lwc.js:
--------------------------------------------------------------------------------
1 | import { LightningElement, track, wire } from 'lwc';
2 |
3 | export default class {class_name__c} extends LightningElement {
4 |
5 | }
--------------------------------------------------------------------------------
/messages.json:
--------------------------------------------------------------------------------
1 | {
2 | "3.6.1": "config/messages/3.6.1.md",
3 | "3.6.2": "config/messages/3.6.2.md",
4 | "install": "config/messages/install.txt"
5 | }
--------------------------------------------------------------------------------
/salesforce/lib/dateutil/zoneinfo/zoneinfo-2011d.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xjsender/haoide/HEAD/salesforce/lib/dateutil/zoneinfo/zoneinfo-2011d.tar.gz
--------------------------------------------------------------------------------
/config/templates/ApexClass/Schedule.cls:
--------------------------------------------------------------------------------
1 | global class Class_Name__c implements Schedulable {
2 | global void execute(SchedulableContext sc) {
3 |
4 | }
5 | }
--------------------------------------------------------------------------------
/requests/packages/urllib3/packages/__init__.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import
2 |
3 | from . import ssl_match_hostname
4 |
5 | __all__ = ('ssl_match_hostname', )
6 |
--------------------------------------------------------------------------------
/config/templates/ApexClass/Queueable.cls:
--------------------------------------------------------------------------------
1 | global class Class_Name__c implements Queueable {
2 |
3 | global void execute(QueueableContext context) {
4 |
5 | }
6 |
7 | }
--------------------------------------------------------------------------------
/config/templates/ApexClass/Triggers Implementation.cls:
--------------------------------------------------------------------------------
1 | public with sharing class Class_Name__c implements Triggers.Handler {
2 | public void handle() {
3 |
4 | }
5 | }
--------------------------------------------------------------------------------
/config/templates/ApexClass/StandardController Extension.cls:
--------------------------------------------------------------------------------
1 | public with sharing class Class_Name__c {
2 | public Class_Name__c(ApexPages.StandardController con) {
3 |
4 | }
5 | }
--------------------------------------------------------------------------------
/config/templates/ApexClass/StandardSetController Extension.cls:
--------------------------------------------------------------------------------
1 | public with sharing class Class_Name__c {
2 | public Class_Name__c(ApexPages.StandardSetController con) {
3 |
4 | }
5 | }
--------------------------------------------------------------------------------
/config/templates/Aura/Interface.intf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/config/messages/3.4.4.md:
--------------------------------------------------------------------------------
1 | Build 3.4.4
2 | -----------
3 | Release Date: 11 June 2016
4 |
5 | * Fix Urgent ``FileNotFoundError`` problem when create new code
6 | * Restart your sublime when new version is installed
--------------------------------------------------------------------------------
/config/templates/ApexTrigger/Template.trigger:
--------------------------------------------------------------------------------
1 | trigger Trigger_Name__c on Sobject_Name__c(before insert) {
2 | new Triggers()
3 | //.bind(Triggers.Evt.beforeinsert, new ())
4 | .manage();
5 | }
--------------------------------------------------------------------------------
/config/messages/3.4.6.md:
--------------------------------------------------------------------------------
1 | Build 3.4.6
2 | -----------
3 | Release Date: 26 Sept 2016
4 |
5 | * Deliver enhancement for issue #132
6 | * Deliver enhancement for issue #134
7 | * Deliver enhancement for issue #140
8 | * Fix issue #138
--------------------------------------------------------------------------------
/config/messages/3.6.2.md:
--------------------------------------------------------------------------------
1 | Build 3.6.2
2 | -----------
3 | Release Date: 30 March 2022
4 |
5 | * Added diff functionality for aura and lwc component, allow developer check conflict before save lightning components
6 | * Miscellaneous bug fixings and refinements
--------------------------------------------------------------------------------
/config/settings/app.sublime-settings:
--------------------------------------------------------------------------------
1 | {
2 | "client_id": "3MVG9Y6d_Btp4xp5NwcRLAU5CtxkJZUfyuMHttjzUzEAPAzvni_bJZc.gk4q9TkuOe10lm8GAgiNdTAhlnvie",
3 | "client_secret": "5630212197149788996",
4 | "redirect_uri": "http://localhost:56889/auth/callback"
5 | }
--------------------------------------------------------------------------------
/config/snippets/XML/XML - members.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 | $1$0
4 | ]]>
5 | mem
6 | text.xml
7 | members pair
8 |
9 |
--------------------------------------------------------------------------------
/config/settings/HTML.sublime-settings:
--------------------------------------------------------------------------------
1 | {
2 | "extensions": [
3 | "page",
4 | "component",
5 | "email",
6 | "auradoc",
7 | "cmp",
8 | "design",
9 | "app",
10 | "intf",
11 | "evt"
12 | ]
13 | }
--------------------------------------------------------------------------------
/config/snippets/Apex/Bracket - medium bracket.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
5 | mb
6 | source.java, source.apex
7 | Bracket(中括号)
8 |
9 |
--------------------------------------------------------------------------------
/config/snippets/LWC/import.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
5 | import
6 | source.js,source.ts
7 | import {} from ''
8 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Bracket - small bracket.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
5 | sp
6 | source.java, source.apex
7 | Parenthesis(小括号)
8 |
9 |
--------------------------------------------------------------------------------
/config/snippets/LWC/import default.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
5 | import default
6 | source.js,source.ts
7 | import from ''
8 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Collection - map.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 | $2 = new Map<$1>();
4 | ]]>
5 | map
6 | source.java, source.apex
7 | Map Variable
8 |
9 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Collection - set.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 | $2 = new Set<$1>();
4 | ]]>
5 | set
6 | source.java, source.apex
7 | Set Variable
8 |
9 |
--------------------------------------------------------------------------------
/config/templates/Lwc/lwc.js-meta.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | {api_version}.0
4 | true
5 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Collection - list.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 | $2 = new List<$1>();
4 | ]]>
5 | list
6 | source.java, source.apex
7 | List Variable
8 |
9 |
--------------------------------------------------------------------------------
/config/templates/AuraElement/Documentation.auradoc:
--------------------------------------------------------------------------------
1 |
2 | Documentation
3 |
4 | Example Description
5 |
6 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Loops - for each.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
7 | fe
8 | source.java, source.apex
9 | For Each
10 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Sobject - sobject bracket.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
5 | sob
6 | source.java, source.apex
7 | Sobject SOQL Bracket
8 |
9 |
10 |
--------------------------------------------------------------------------------
/config/messages/3.5.5.md:
--------------------------------------------------------------------------------
1 | Build 3.5.5
2 | -----------
3 | Release Date: 15 Jul 2019
4 |
5 | * LWC Support, just like Aura development experience
6 | * Enhancement for many features, see more at https://github.com/xjsender/haoide/commits/master?after=62060ab6f07e3aab41807591b5c453c263a3af29+34
7 | * Fix many bugs
--------------------------------------------------------------------------------
/config/messages/3.6.1.md:
--------------------------------------------------------------------------------
1 | Build 3.6.1
2 | -----------
3 | Release Date: 13 January 2021
4 |
5 | * Removed component metadata cache after destructing
6 | * Updated new Apex classes in Salesforce release v50.0
7 | * Updated documentations, added Issue Report Guidance
8 | * Miscellaneous bug fixings and refinements
--------------------------------------------------------------------------------
/config/snippets/Apex/Condition Control - if.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
7 | if
8 | source.java, source.apex
9 | If ()
10 |
11 |
--------------------------------------------------------------------------------
/config/snippets/Page/Page - object label.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
5 | ol
6 | text.html
7 | $ObjectType.sObjectName.Label
8 |
9 |
--------------------------------------------------------------------------------
/config/snippets/SOQL/SOQL - SELECT Fields FROM Sobject.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
5 | se
6 | source.java, source.apex
7 | SELECT * FROM Sobject
8 |
--------------------------------------------------------------------------------
/config/messages/3.4.1.md:
--------------------------------------------------------------------------------
1 | Build 3.4.1
2 | -----------
3 | Release Date: 23 May 2016
4 |
5 | * Fix issue #113
6 | * Fix issue #115
7 | * Fix Bug for conflict checking bug caused by solution for issue #108
8 | * Fix Bug for ``fetch debug log``
9 | * Execute ``fetch_debug_log`` operation after ``run sync test``
--------------------------------------------------------------------------------
/config/snippets/Apex/Debug - debug.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
5 | dbd
6 | source.java, source.apex
7 | Variable Debug
8 |
9 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Loops - do while.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
8 | dw
9 | source.java, source.apex
10 | do {} while
11 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Method - test method.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
7 | tm
8 | source.java, source.apex
9 | Test Method
10 |
--------------------------------------------------------------------------------
/config/messages/3.5.8.md:
--------------------------------------------------------------------------------
1 | Build 3.5.8
2 | -----------
3 | Release Date: 28 Mar 2020
4 |
5 | * Refined Code coverage functionality:
6 | - View code coverage for certain Apex class/trigger file via context menu
7 | - View code coverage from (async) Test Result via context menu
8 | * Miscellaneous bug fix and update
--------------------------------------------------------------------------------
/config/snippets/Apex/Debug - debug error.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
5 | dbe
6 | source.java, source.apex
7 | Variable Debug Error
8 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Sobject - create new sobject variable.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
5 | so
6 | source.java, source.apex
7 | Create Sobject
8 |
9 |
10 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Debug - debug info.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
5 | dbi
6 | source.java, source.apex
7 | Variable Debug Info
8 |
9 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Loops - while.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
7 | wh
8 | source.java, source.apex
9 | While Loop
10 |
11 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Page Variable - get and set in one line.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
5 | gs
6 | source.java, source.apex
7 | public variable { get; set; }
8 |
9 |
--------------------------------------------------------------------------------
/config/messages/3.5.3.md:
--------------------------------------------------------------------------------
1 | Build 3.5.3
2 | -----------
3 | Release Date: 06 Feb 2018
4 |
5 | * Add missing base components from lightning developer guide by script: https://gist.github.com/xjsender/265d237fbeafebabff6c8669f9359fff#file-read-json-from-lightning-compnent-js
6 | * Add $A.localizationService lib
7 | * Fix some minor bugs
--------------------------------------------------------------------------------
/config/snippets/Apex/Class Body - exception class body.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
5 | exc
6 | source.java, source.apex
7 | Exception Class
8 |
9 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Collection - list bracket.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 | $2 = [
4 | $3
5 | ];$0
6 | ]]>
7 | listb
8 | source.java, source.apex
9 | List Bracket Variable
10 |
11 |
--------------------------------------------------------------------------------
/config/snippets/XML/XML - types.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
4 | $2$0
5 | $1
6 |
7 | ]]>
8 | types
9 | text.xml
10 | types pair
11 |
12 |
--------------------------------------------------------------------------------
/salesforce/message.py:
--------------------------------------------------------------------------------
1 | SEPRATE = """
2 | -------------------------------------------------------------------------------
3 | {0}
4 | -------------------------------------------------------------------------------
5 | """
6 |
7 | METADATA_CHECK = "You should click haoide > Metadata Migration > Retrieve sObject And Workflow Firstly"
--------------------------------------------------------------------------------
/config/snippets/Apex/Bracket - sobject parenthesis.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
7 | si
8 | source.java, source.apex
9 | sObject so = new sObject(\n);
10 |
11 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Collection - map bracket.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 | $2 = new Map<$1>([
4 | $3
5 | ]);
6 | ]]>
7 | mapb
8 | source.java, source.apex
9 | Map Bracket Variable
10 |
11 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Debug - debug json.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
5 | dbj
6 | source.java, source.apex
7 | Variable Debug in JSON Format
8 |
--------------------------------------------------------------------------------
/salesforce/lib/dateutil/__init__.py:
--------------------------------------------------------------------------------
1 | """
2 | Copyright (c) 2003-2010 Gustavo Niemeyer
3 |
4 | This module offers extensions to the standard python 2.3+
5 | datetime module.
6 | """
7 | __author__ = "Gustavo Niemeyer "
8 | __license__ = "Simplified BSD"
9 | __version__ = "2.0"
10 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Controller - get parameter in vf.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
5 | gp
6 | source.java, source.apex
7 | Get Visualforce Parameter
8 |
9 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Trigger - after delete.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
7 | ad
8 | source.java, source.apex
9 | After Delete
10 |
11 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Trigger - after insert.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
7 | ai
8 | source.java, source.apex
9 | After Insert
10 |
11 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Trigger - after update.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
7 | au
8 | source.java, source.apex
9 | After Update
10 |
11 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Trigger - before delete.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
7 | bd
8 | source.java, source.apex
9 | Before Delete
10 |
11 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Trigger - before insert.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
7 | bi
8 | source.java, source.apex
9 | Before Insert
10 |
11 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Trigger - before update.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
7 | bu
8 | source.java, source.apex
9 | Before Update
10 |
11 |
--------------------------------------------------------------------------------
/config/snippets/Page/Page - field label.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
5 | fl
6 | text.html
7 | $ObjectType.sObjectName.fields.Field.Label
8 |
9 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Exception - try catch.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
11 | tryc
12 | source.java, source.apex
13 | Try Catch
14 |
15 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Trigger - after undelete.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
7 | aud
8 | source.java, source.apex
9 | After Undelete
10 |
11 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Condition Control - if else.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
10 | ife
11 | source.java, source.apex
12 | If Else
13 |
14 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Controller - add page message in vf.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
5 | pm
6 | source.java, source.apex
7 | Add PageMessages
8 |
9 |
--------------------------------------------------------------------------------
/config/snippets/Apex/DML - transaction control.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
7 | sp
8 | source.java, source.apex
9 | Transaction Process
10 |
11 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Class Body - trigger template bind.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
7 | tb
8 | source.java, source.apex
9 | Trigger Template Bind
10 |
--------------------------------------------------------------------------------
/config/templates/ApexClass/Inbound Email Service.cls:
--------------------------------------------------------------------------------
1 | global class myHandler implements Messaging.InboundEmailHandler {
2 | global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.InboundEnvelope envelope) {
3 | Messaging.InboundEmailResult result = new Messaging.InboundEmailresult();
4 | return result;
5 | }
6 | }
--------------------------------------------------------------------------------
/config/snippets/Apex/Exception - try catch finally.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
14 | tryf
15 | source.java, source.apex
16 | Try Catch Finally
17 |
18 |
--------------------------------------------------------------------------------
/config/messages/3.4.5.md:
--------------------------------------------------------------------------------
1 | Build 3.4.5
2 | -----------
3 | Release Date: 16 June 2016
4 |
5 | * Fix bug: sublime will be closed when view debug log by logId with pressing alt + dblclick left mouse
6 | * Fix issue #126
7 | * Deliver feature #119
8 | * Add a new setting ``force_login_interval`` for controlling login cache refresh interval
9 | * Restart your sublime when new version is installed
--------------------------------------------------------------------------------
/config/snippets/Apex/Custom Button - Disable Button.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
7 | disable button
8 | source.java, source.apex
9 | Disable Custom Button
10 |
11 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Debug - debug collection.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
7 | dbc
8 | source.java, source.apex
9 | Collection Debug in Loop
10 |
11 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Page Variable - get and set in multiply line.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
10 | gsm
11 | source.java, source.apex
12 | public variable {get {} private set;}
13 |
14 |
--------------------------------------------------------------------------------
/config/messages/3.5.9.md:
--------------------------------------------------------------------------------
1 | Build 3.5.9
2 | -----------
3 | Release Date: 29 Mar 2020
4 |
5 | * Implemented Save lwc file to Server
6 | - Now you can save `lwc` HTML markup, JavaScript code, CSS file, SVG resource and additional JS files
7 | to Salesforce separately
8 | * Update documents
9 | - updated documentations on auto completion, debug, lwc and etc.
10 | * Miscellaneous bug fix and refinement
--------------------------------------------------------------------------------
/config/snippets/Apex/Class Body - schedule class body.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
9 | sc
10 | source.java, source.apex
11 | Schedule Class
12 |
13 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Class Body - trigger template implment.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
9 | ti
10 | source.java, source.apex
11 | Trigger Template Implement Class
12 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Class Body - queueable class body.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
11 | que
12 | source.java, source.apex
13 | Queueable Apex
14 |
15 |
--------------------------------------------------------------------------------
/config/messages/3.4.7.md:
--------------------------------------------------------------------------------
1 | Build 3.4.7
2 | -----------
3 | Release Date: 29 July 2017
4 |
5 | * Really and still busy on project delivery work in the past year, will continue in the next days.
6 | * New Fetaure: Combine package.xml in selected folders
7 | * New Feature: Custom Label completion support, which is fetched from ``project/.config/package.json`` by ``Reload Project Cache`` command
8 | * Update Aura completion lib by ``lushang``
9 | * Others
--------------------------------------------------------------------------------
/config/snippets/Apex/Ajax Apex - ajax apex.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 | $0
7 | ]]>
8 | aa
9 | source.java, source.apex
10 | AJAX apex library
11 |
12 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Class Body - test class body-sublime-snippet.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
10 | tc
11 | source.java, source.apex
12 | Test Class
13 |
14 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Trigger - delete sobjects.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
11 | ds
12 | source.java, source.apex
13 | Delete Sobjects
14 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Trigger - insert sobjects.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
11 | is
12 | source.java, source.apex
13 | Insert Sobjects
14 |
15 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Trigger - update sobjects.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
11 | us
12 | source.java, source.apex
13 | Update Sobjects
14 |
15 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Rest Service - rest service class body.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
11 | rc
12 | source.java, source.apex
13 | REST Class
14 |
15 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Class Body - class body.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
7 | class
8 | source.java, source.apex
9 | Class Template
10 |
11 |
--------------------------------------------------------------------------------
/config/templates/ApexClass/Apex Rest.cls:
--------------------------------------------------------------------------------
1 | /**********************************************************************
2 | *
3 | *
4 | * @url: /services/apexrest/rest
5 | * @data:
6 | * {
7 |
8 | }
9 | *************************************************************************/
10 | @RestResource(urlMapping='/rest')
11 | global with sharing class Class_Name__c {
12 | @HttpPost
13 | global static String doPost() {
14 | return null;
15 | }
16 | }
--------------------------------------------------------------------------------
/config/messages/3.6.0.md:
--------------------------------------------------------------------------------
1 | Build 3.6.0
2 | -----------
3 | Release Date: 30 Mar 2020
4 |
5 | * Implemented Save lwc file to Server last one
6 | - Now you can save `lwc` HTML markup, JavaScript code, CSS file, SVG resource and **Additional JS files**
7 | to Salesforce directly by `HaoIDE`
8 | * Update component metadata after Creating Lightning Web Component or `lwc` resource like CSS, SVG, Additional JS files
9 | * Updated related documentations.
10 | * Miscellaneous bug fix and refinement.
--------------------------------------------------------------------------------
/config/snippets/Apex/Interface - comparable.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
15 | ci
16 | source.java, source.apex
17 | Comparable Interface
18 |
19 |
--------------------------------------------------------------------------------
/config/snippets/Console/Console - open subtab in formula.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
6 | sf
7 | source.java, source.apex, text.html
8 | Open Subtab in Formula
9 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Salesforce2Salesforce - SF2SF for connection user.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
6 | sf2sf
7 | source.java, source.apex
8 | Create Debug Log for SF2SF Connection User
9 |
10 |
--------------------------------------------------------------------------------
/config/settings/package.sublime-settings:
--------------------------------------------------------------------------------
1 | {
2 | "name": "haoide",
3 | "version": "3.6.2",
4 | "description": "HaoIDE is a Sublime Text 3 plugin for Salesforce and used for swift development on Force.com",
5 | "author": "Hao Liu @ 2013-2019, Lushang @ 2020-2022",
6 | "email": "mouse.mliu@gmail.com",
7 | "homepage": "https://github.com/xjsender/haoide",
8 | "issue_url": "https://github.com/xjsender/haoide/issues",
9 | "history_url": "https://github.com/xjsender/haoide/blob/master/HISTORY.rst"
10 | }
--------------------------------------------------------------------------------
/config/settings/Preferences.sublime-settings:
--------------------------------------------------------------------------------
1 | {
2 | // Auto completion after these characters
3 | "auto_complete_triggers": [{
4 | "characters": ".=",
5 | "selector": "source.java"
6 | }, {
7 | "characters": ".abcdefghigklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZ",
8 | "selector": "text.xml"
9 | }, {
10 | "characters": ".<: =#\"",
11 | "selector": "text.html - source"
12 | }, {
13 | "selector": "source.js,source.ts",
14 | "characters": "/."
15 | }]
16 | }
--------------------------------------------------------------------------------
/config/snippets/Apex/ReRender Form in JavaScript.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
11 | ]]>
12 | rerender form
13 | source.java, source.apex
14 | ReRender Form in JS
15 |
--------------------------------------------------------------------------------
/config/templates/ApexClass/Batch.cls:
--------------------------------------------------------------------------------
1 | global class Class_Name__c implements Database.Batchable {
2 | public String query;
3 |
4 | global Class_Name__c() {
5 | this.query = query;
6 | }
7 |
8 | global Database.QueryLocator start(Database.BatchableContext bc) {
9 | return Database.getQueryLocator(query);
10 | }
11 |
12 | global void execute(Database.BatchableContext BC, list scope) {
13 |
14 | }
15 |
16 | global void finish(Database.BatchableContext BC) {
17 |
18 | }
19 | }
--------------------------------------------------------------------------------
/config/messages/3.5.0.md:
--------------------------------------------------------------------------------
1 | Build 3.5.0
2 | -----------
3 | Release Date: 21 Jan 2018
4 |
5 | * Add aura component and attribute completion, contributed by @lushang
6 | * Add some missed base component
7 | * Add lightning component implements completion
8 | * Add Queueable Apex Template
9 | * Add SLDS classes completion
10 | * Add some console snippets
11 | * Add sObject completion when attribute support sObjects, such as type for aura:attribute
12 | * Update export format for ``Export Profile`` command
13 | * Fix some bugs, such as, aura app preview, custom label completion, etc.
--------------------------------------------------------------------------------
/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py:
--------------------------------------------------------------------------------
1 | try:
2 | # Python 3.2+
3 | from ssl import CertificateError, match_hostname
4 | except ImportError:
5 | try:
6 | # Backport of the function from a pypi module
7 | from backports.ssl_match_hostname import CertificateError, match_hostname
8 | except ImportError:
9 | # Our vendored copy
10 | from ._implementation import CertificateError, match_hostname
11 |
12 | # Not needed, but documenting what we provide.
13 | __all__ = ('CertificateError', 'match_hostname')
14 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Comments.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
11 | comments
12 | source.java, source.apex
13 | Class Comments Header
14 |
15 |
--------------------------------------------------------------------------------
/config/snippets/LWC/targets.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
4 | lightning__AppPage
5 | lightning__RecordPage
6 | lightning__HomePage
7 | lightning__Inbox
8 | lightningCommunity__Page
9 | lightningCommunity__Default
10 | lightningSnapin__ChatMessage
11 |
12 | ]]>
13 | targets
14 | text.xml
15 | LWC Targets
16 |
17 |
--------------------------------------------------------------------------------
/requests/packages/README.rst:
--------------------------------------------------------------------------------
1 | If you are planning to submit a pull request to requests with any changes in
2 | this library do not go any further. These are independent libraries which we
3 | vendor into requests. Any changes necessary to these libraries must be made in
4 | them and submitted as separate pull requests to those libraries.
5 |
6 | urllib3 pull requests go here: https://github.com/shazow/urllib3
7 |
8 | chardet pull requests go here: https://github.com/chardet/chardet
9 |
10 | See https://github.com/kennethreitz/requests/pull/1812#issuecomment-30854316
11 | for the reasoning behind this.
12 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.py[cod]
2 | *.DS_Store
3 |
4 | # C extensions
5 | *.so
6 |
7 | # Packages
8 | *.egg
9 | *.egg-info
10 | dist
11 | build
12 | eggs
13 | parts
14 | bin
15 | var
16 | sdist
17 | develop-eggs
18 | .installed.cfg
19 | lib64
20 |
21 | # Installer logs
22 | pip-log.txt
23 |
24 | # Unit test / coverage reports
25 | .coverage
26 | .tox
27 | nosetests.xml
28 |
29 | # Translations
30 | *.mo
31 |
32 | # Mr Developer
33 | .mr.developer.cfg
34 | .project
35 | .pydevproject
36 | *.log
37 |
38 | # idea
39 | .idea/*
40 | sublime.py
41 | sublime_plugin.py
42 |
43 | # temp remove
44 | apex_tag.py
45 | aura_tag.py
46 | sp.py
--------------------------------------------------------------------------------
/config/messages/3.5.2.md:
--------------------------------------------------------------------------------
1 | Build 3.5.2
2 | -----------
3 | Release Date: 03 Feb 2018
4 |
5 | * Support oAuth2 Login, check https://github.com/xjsender/haoide#project-configuration for guide
6 | * Add Lightning event methods completion
7 | * Add customlabel and staticresource completions for lightning component
8 | * Add lightning component iconName support
9 | * Add package.zip to file_exclude_patterns
10 | * Add attributes completion after v.
11 | * Update apex lib to v41
12 | * Deliver enhancement for issue #145
13 | * Fix custom label completion bug in Lightning mode
14 | * Fix bug for open_aura_document_reference command
15 | * Fix bug #147omponent
--------------------------------------------------------------------------------
/config/messages/3.4.3.md:
--------------------------------------------------------------------------------
1 | Build 3.4.3
2 | -----------
3 | Release Date: 6 June 2016
4 |
5 | * Hide ``execute query`` command in the context menu, use ``REST TEST Query`` instead
6 | * Rename Snippet ``HttpRequest - Authorization Basic Credentials.sublime-snippet`` to ``HttpRequest - Callout.sublime-snippet``
7 | * Add new snippet named ``Page - loading action status.sublime-snippet``
8 | * Add visibility control for ``Extract To Here`` in the sidebar menu
9 | * Fix bug for custom components completion
10 | * Fix bug for variable type fetching for code completion
11 | * Fix issue #117
12 |
13 | * Restart your sublime when new version is installed
--------------------------------------------------------------------------------
/config/snippets/Apex/Class Header - class header.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
13 | ch
14 | source.java, source.apex
15 | Class Head
16 |
--------------------------------------------------------------------------------
/libs/cherrypy/wsgiserver/__init__.py:
--------------------------------------------------------------------------------
1 | __all__ = ['HTTPRequest', 'HTTPConnection', 'HTTPServer',
2 | 'SizeCheckWrapper', 'KnownLengthRFile', 'ChunkedRFile',
3 | 'MaxSizeExceeded', 'NoSSLError', 'FatalSSLAlert',
4 | 'WorkerThread', 'ThreadPool', 'SSLAdapter',
5 | 'CherryPyWSGIServer',
6 | 'Gateway', 'WSGIGateway', 'WSGIGateway_10', 'WSGIGateway_u0',
7 | 'WSGIPathInfoDispatcher', 'get_ssl_adapter_class']
8 |
9 | import sys
10 | if sys.version_info < (3, 0):
11 | from wsgiserver2 import *
12 | else:
13 | # Le sigh. Boo for backward-incompatible syntax.
14 | exec('from .wsgiserver3 import *')
15 |
--------------------------------------------------------------------------------
/config/snippets/Console/Console - set subtab title and icon.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
4 |
11 | ]]>
12 | sti
13 | source.java, soucre.apex, source.html
14 | Set Subtab Title and Icon
15 |
--------------------------------------------------------------------------------
/config/snippets/Console/Console - set primary tab title and icon.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
4 |
11 | ]]>
12 | pti
13 | source.java, source.apex, text.html
14 | Set Primary Tab Title and Icon
15 |
--------------------------------------------------------------------------------
/config/templates/LwcElement/SVG.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/config/templates/AuraElement/SVG.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/config/snippets/Page/Page - close window and refresh opener.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
19 | closew
20 | source.java, source.apex, text.html
21 | Close window and refresh opener
22 |
23 |
--------------------------------------------------------------------------------
/requests/certs.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding: utf-8 -*-
3 |
4 | """
5 | certs.py
6 | ~~~~~~~~
7 |
8 | This module returns the preferred default CA certificate bundle.
9 |
10 | If you are packaging Requests, e.g., for a Linux distribution or a managed
11 | environment, you can change the definition of where() to return a separately
12 | packaged CA bundle.
13 | """
14 | import os.path
15 |
16 | try:
17 | from certifi import where
18 | except ImportError:
19 | def where():
20 | """Return the preferred certificate bundle."""
21 | # vendored bundle inside Requests
22 | return os.path.join(os.path.dirname(__file__), 'cacert.pem')
23 |
24 | if __name__ == '__main__':
25 | print(where())
26 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Class Body - batchable class body.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 | {
4 | private String query;
5 |
6 | global ${1:BATCHABLE-CLASS-NAME}() {
7 | $0
8 | }
9 |
10 | global Database.QueryLocator start(Database.BatchableContext bc) {
11 |
12 | }
13 |
14 | global void execute(Database.BatchableContext BC, List scope) {
15 |
16 | }
17 |
18 | global void finish(Database.BatchableContext bc) {
19 |
20 | }
21 | }
22 | ]]>
23 | bc
24 | source.java, source.apex
25 | Batchable Class
26 |
27 |
--------------------------------------------------------------------------------
/config/snippets/Apex/HttpRequest - Callout.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
17 | callout
18 | source.java
19 |
20 |
--------------------------------------------------------------------------------
/config/messages/3.5.6.md:
--------------------------------------------------------------------------------
1 | Build 3.5.6
2 | -----------
3 | Release Date: 31 Jul 2019
4 |
5 | * Add component tag attr desc completion when hover on attr
6 | * Add user interface api doc reference toc
7 | * lwc supports label, staticresource, custom object and fields import
8 | * Enhancement for lwc boolean attr completion
9 | * Fix bug for meta file deployment
10 |
11 | Notice:
12 | ------------
13 | We may not continue to upgrade haoide for sublime, in the next months, we will work on migrate haoide from sublime to vscode, we have been working on [haoide-vscode](https://github.com/xjsender/haoide-vscode) for weeks, there already has some basic completions, check [here](https://raw.githubusercontent.com/xjsender/haoide-vscode/master/docs/haoide-vscode.gif) for demo show.
14 |
--------------------------------------------------------------------------------
/config/messages/3.5.7.md:
--------------------------------------------------------------------------------
1 | Build 3.5.7
2 | -----------
3 | Release Date: 26 Mar 2020
4 |
5 | * Refine Creating Lightning Web Component (``lwc``) process
6 | * Add Retrieving, Destructing, Deploying lwc from both sidebar and context menu
7 | * Add Creating CSS style, SVG file for lwc in context menu
8 | * Fix auto completion for aura component bug
9 | * Fix issue #198
10 |
11 | Update
12 | ----------
13 | Currently there are still lots of developers using `haoide` for SFDC development. Since @xjsender has less time on the project, I will continue to maintain this project and [haoide-vscode](https://github.com/xjsender/haoide-vscode) for the community.
14 |
15 | Thanks @xjsender for the years contributions on the project and Salesforce developing community.
16 |
17 | by @lushang
--------------------------------------------------------------------------------
/config/snippets/Console/Console - open subtab in custom button.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
17 | scb
18 | source.java, source.apex, text.html
19 | Open Subtab in Custom Button
20 |
--------------------------------------------------------------------------------
/config/snippets/Page/Page - loading action status.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
7 |
8 |
9 | Loading...
10 |
11 |
12 |
13 |
14 | ]]>
15 | loading
16 | text.html, source.apex, source.java
17 | Loading apex:actionStatus
18 |
19 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Debug - schedule test.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 | {
6 | String.valueOf(dtNext5Seconds.second()),
7 | String.valueOf(dtNext5Seconds.minute()),
8 | String.valueOf(dtNext5Seconds.hour()),
9 | String.valueOf(dtNext5Seconds.day()),
10 | String.valueOf(dtNext5Seconds.month()),
11 | String.valueOf(dtNext5Seconds.year())
12 | });
13 | String jobName = '$1' + Math.rint(Math.random() * 100000000);
14 | System.schedule(jobName, sch, schClass);$0
15 | ]]>
16 | Optional: Set a tabTrigger to define how to trigger the snippet
17 | ts
18 | source.java, source.apex
19 | Test Schedule
20 |
21 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Ant - package.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 | *
7 | ApexClass
8 |
9 |
10 | *
11 | ApexComponent
12 |
13 |
14 | *
15 | ApexPage
16 |
17 |
18 | *
19 | ApexTrigger
20 |
21 |
22 | *
23 | StaticResource
24 |
25 | 27.0
26 |
27 | ]]>
28 | px
29 | source.java, source.apex
30 | package.xml
31 |
--------------------------------------------------------------------------------
/requests/hooks.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | """
4 | requests.hooks
5 | ~~~~~~~~~~~~~~
6 |
7 | This module provides the capabilities for the Requests hooks system.
8 |
9 | Available hooks:
10 |
11 | ``response``:
12 | The response generated from a Request.
13 |
14 | """
15 | HOOKS = ['response']
16 |
17 | def default_hooks():
18 | return dict((event, []) for event in HOOKS)
19 |
20 | # TODO: response is the only one
21 |
22 |
23 | def dispatch_hook(key, hooks, hook_data, **kwargs):
24 | """Dispatches a hook dictionary on a given piece of data."""
25 | hooks = hooks or dict()
26 | hooks = hooks.get(key)
27 | if hooks:
28 | if hasattr(hooks, '__call__'):
29 | hooks = [hooks]
30 | for hook in hooks:
31 | _hook_data = hook(hook_data, **kwargs)
32 | if _hook_data is not None:
33 | hook_data = _hook_data
34 | return hook_data
35 |
--------------------------------------------------------------------------------
/docs/staticresource.md:
--------------------------------------------------------------------------------
1 | # Update Static Resource Step by Step
2 | With this feature, you can directly edit static zip resource, there are several steps to do it,
3 |
4 | * Choose the static zip resource that you need to update in the ```staticresources``` folder
5 |
6 | * Click ``HaoIDE`` > ``Extract To Here`` in the **Sidebar Menu** to extract it to ``sub folder`` of ``staticresources``, which name is same with the static resource.
7 | - ``Extract To Here`` command can extract all kinds of zip resource, no matter what extension of the file.
8 | - If file is not zip resource, error message will be shown in the output panel
9 |
10 | * After you made change on the file in the sub folder, choose the name of ``sub folder`` and click ``HaoIDE`` > ``Update StaticResource`` in the sidebar menu to save it to server.
11 |
12 | * [UpdateStaticResource Demo](https://raw.githubusercontent.com/xjsender/SublimeApexScreenshot/master/UpdateStaticResource.gif)
--------------------------------------------------------------------------------
/config/snippets/Apex/Class Body - get child roles.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 | childRoles = new List();
5 |
6 | public List getChildRoles(UserRole role) {
7 | populateChildRoles(new List{role});
8 | return childRoles;
9 | }
10 |
11 | private void populateChildRoles(List roles) {
12 | List childs = [
13 | SELECT Id, Name, ParentRoleId
14 | FROM UserRole
15 | WHERE ParentRoleId IN :roles
16 | ];
17 |
18 | childRoles.addAll(childs);
19 | if (childs.size() > 0) {
20 | populateChildRoles(childs);
21 | }
22 | }
23 | }
24 | ]]>
25 | childRoles
26 | source.java, source.apex
27 | Get All Child Roles By Specified Role
28 |
--------------------------------------------------------------------------------
/config/mousemap/Default (OSX).sublime-mousemap:
--------------------------------------------------------------------------------
1 | [
2 | // Button 1 is the left mouse
3 | // Press shift and Click Button 1 for twice will open class file in the foreground
4 | {
5 | "button": "button1", "count": 2, "modifiers": ["shift"],
6 | "press_command": "context_goto_definition"
7 | },
8 |
9 | // Press shift and Click Button 1 will retrieve debug log detail by id
10 | {
11 | "button": "button1", "count": 1, "modifiers": ["alt"],
12 | "press_command": "view_debug_log_detail"
13 | },
14 |
15 | // Press alt and Click Button 1 for twice will quick view the code coverage
16 | {
17 | "button": "button1", "count": 2, "modifiers": ["alt"],
18 | "press_command": "view_selected_code_coverage"
19 | },
20 |
21 | // Press alt and Click Button 1 for triple will cancel deployment of specified task Id
22 | {
23 | "button": "button1", "count": 3, "modifiers": ["alt"],
24 | "press_command": "cancel_deployment"
25 | }
26 | ]
--------------------------------------------------------------------------------
/config/mousemap/Default (Linux).sublime-mousemap:
--------------------------------------------------------------------------------
1 | [
2 | // Button 1 is the left mouse
3 | // Press shift and Click Button 1 for twice will open class file in the foreground
4 | {
5 | "button": "button1", "count": 2, "modifiers": ["shift"],
6 | "press_command": "context_goto_definition"
7 | },
8 |
9 | // Press shift and Click Button 1 will retrieve debug log detail by id
10 | {
11 | "button": "button1", "count": 1, "modifiers": ["alt"],
12 | "press_command": "view_debug_log_detail"
13 | },
14 |
15 | // Press alt and Click Button 1 for twice will quick view the code coverage
16 | {
17 | "button": "button1", "count": 2, "modifiers": ["alt"],
18 | "press_command": "view_selected_code_coverage"
19 | },
20 |
21 | // Press alt and Click Button 1 for triple will cancel deployment of specified task Id
22 | {
23 | "button": "button1", "count": 3, "modifiers": ["alt"],
24 | "press_command": "cancel_deployment"
25 | }
26 | ]
--------------------------------------------------------------------------------
/config/mousemap/Default (Windows).sublime-mousemap:
--------------------------------------------------------------------------------
1 | [
2 | // Button 1 is the left mouse
3 | // Press shift and Click Button 1 for twice will open class file in the foreground
4 | {
5 | "button": "button1", "count": 2, "modifiers": ["shift"],
6 | "press_command": "context_goto_definition"
7 | },
8 |
9 | // Press shift and Click Button 1 will retrieve debug log detail by id
10 | {
11 | "button": "button1", "count": 1, "modifiers": ["alt"],
12 | "press_command": "view_debug_log_detail"
13 | },
14 |
15 | // Press alt and Click Button 1 for twice will quick view the code coverage
16 | {
17 | "button": "button1", "count": 2, "modifiers": ["alt+shitf"],
18 | "press_command": "view_selected_code_coverage"
19 | },
20 |
21 | // Press alt and Click Button 1 for triple will cancel deployment of specified task Id
22 | {
23 | "button": "button1", "count": 3, "modifiers": ["alt"],
24 | "press_command": "cancel_deployment"
25 | }
26 | ]
--------------------------------------------------------------------------------
/config/messages/install.txt:
--------------------------------------------------------------------------------
1 | # Sublime IDE for Salesforce
2 | This plugin supports [Sublime Text 3](http://www.sublimetext.com/3) for windows and OSX, not tested for Linux.
3 |
4 | # Installation
5 | You can install this plugin by searching ``haoide`` in package control, if you don't know how to use ``package control``, you can refer to [usage of package control](https://packagecontrol.io/docs/usage).
6 |
7 | This plugin is in improvement stage, many ideas are generated in daily work of mine or my friends, if you have any idea or find any issue, please log issue by clicking ``Report Issue`` in the main menu, thanks for you help on improving this plugin.
8 |
9 | All of our motivation on this plugin come from your star, if you think this plugin is helpful in your daily work, please **star** this plugin.
10 |
11 | # Change Logs
12 | + Change Logs
13 |
14 | # Quick Link
15 | + [Demos](https://github.com/xjsender/SublimeApexScreenshot)
16 | + [Document](https://github.com/xjsender/haoide)
--------------------------------------------------------------------------------
/docs/dataloader.md:
--------------------------------------------------------------------------------
1 | # Data Loader
2 | ## Export Query to CSV
3 | + QueryAll the matched result by the input SOQL, and then parse the fields from SOQL and then write the queried records according to the parsed fields.
4 | + Use ``REST API``
5 | + Support ``child-to-parent`` query but not ``parent-to-child`` query
6 |
7 | ## Bulk Api
8 | + Up to now, support close jobs, export, insert, update and delete.
9 | + You can set the batch size and batch bytes for every batch by put ```maximum_batch_size``` and ```maximum_batch_bytes``` in your user settings, you should be aware, maximum records of single batch is **10K** and maximum bytes of single batch is **1000K**
10 | + This tool will get your CSV file encoding type by detecting the first **1000** bytes of the CSV file, as a best practice, you should prepare CSV file which encoding type is ```ANSI``` or ```UTF-8```.
11 | + If you want to insert a CSV file, you'd better open the CSV file in sublime and copy the file path, after you choose the sobject that you want to insert records, this tool will automatically get the file path from the clipboard
--------------------------------------------------------------------------------
/requests/packages/urllib3/util/__init__.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import
2 | # For backwards compatibility, provide imports that used to be here.
3 | from .connection import is_connection_dropped
4 | from .request import make_headers
5 | from .response import is_fp_closed
6 | from .ssl_ import (
7 | SSLContext,
8 | HAS_SNI,
9 | assert_fingerprint,
10 | resolve_cert_reqs,
11 | resolve_ssl_version,
12 | ssl_wrap_socket,
13 | )
14 | from .timeout import (
15 | current_time,
16 | Timeout,
17 | )
18 |
19 | from .retry import Retry
20 | from .url import (
21 | get_host,
22 | parse_url,
23 | split_first,
24 | Url,
25 | )
26 |
27 | __all__ = (
28 | 'HAS_SNI',
29 | 'SSLContext',
30 | 'Retry',
31 | 'Timeout',
32 | 'Url',
33 | 'assert_fingerprint',
34 | 'current_time',
35 | 'is_connection_dropped',
36 | 'is_fp_closed',
37 | 'get_host',
38 | 'parse_url',
39 | 'make_headers',
40 | 'resolve_cert_reqs',
41 | 'resolve_ssl_version',
42 | 'split_first',
43 | 'ssl_wrap_socket',
44 | )
45 |
--------------------------------------------------------------------------------
/config/messages/3.4.0.md:
--------------------------------------------------------------------------------
1 | Build 3.4.0
2 | -----------
3 | Release Date: 20 May 2016
4 |
5 |
6 | - Deliver enhancement for issue #108
7 | - Deliver enhancement for issue #111
8 |
9 | - Fix bug when test class failed caused by dependency compilation
10 | - Fix bug when view debug log detail
11 | - Fix bug when read csv encoding
12 | - Fix bug When create first new code that will clear the cache of others
13 | - Fix bug When deploy files, default project is not switched back
14 |
15 | - Remove duplicate command ``Reload Sobject Cache`` from command palette
16 | - Remove snippet ``Class Body - class comments``
17 |
18 | - Add new snippet: ``Page - close window and refresh opener``
19 | - Add keymap for ``Open All Documents``, check the keymap setting for detail
20 | - Add new command ``copy_files_to_project`` for issue #113
21 |
22 | - Update snippet: ``Debug - debug info``, ``Debug - debug error``, ``Class Header - class header``
23 | - Update include_users_in_role_hierarchy to false on default
24 | - Update ``folder_exclude_patterns`` pattern to exclude ``.templates`` folder in the sidebar
--------------------------------------------------------------------------------
/docs/issue.md:
--------------------------------------------------------------------------------
1 | # Raise Issue
2 |
3 | Create an [Issue][1] for following situations:
4 | - Find a bug
5 | - Have a good idea about any enhancement/new feature
6 |
7 | ### Report a Bug ###
8 |
9 | For better investigation, you should include following message:
10 |
11 | 1. Title: a concise summary about the bug
12 | 2. Description about the bug
13 | - Details with text description, provide screenshot if necessary.
14 | - Steps to recur the bug.
15 | - Any workaround you have tried.
16 | 3. Context information
17 | - Operation System and version. e.g *Windows 10, version 1903*
18 | - Sublime Test 3 version. e.g *Version 3.2.2 Build 3211*
19 | - Your HaoIDE version. e.g *Build 3.6.0*
20 | - Sublime Text 3 console log. You can press `Ctrl+~` to open the console panel.
21 | - Your user settings if necessary.
22 | - Any other necessary information.
23 |
24 | ### Propose an Enhancement or a New Feature
25 |
26 | Just open an issue to discuss it!
27 |
28 | If you want to contribute, also open an issue before draft the code!
29 |
30 | [1]: https://github.com/xjsender/haoide/issues
--------------------------------------------------------------------------------
/MIT-LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2018 [Hao Liu]
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Page - select all checkbox.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
4 | function checkAll(obj,receivedInputID){
5 | var inputCheckBox = document.getElementsByTagName("input");
6 | for (var i=0; i
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | ]]>
25 | selectAllCheckbox
26 | source.java, source.apex
27 | Select All Checkbox
28 |
29 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Ant - build properties.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
14 | #sf.zipFile =
15 | #sf.metadataType =
16 |
17 | # Use 'https://login.salesforce.com' for production or developer edition (the default if not specified).
18 | # Use 'https://test.salesforce.com for sandbox.
19 | sf.source.serverurl = https://${5:test}.salesforce.com
20 | sf.target.serverurl = https://${6:test}.salesforce.com
21 |
22 | # If your network requires an HTTP proxy, see http://ant.apache.org/manual/proxy.html for configuration.
23 | #
24 | ]]>
25 | bp
26 | source.java, source.apex
27 | build.properties
28 |
--------------------------------------------------------------------------------
/config/snippets/Console/Console - close tab and refresh primary tab.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
26 | $0
27 | ]]>
28 | cr
29 | source.java, source.apex, text.html
30 | Close SubTab And Refresh Primary Tab
31 |
--------------------------------------------------------------------------------
/requests/packages/chardet/compat.py:
--------------------------------------------------------------------------------
1 | ######################## BEGIN LICENSE BLOCK ########################
2 | # Contributor(s):
3 | # Ian Cordasco - port to Python
4 | #
5 | # This library is free software; you can redistribute it and/or
6 | # modify it under the terms of the GNU Lesser General Public
7 | # License as published by the Free Software Foundation; either
8 | # version 2.1 of the License, or (at your option) any later version.
9 | #
10 | # This library is distributed in the hope that it will be useful,
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | # Lesser General Public License for more details.
14 | #
15 | # You should have received a copy of the GNU Lesser General Public
16 | # License along with this library; if not, write to the Free Software
17 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18 | # 02110-1301 USA
19 | ######################### END LICENSE BLOCK #########################
20 |
21 | import sys
22 |
23 |
24 | if sys.version_info < (3, 0):
25 | base_str = (str, unicode)
26 | else:
27 | base_str = (bytes, str)
28 |
29 |
30 | def wrap_ord(a):
31 | if sys.version_info < (3, 0) and isinstance(a, base_str):
32 | return ord(a)
33 | else:
34 | return a
35 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Class Body - send csv email.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 | acclist = [Select id,name , CreatedDate , lastModifiedDate from Account limit 10];
4 | string header = 'Record Id, Name , Created Date, Modified Date \n';
5 | string finalstr = header ;
6 | for(Account a: acclist)
7 | {
8 | string recordString = '"'+a.id+'","'+a.Name+'","'+a.CreatedDate+'","'+a.LastModifiedDate +'"\n';
9 | finalstr = finalstr +recordString;
10 | }
11 | Messaging.EmailFileAttachment csvAttc = new Messaging.EmailFileAttachment();
12 | blob csvBlob = Blob.valueOf(finalstr);
13 | string csvname= 'Account.csv';
14 | csvAttc.setFileName(csvname);
15 | csvAttc.setBody(csvBlob);
16 | Messaging.SingleEmailMessage email =new Messaging.SingleEmailMessage();
17 | String[] toAddresses = new list {'test@test.com'};
18 | String subject ='Account CSV';
19 | email.setSubject(subject);
20 | email.setToAddresses(toAddresses);
21 | email.setPlainTextBody('Account CSV');
22 | email.setFileAttachments(new Messaging.EmailFileAttachment[]{csvAttc});
23 | Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});
24 | $0
25 | ]]>
26 | sce
27 | source.java, source.apex
28 | Send CSV Email
29 |
30 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Ant - build.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | mydir = ${mydir}
12 |
13 |
21 |
22 |
23 |
24 |
31 |
32 |
33 | ]]>
34 | bu
35 | source.java, source.apex
36 | build.xml
37 |
--------------------------------------------------------------------------------
/requests/packages/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.3.0"
19 | from sys import version_info
20 |
21 |
22 | def detect(aBuf):
23 | if ((version_info < (3, 0) and isinstance(aBuf, unicode)) or
24 | (version_info >= (3, 0) and not isinstance(aBuf, bytes))):
25 | raise ValueError('Expected a bytes object, not a unicode object')
26 |
27 | from . import universaldetector
28 | u = universaldetector.UniversalDetector()
29 | u.reset()
30 | u.feed(aBuf)
31 | u.close()
32 | return u.result
33 |
--------------------------------------------------------------------------------
/docs/plugin.md:
--------------------------------------------------------------------------------
1 | # Plugin Operation
2 |
3 | ## Execute Query
4 | After any snippet which start with SELECT is chosen, you can press Ctrl+Alt+Q in windows or click ```HaoIDE``` > ```Execute Query```, the queried json result will be formated and shown in a new view.
5 |
6 | ## Keep Operation History
7 | By default, the operation of ```Execute Query```, ```Describe sObject```, ```Gernate SOQL```, ```Execute Anonymous``` and ```Run Test``` will be kept into the ```.history``` path in current project, you can disable this feature by setting ```keep_operation_history``` to false
8 |
9 | ## Difference between Deploy to Server and Save to Server
10 | * ```Deploy to Server``` use ```Metdata API``, which can be mainly used to deploy files to other different orgs.
11 | * ```Save to Server``` use ```tooling API```, which can't be used in production org.
12 |
13 | ## Keep Apex Code Local History
14 | When you save code, this plugin will keep the change after you saved it to server successfully.
15 |
16 | You can close this feature by change ```keep_local_history_change``` settings to false and put it into your own ``user settings``
17 |
18 | ## Quick Goto Component
19 | Put the focus in the Class Name, and then, press shift, and click ```button1``` for twice, the class file will be open in background if this class file is exist, however, if you want to open this class in the foreground, you should press shift and click ```button1``` for triple.
--------------------------------------------------------------------------------
/requests/packages/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 |
--------------------------------------------------------------------------------
/requests/packages/__init__.py:
--------------------------------------------------------------------------------
1 | '''
2 | Debian and other distributions "unbundle" requests' vendored dependencies, and
3 | rewrite all imports to use the global versions of ``urllib3`` and ``chardet``.
4 | The problem with this is that not only requests itself imports those
5 | dependencies, but third-party code outside of the distros' control too.
6 |
7 | In reaction to these problems, the distro maintainers replaced
8 | ``requests.packages`` with a magical "stub module" that imports the correct
9 | modules. The implementations were varying in quality and all had severe
10 | problems. For example, a symlink (or hardlink) that links the correct modules
11 | into place introduces problems regarding object identity, since you now have
12 | two modules in `sys.modules` with the same API, but different identities::
13 |
14 | requests.packages.urllib3 is not urllib3
15 |
16 | With version ``2.5.2``, requests started to maintain its own stub, so that
17 | distro-specific breakage would be reduced to a minimum, even though the whole
18 | issue is not requests' fault in the first place. See
19 | https://github.com/kennethreitz/requests/pull/2375 for the corresponding pull
20 | request.
21 | '''
22 |
23 | from __future__ import absolute_import
24 | import sys
25 |
26 | try:
27 | from . import urllib3
28 | except ImportError:
29 | import urllib3
30 | sys.modules['%s.urllib3' % __name__] = urllib3
31 |
32 | try:
33 | from . import chardet
34 | except ImportError:
35 | import chardet
36 | sys.modules['%s.chardet' % __name__] = chardet
37 |
--------------------------------------------------------------------------------
/libs/cherrypy/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2004-2011, CherryPy Team (team@cherrypy.org)
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without modification,
5 | are permitted provided that the following conditions are met:
6 |
7 | * Redistributions of source code must retain the above copyright notice,
8 | this list of conditions and the following disclaimer.
9 | * Redistributions in binary form must reproduce the above copyright notice,
10 | this list of conditions and the following disclaimer in the documentation
11 | and/or other materials provided with the distribution.
12 | * Neither the name of the CherryPy Team nor the names of its contributors
13 | may be used to endorse or promote products derived from this software
14 | without specific prior written permission.
15 |
16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
--------------------------------------------------------------------------------
/requests/compat.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | """
4 | pythoncompat
5 | """
6 |
7 | from .packages import chardet
8 |
9 | import sys
10 |
11 | # -------
12 | # Pythons
13 | # -------
14 |
15 | # Syntax sugar.
16 | _ver = sys.version_info
17 |
18 | #: Python 2.x?
19 | is_py2 = (_ver[0] == 2)
20 |
21 | #: Python 3.x?
22 | is_py3 = (_ver[0] == 3)
23 |
24 | try:
25 | import simplejson as json
26 | except (ImportError, SyntaxError):
27 | # simplejson does not support Python 3.2, it throws a SyntaxError
28 | # because of u'...' Unicode literals.
29 | import json
30 |
31 | # ---------
32 | # Specifics
33 | # ---------
34 |
35 | if is_py2:
36 | from urllib import quote, unquote, quote_plus, unquote_plus, urlencode, getproxies, proxy_bypass
37 | from urlparse import urlparse, urlunparse, urljoin, urlsplit, urldefrag
38 | from urllib2 import parse_http_list
39 | import cookielib
40 | from Cookie import Morsel
41 | from StringIO import StringIO
42 | from .packages.urllib3.packages.ordered_dict import OrderedDict
43 |
44 | builtin_str = str
45 | bytes = str
46 | str = unicode
47 | basestring = basestring
48 | numeric_types = (int, long, float)
49 |
50 | elif is_py3:
51 | from urllib.parse import urlparse, urlunparse, urljoin, urlsplit, urlencode, quote, unquote, quote_plus, unquote_plus, urldefrag
52 | from urllib.request import parse_http_list, getproxies, proxy_bypass
53 | from http import cookiejar as cookielib
54 | from http.cookies import Morsel
55 | from io import StringIO
56 | from collections import OrderedDict
57 |
58 | builtin_str = str
59 | str = str
60 | bytes = bytes
61 | basestring = (str, bytes)
62 | numeric_types = (int, float)
63 |
--------------------------------------------------------------------------------
/requests/packages/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 |
--------------------------------------------------------------------------------
/requests/packages/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 |
34 | class EUCKRProber(MultiByteCharSetProber):
35 | def __init__(self):
36 | MultiByteCharSetProber.__init__(self)
37 | self._mCodingSM = CodingStateMachine(EUCKRSMModel)
38 | self._mDistributionAnalyzer = EUCKRDistributionAnalysis()
39 | self.reset()
40 |
41 | def get_charset_name(self):
42 | return "EUC-KR"
43 |
--------------------------------------------------------------------------------
/requests/packages/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 |
--------------------------------------------------------------------------------
/requests/packages/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 |
34 | class Big5Prober(MultiByteCharSetProber):
35 | def __init__(self):
36 | MultiByteCharSetProber.__init__(self)
37 | self._mCodingSM = CodingStateMachine(Big5SMModel)
38 | self._mDistributionAnalyzer = Big5DistributionAnalysis()
39 | self.reset()
40 |
41 | def get_charset_name(self):
42 | return "Big5"
43 |
--------------------------------------------------------------------------------
/requests/packages/chardet/cp949prober.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 CP949SMModel
32 |
33 |
34 | class CP949Prober(MultiByteCharSetProber):
35 | def __init__(self):
36 | MultiByteCharSetProber.__init__(self)
37 | self._mCodingSM = CodingStateMachine(CP949SMModel)
38 | # NOTE: CP949 is a superset of EUC-KR, so the distribution should be
39 | # not different.
40 | self._mDistributionAnalyzer = EUCKRDistributionAnalysis()
41 | self.reset()
42 |
43 | def get_charset_name(self):
44 | return "CP949"
45 |
--------------------------------------------------------------------------------
/requests/packages/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 | from . import constants
30 | import re
31 |
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 |
--------------------------------------------------------------------------------
/requests/packages/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 .cp949prober import CP949Prober
37 | from .big5prober import Big5Prober
38 | from .euctwprober import EUCTWProber
39 |
40 |
41 | class MBCSGroupProber(CharSetGroupProber):
42 | def __init__(self):
43 | CharSetGroupProber.__init__(self)
44 | self._mProbers = [
45 | UTF8Prober(),
46 | SJISProber(),
47 | EUCJPProber(),
48 | GB2312Prober(),
49 | EUCKRProber(),
50 | CP949Prober(),
51 | Big5Prober(),
52 | EUCTWProber()
53 | ]
54 | self.reset()
55 |
--------------------------------------------------------------------------------
/requests/packages/urllib3/util/request.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import
2 | from base64 import b64encode
3 |
4 | from ..packages.six import b
5 |
6 | ACCEPT_ENCODING = 'gzip,deflate'
7 |
8 |
9 | def make_headers(keep_alive=None, accept_encoding=None, user_agent=None,
10 | basic_auth=None, proxy_basic_auth=None, disable_cache=None):
11 | """
12 | Shortcuts for generating request headers.
13 |
14 | :param keep_alive:
15 | If ``True``, adds 'connection: keep-alive' header.
16 |
17 | :param accept_encoding:
18 | Can be a boolean, list, or string.
19 | ``True`` translates to 'gzip,deflate'.
20 | List will get joined by comma.
21 | String will be used as provided.
22 |
23 | :param user_agent:
24 | String representing the user-agent you want, such as
25 | "python-urllib3/0.6"
26 |
27 | :param basic_auth:
28 | Colon-separated username:password string for 'authorization: basic ...'
29 | auth header.
30 |
31 | :param proxy_basic_auth:
32 | Colon-separated username:password string for 'proxy-authorization: basic ...'
33 | auth header.
34 |
35 | :param disable_cache:
36 | If ``True``, adds 'cache-control: no-cache' header.
37 |
38 | Example::
39 |
40 | >>> make_headers(keep_alive=True, user_agent="Batman/1.0")
41 | {'connection': 'keep-alive', 'user-agent': 'Batman/1.0'}
42 | >>> make_headers(accept_encoding=True)
43 | {'accept-encoding': 'gzip,deflate'}
44 | """
45 | headers = {}
46 | if accept_encoding:
47 | if isinstance(accept_encoding, str):
48 | pass
49 | elif isinstance(accept_encoding, list):
50 | accept_encoding = ','.join(accept_encoding)
51 | else:
52 | accept_encoding = ACCEPT_ENCODING
53 | headers['accept-encoding'] = accept_encoding
54 |
55 | if user_agent:
56 | headers['user-agent'] = user_agent
57 |
58 | if keep_alive:
59 | headers['connection'] = 'keep-alive'
60 |
61 | if basic_auth:
62 | headers['authorization'] = 'Basic ' + \
63 | b64encode(b(basic_auth)).decode('utf-8')
64 |
65 | if proxy_basic_auth:
66 | headers['proxy-authorization'] = 'Basic ' + \
67 | b64encode(b(proxy_basic_auth)).decode('utf-8')
68 |
69 | if disable_cache:
70 | headers['cache-control'] = 'no-cache'
71 |
72 | return headers
73 |
--------------------------------------------------------------------------------
/config/templates/ApexClass/Triggers Template.cls:
--------------------------------------------------------------------------------
1 | public class Triggers {
2 | /**
3 | Enum representing each of before/after CRUD events on Sobjects
4 | */
5 | public enum Evt {
6 | afterdelete, afterinsert, afterundelete,
7 | afterupdate, beforedelete, beforeinsert, beforeupdate
8 | }
9 |
10 | /**
11 | Simplistic handler to implement on any of the event. It doesn't requires or enforces any patter except the
12 | method name to be "handle()", a developer is free to use any Trigger context variable or reuse any other
13 | apex class here.
14 | */
15 | public interface Handler {
16 | void handle();
17 | }
18 |
19 | // Internal mapping of handlers
20 | Map> eventHandlerMapping = new Map>();
21 |
22 | /**
23 | Core API to bind handlers with events
24 | */
25 | public Triggers bind(Evt event, Handler eh) {
26 | List handlers = eventHandlerMapping.get(event.name());
27 | if (handlers == null) {
28 | handlers = new List();
29 | eventHandlerMapping.put(event.name(), handlers);
30 | }
31 | handlers.add(eh);
32 | return this;
33 | }
34 |
35 | /**
36 | Invokes correct handlers as per the context of trigger and available registered handlers
37 | */
38 | public void manage() {
39 | Evt ev = null;
40 | if(Trigger.isInsert && Trigger.isBefore){
41 | ev = Evt.beforeinsert;
42 | } else if(Trigger.isInsert && Trigger.isAfter){
43 | ev = Evt.afterinsert;
44 | } else if(Trigger.isUpdate && Trigger.isBefore){
45 | ev = Evt.beforeupdate;
46 | } else if(Trigger.isUpdate && Trigger.isAfter){
47 | ev = Evt.afterupdate;
48 | } else if(Trigger.isDelete && Trigger.isBefore){
49 | ev = Evt.beforedelete;
50 | } else if(Trigger.isDelete && Trigger.isAfter){
51 | ev = Evt.afterdelete;
52 | } else if(Trigger.isundelete){
53 | ev = Evt.afterundelete;
54 | }
55 | List handlers = eventHandlerMapping.get(ev.name());
56 | if (handlers != null && !handlers.isEmpty()) {
57 | for (Handler h : handlers) {
58 | h.handle();
59 | }
60 | }
61 | }
62 | }
--------------------------------------------------------------------------------
/requests/packages/urllib3/util/response.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import
2 | from ..packages.six.moves import http_client as httplib
3 |
4 | from ..exceptions import HeaderParsingError
5 |
6 |
7 | def is_fp_closed(obj):
8 | """
9 | Checks whether a given file-like object is closed.
10 |
11 | :param obj:
12 | The file-like object to check.
13 | """
14 |
15 | try:
16 | # Check via the official file-like-object way.
17 | return obj.closed
18 | except AttributeError:
19 | pass
20 |
21 | try:
22 | # Check if the object is a container for another file-like object that
23 | # gets released on exhaustion (e.g. HTTPResponse).
24 | return obj.fp is None
25 | except AttributeError:
26 | pass
27 |
28 | raise ValueError("Unable to determine whether fp is closed.")
29 |
30 |
31 | def assert_header_parsing(headers):
32 | """
33 | Asserts whether all headers have been successfully parsed.
34 | Extracts encountered errors from the result of parsing headers.
35 |
36 | Only works on Python 3.
37 |
38 | :param headers: Headers to verify.
39 | :type headers: `httplib.HTTPMessage`.
40 |
41 | :raises urllib3.exceptions.HeaderParsingError:
42 | If parsing errors are found.
43 | """
44 |
45 | # This will fail silently if we pass in the wrong kind of parameter.
46 | # To make debugging easier add an explicit check.
47 | if not isinstance(headers, httplib.HTTPMessage):
48 | raise TypeError('expected httplib.Message, got {0}.'.format(
49 | type(headers)))
50 |
51 | defects = getattr(headers, 'defects', None)
52 | get_payload = getattr(headers, 'get_payload', None)
53 |
54 | unparsed_data = None
55 | if get_payload: # Platform-specific: Python 3.
56 | unparsed_data = get_payload()
57 |
58 | if defects or unparsed_data:
59 | raise HeaderParsingError(defects=defects, unparsed_data=unparsed_data)
60 |
61 |
62 | def is_response_to_head(response):
63 | """
64 | Checks, wether a the request of a response has been a HEAD-request.
65 | Handles the quirks of AppEngine.
66 |
67 | :param conn:
68 | :type conn: :class:`httplib.HTTPResponse`
69 | """
70 | # FIXME: Can we do this somehow without accessing private httplib _method?
71 | method = response._method
72 | if isinstance(method, int): # Platform-specific: Appengine
73 | return method == 3
74 | return method.upper() == 'HEAD'
75 |
--------------------------------------------------------------------------------
/requests/__init__.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | # __
4 | # /__) _ _ _ _ _/ _
5 | # / ( (- (/ (/ (- _) / _)
6 | # /
7 |
8 | """
9 | Requests HTTP library
10 | ~~~~~~~~~~~~~~~~~~~~~
11 |
12 | Requests is an HTTP library, written in Python, for human beings. Basic GET
13 | usage:
14 |
15 | >>> import requests
16 | >>> r = requests.get('https://www.python.org')
17 | >>> r.status_code
18 | 200
19 | >>> 'Python is a programming language' in r.content
20 | True
21 |
22 | ... or POST:
23 |
24 | >>> payload = dict(key1='value1', key2='value2')
25 | >>> r = requests.post('http://httpbin.org/post', data=payload)
26 | >>> print(r.text)
27 | {
28 | ...
29 | "form": {
30 | "key2": "value2",
31 | "key1": "value1"
32 | },
33 | ...
34 | }
35 |
36 | The other HTTP methods are supported - see `requests.api`. Full documentation
37 | is at .
38 |
39 | :copyright: (c) 2015 by Kenneth Reitz.
40 | :license: Apache 2.0, see LICENSE for more details.
41 |
42 | """
43 |
44 | __title__ = 'requests'
45 | __version__ = '2.9.1'
46 | __build__ = 0x020901
47 | __author__ = 'Kenneth Reitz'
48 | __license__ = 'Apache 2.0'
49 | __copyright__ = 'Copyright 2016 Kenneth Reitz'
50 |
51 | # Attempt to enable urllib3's SNI support, if possible
52 | try:
53 | from .packages.urllib3.contrib import pyopenssl
54 | pyopenssl.inject_into_urllib3()
55 | except ImportError:
56 | pass
57 |
58 | from . import utils
59 | from .models import Request, Response, PreparedRequest
60 | from .api import request, get, head, post, patch, put, delete, options
61 | from .sessions import session, Session
62 | from .status_codes import codes
63 | from .exceptions import (
64 | RequestException, Timeout, URLRequired,
65 | TooManyRedirects, HTTPError, ConnectionError,
66 | FileModeWarning,
67 | )
68 |
69 | # Set default logging handler to avoid "No handler found" warnings.
70 | import logging
71 | try: # Python 2.7+
72 | from logging import NullHandler
73 | except ImportError:
74 | class NullHandler(logging.Handler):
75 | def emit(self, record):
76 | pass
77 |
78 | logging.getLogger(__name__).addHandler(NullHandler())
79 |
80 | import warnings
81 |
82 | # FileModeWarnings go off per the default.
83 | warnings.simplefilter('default', FileModeWarning, append=True)
84 |
85 | # Globally disable this annoy warnings
86 | try:
87 | from .packages import urllib3
88 | urllib3.disable_warnings()
89 | except ImportError:
90 | pass
91 |
--------------------------------------------------------------------------------
/salesforce/lib/diff.py:
--------------------------------------------------------------------------------
1 | import sublime, sublime_plugin
2 | import difflib
3 | import time
4 | import datetime
5 | import codecs
6 | import os
7 |
8 |
9 | def diff_changes(file_name, result):
10 | try:
11 | if "Body" in result:
12 | server = result["Body"].splitlines()
13 | elif "Markup" in result:
14 | server = result["Markup"].splitlines()
15 | elif "Source" in result:
16 | server = result["Source"].splitlines()
17 | else:
18 | show_diff_panel("No server text found to diff")
19 | return
20 |
21 | local = codecs.open(file_name, "r", "utf-8").read().splitlines()
22 |
23 | time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time()))
24 | bdate_literal = result["LastModifiedDate"].split(".")[0]
25 | server_date = datetime.datetime.strptime(bdate_literal, "%Y-%m-%dT%H:%M:%S")
26 | local_date = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time()))
27 |
28 | diff = difflib.unified_diff(server, local, "Server", "Local ", server_date, local_date, lineterm='')
29 | difftxt = u"\n".join(line for line in diff)
30 |
31 | if difftxt == "":
32 | show_diff_panel("There is no difference between %s and server" % os.path.basename(file_name))
33 | else:
34 | show_diff_panel(difftxt)
35 | except UnicodeDecodeError:
36 | show_diff_panel("Diff only works with UTF-8 files")
37 |
38 |
39 | def diff_files(file_name, other_file_name):
40 | try:
41 | this_file_content = codecs.open(file_name, "r", "utf-8").read().splitlines()
42 | other_file_content = codecs.open(other_file_name, "r", "utf-8").read().splitlines()
43 | except UnicodeDecodeError:
44 | show_diff_panel("Diff only works with UTF-8 files")
45 | return
46 |
47 | diff = difflib.unified_diff(this_file_content, other_file_content, "Server", "Local ", "", "", lineterm='')
48 | difftxt = u"\n".join(line for line in diff)
49 |
50 | if difftxt == "":
51 | show_diff_panel("There is no difference between %s and %s" % (
52 | file_name,
53 | other_file_name
54 | ))
55 | return
56 |
57 | show_diff_panel(difftxt)
58 |
59 |
60 | def show_diff_panel(diff_txt):
61 | win = sublime.active_window()
62 | v = win.create_output_panel('diff_with_server')
63 | v.assign_syntax('Packages/Diff/Diff.tmLanguage')
64 |
65 | v.run_command('append', {'characters': diff_txt})
66 | win.run_command("show_panel", {"panel": "output.diff_with_server"})
67 |
--------------------------------------------------------------------------------
/requests/packages/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
29 | from .compat import wrap_ord
30 |
31 |
32 | class CodingStateMachine:
33 | def __init__(self, sm):
34 | self._mModel = sm
35 | self._mCurrentBytePos = 0
36 | self._mCurrentCharLen = 0
37 | self.reset()
38 |
39 | def reset(self):
40 | self._mCurrentState = eStart
41 |
42 | def next_state(self, c):
43 | # for each byte we get its class
44 | # if it is first byte, we also get byte length
45 | # PY3K: aBuf is a byte stream, so c is an int, not a byte
46 | byteCls = self._mModel['classTable'][wrap_ord(c)]
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 | curr_state = (self._mCurrentState * self._mModel['classFactor']
52 | + byteCls)
53 | self._mCurrentState = self._mModel['stateTable'][curr_state]
54 | self._mCurrentBytePos += 1
55 | return self._mCurrentState
56 |
57 | def get_current_charlen(self):
58 | return self._mCurrentCharLen
59 |
60 | def get_coding_state_machine(self):
61 | return self._mModel['name']
62 |
--------------------------------------------------------------------------------
/docs/document.md:
--------------------------------------------------------------------------------
1 | # Salesforce Document Quick Reference
2 | I get the idea idea from [Salesforce Referencee](https://github.com/Oblongmana/sublime-salesforce-reference) and added some feature based on it.
3 |
4 | Click the ```HaoIDE``` > ```Document``` > ```Reload Salesforce Reference``` in the main menu, you need to confirm whether continue, after you confirmed it, then wait for a moment until the ```Open Document``` command is enabled, at this moment, you can press Ctrl+Alt+O or Click it to invoke the ```Open Document``` command, nearly all reference api will be shown in the list, you can try to choose any one and it will be opened in browser.
5 |
6 | This is default ```docs``` settings, if you want to add some other document references to here, you can customize it by yourself, for example,
7 | + In the below sample, you can see "Apex Developer Guide": "apexcode" key-value,
8 | + The key can be any meaningful words, which is used in quick panel
9 | + The value can be found in https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dev_guide.htm
10 | ```
11 | "docs" : {
12 | "Apex Developer Guide": "apexcode",
13 | "AJAX Toolkit Developer Guide": "ajax",
14 | "Salesforce Reports and Dashboards REST API Developer Guide": "api_analytics",
15 | "Analytics Cloud Dashboard JSON": "bi_dev_guide_json",
16 | "Visualforce Developer Guide": "pages",
17 | "Streaming API Developer Guide": "api_streaming",
18 | "Salesforce Security Guide": "securityImplGuide",
19 | "Bulk API Developer Guide": "api_asynch",
20 | "REST API Developer Guide": "api_rest",
21 | "Open CTI Developer Guide": "api_cti",
22 | "Tooling API Developer Guide": "api_tooling",
23 | "SOAP API Developer Guide": "api",
24 | "Industries REST API Developer Guide": "api_rest_industries",
25 | "Chatter REST API Developer Guide": "chatterapi",
26 | "Metadata API Developer Guide": "api_meta",
27 | "Console Integration Toolkit Developer Guide": "api_console",
28 | "Object Reference": "object_reference",
29 | "SOQL and SOSL Reference": "soql_sosl",
30 | "Lightning Components Developer Guide": "lightning",
31 | "Development Lifecycle Guide": "dev_lifecycle",
32 | "Migration Tool Guide": "daas",
33 | "Force.com Workbook": "workbook",
34 | "Integration Workbook": "integration_workbook",
35 | "Identity Implementation Guide": "identityImplGuide",
36 | "Formulas Quick Reference": "salesforce_formulas_cheatsheet"
37 | }
38 | ```
39 |
40 | **You should be aware that every reloading is time-consuming, generally, you should reload it in every salesforce release**
--------------------------------------------------------------------------------
/config/snippets/Apex/Class Body - trigger template.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 | > eventHandlerMapping = new Map>();
23 |
24 | /**
25 | Core API to bind handlers with events
26 | */
27 | public Triggers bind(Evt event, Handler eh) {
28 | List handlers = eventHandlerMapping.get(event.name());
29 | if (handlers == null) {
30 | handlers = new List();
31 | eventHandlerMapping.put(event.name(), handlers);
32 | }
33 | handlers.add(eh);
34 | return this;
35 | }
36 |
37 | /**
38 | Invokes correct handlers as per the context of trigger and available registered handlers
39 | */
40 | public void manage() {
41 | Evt ev = null;
42 | if(Trigger.isInsert && Trigger.isBefore){
43 | ev = Evt.beforeinsert;
44 | } else if(Trigger.isInsert && Trigger.isAfter){
45 | ev = Evt.afterinsert;
46 | } else if(Trigger.isUpdate && Trigger.isBefore){
47 | ev = Evt.beforeupdate;
48 | } else if(Trigger.isUpdate && Trigger.isAfter){
49 | ev = Evt.afterupdate;
50 | } else if(Trigger.isDelete && Trigger.isBefore){
51 | ev = Evt.beforedelete;
52 | } else if(Trigger.isDelete && Trigger.isAfter){
53 | ev = Evt.afterdelete;
54 | } else if(Trigger.isundelete){
55 | ev = Evt.afterundelete;
56 | }
57 | List handlers = eventHandlerMapping.get(ev.name());
58 | if (handlers != null && !handlers.isEmpty()) {
59 | for (Handler h : handlers) {
60 | h.handle();
61 | }
62 | }
63 | }
64 | }
65 | ]]>
66 | tt
67 | source.java, source.apex
68 | Trigger Template Class
69 |
--------------------------------------------------------------------------------
/docs/tooling.md:
--------------------------------------------------------------------------------
1 | # Tooling Operation
2 | ## Save component
3 | + This command is only enabled in salesforce code file of active project
4 | + After code is updated, click ```HaoIDE``` > ```Save to Server``` in the context menu or press Ctrl+Alt+S
5 | + If the saving process failed, the console will be open and automatically hidden in **10** seconds, if you think **10** seconds is not enough to check the error message, you add it up to more by setting ```delay_seconds_for_hidden_output_panel_when_failed```
6 |
7 | This command just supports ```ApexClass```, ```ApexPage```, ```ApexComponent``` and ```ApexTrigger```, not support ```StaticResource```, if you want to use it to update static resource, you should use ```Deploy to Server``` to see ```[Update StaticResource](#update-static-resource)``` Part in this page
8 |
9 | ## Refresh component
10 | + This command is only enabled in salesforce code file of active project
11 | + After code is updated in UI or other IDE, press Ctrl+Alt+R or click ```HaoIDE``` > ```Refresh From Server``` to refresh it from server.
12 |
13 | ## Delete component
14 | + This command is only enabled in salesforce code file
15 | + If you want to delete it from server, click ```HaoIDE``` > ```Delete From Server```
16 |
17 | ## Refresh Multiply Components
18 | Choose the components you want to refresh, and then Click ```HaoIDE``` > ```Refresh Selected Components``` in the Sidebar Menu
19 |
20 | ## Delete Multiply Components
21 | Choose the components you want to delete, and then Click ```HaoIDE``` > ```Delete Selected Components``` in the Sidebar Menu
22 |
23 | ## New ApexClass
24 | Click ```HaoIDE``` > ```New``` > ```New ApexClass```, choose the predefined template, and then input the class name in the input panel at the bottom, after that, your class will be created.
25 |
26 | ## New ApexPage
27 | Click ```HaoIDE``` > ```New``` > ```New ApexPage```, and then input the page name in the input panel at the bottom, after that, your page will be created.
28 |
29 | After you input # after extension or controller name in visualforce page, plugin will create it for you automatically, see [demo](https://raw.githubusercontent.com/xjsender/SublimeApexScreenshot/master/QuickController.gif)
30 |
31 | ## New ApexComponent
32 | Click ```HaoIDE``` > ```New``` > ```New ApexComponent```, and then input the component name in the input panel at the bottom, after that, your component will be created.
33 |
34 | ## New ApexTrigger
35 | Click ```HaoIDE``` > ```New``` > ```New ApexTrigger```, choose the sobject on which you will create trigger, and then input the trigger name in the input panel at the bottom, after that, your trigger will be created.
36 |
--------------------------------------------------------------------------------
/requests/packages/urllib3/filepost.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import
2 | import codecs
3 |
4 | from uuid import uuid4
5 | from io import BytesIO
6 |
7 | from .packages import six
8 | from .packages.six import b
9 | from .fields import RequestField
10 |
11 | writer = codecs.lookup('utf-8')[3]
12 |
13 |
14 | def choose_boundary():
15 | """
16 | Our embarassingly-simple replacement for mimetools.choose_boundary.
17 | """
18 | return uuid4().hex
19 |
20 |
21 | def iter_field_objects(fields):
22 | """
23 | Iterate over fields.
24 |
25 | Supports list of (k, v) tuples and dicts, and lists of
26 | :class:`~urllib3.fields.RequestField`.
27 |
28 | """
29 | if isinstance(fields, dict):
30 | i = six.iteritems(fields)
31 | else:
32 | i = iter(fields)
33 |
34 | for field in i:
35 | if isinstance(field, RequestField):
36 | yield field
37 | else:
38 | yield RequestField.from_tuples(*field)
39 |
40 |
41 | def iter_fields(fields):
42 | """
43 | .. deprecated:: 1.6
44 |
45 | Iterate over fields.
46 |
47 | The addition of :class:`~urllib3.fields.RequestField` makes this function
48 | obsolete. Instead, use :func:`iter_field_objects`, which returns
49 | :class:`~urllib3.fields.RequestField` objects.
50 |
51 | Supports list of (k, v) tuples and dicts.
52 | """
53 | if isinstance(fields, dict):
54 | return ((k, v) for k, v in six.iteritems(fields))
55 |
56 | return ((k, v) for k, v in fields)
57 |
58 |
59 | def encode_multipart_formdata(fields, boundary=None):
60 | """
61 | Encode a dictionary of ``fields`` using the multipart/form-data MIME format.
62 |
63 | :param fields:
64 | Dictionary of fields or list of (key, :class:`~urllib3.fields.RequestField`).
65 |
66 | :param boundary:
67 | If not specified, then a random boundary will be generated using
68 | :func:`mimetools.choose_boundary`.
69 | """
70 | body = BytesIO()
71 | if boundary is None:
72 | boundary = choose_boundary()
73 |
74 | for field in iter_field_objects(fields):
75 | body.write(b('--%s\r\n' % (boundary)))
76 |
77 | writer(body).write(field.render_headers())
78 | data = field.data
79 |
80 | if isinstance(data, int):
81 | data = str(data) # Backwards compatibility
82 |
83 | if isinstance(data, six.text_type):
84 | writer(body).write(data)
85 | else:
86 | body.write(data)
87 |
88 | body.write(b'\r\n')
89 |
90 | body.write(b('--%s--\r\n' % (boundary)))
91 |
92 | content_type = str('multipart/form-data; boundary=%s' % boundary)
93 |
94 | return body.getvalue(), content_type
95 |
--------------------------------------------------------------------------------
/docs/retrieve.md:
--------------------------------------------------------------------------------
1 | # Retrieve
2 | ## Toggle Metadata Objects
3 | * Open your command palette and input HaoIDE: ``Toggle Metadata Objects``
4 | * Subscribe the metadata object util all you want are finished, press ``ESC``
5 | * After that, you will be asked to confirm whether execute ``update_project`` command to download all subscribed metadata, once you confirmed to execute update operation, plugin will start to update whole project for you, otherwise, nothing will happen.
6 |
7 | ## Retrieve All Step by Step
8 | * Click ```Metadata Migration``` > ```Retrieve All``` in the main menu
9 | * After retrieve is finished, retrieved metadata will be extracted to ``Project/src``
10 |
11 | ## Retrieve sObject And Workflow Step by Step
12 | * Click ```Metadata Migration``` > ```Retrieve sObject And Workflow``` in the main menu
13 | * After retrieve is finished, ``objects`` and ``workflows`` will be extracted to ``Project/src``
14 |
15 | ## Retrieve Files From Server Step by Step
16 | You can retrieve files from server by below two ways,
17 |
18 | * By Sidebar Menu
19 | - Choose one or more files in the sidebar
20 | - Execute ```HaoIDE > Refresh Files From Server``` command in the sidebar menu, retrieve will start
21 | - After retrieve is finished, selected files will be refreshed with the latest source
22 |
23 | * By Context Menu
24 | - Choose a file or more files in the sidebar
25 | - Execute ```HaoIDE > Refresh From Server``` command in the context menu, retrieve will start
26 | - After retrieve is finished, selected files will be refreshed with the latest source
27 |
28 | ## Retrieve Package.xml Step by Step
29 | With this feature, plugin can retrieve the metadata by package.xml from the default project, if package.xml parse failed, error will be shown in the output panel.
30 |
31 | You can retrieve package.xml by below two ways,
32 |
33 | * By Sidebar Menu
34 | - Choose a package file, which name should be end with ```.xml```
35 | - Execute ```HaoIDE > Retrieve Package.xml``` command in the sidebar menu
36 | - You will need to input the output path for retrieved result, which has a default value same with the path of current package.xml, after input the output path and hit Enter, retrieve will start
37 | - After retrieve is finished, you will see the retrieved package in your input path
38 |
39 | * By Context Menu
40 | - Open a package file, which name should be end with ```.xml```
41 | - Execute ```HaoIDE > Retrieve Package.xml``` command in the context menu
42 | - You will need to input the output path for retrieved result, which has a default value same with the path of current package.xml, after input the output path and hit Enter, retrieve will start
43 | - After retrieve is finished, you will see the retrieved package in your input path
--------------------------------------------------------------------------------
/requests/packages/chardet/chardetect.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | """
3 | Script which takes one or more file paths and reports on their detected
4 | encodings
5 |
6 | Example::
7 |
8 | % chardetect somefile someotherfile
9 | somefile: windows-1252 with confidence 0.5
10 | someotherfile: ascii with confidence 1.0
11 |
12 | If no paths are provided, it takes its input from stdin.
13 |
14 | """
15 |
16 | from __future__ import absolute_import, print_function, unicode_literals
17 |
18 | import argparse
19 | import sys
20 | from io import open
21 |
22 | from chardet import __version__
23 | from chardet.universaldetector import UniversalDetector
24 |
25 |
26 | def description_of(lines, name='stdin'):
27 | """
28 | Return a string describing the probable encoding of a file or
29 | list of strings.
30 |
31 | :param lines: The lines to get the encoding of.
32 | :type lines: Iterable of bytes
33 | :param name: Name of file or collection of lines
34 | :type name: str
35 | """
36 | u = UniversalDetector()
37 | for line in lines:
38 | u.feed(line)
39 | u.close()
40 | result = u.result
41 | if result['encoding']:
42 | return '{0}: {1} with confidence {2}'.format(name, result['encoding'],
43 | result['confidence'])
44 | else:
45 | return '{0}: no result'.format(name)
46 |
47 |
48 | def main(argv=None):
49 | '''
50 | Handles command line arguments and gets things started.
51 |
52 | :param argv: List of arguments, as if specified on the command-line.
53 | If None, ``sys.argv[1:]`` is used instead.
54 | :type argv: list of str
55 | '''
56 | # Get command line arguments
57 | parser = argparse.ArgumentParser(
58 | description="Takes one or more file paths and reports their detected \
59 | encodings",
60 | formatter_class=argparse.ArgumentDefaultsHelpFormatter,
61 | conflict_handler='resolve')
62 | parser.add_argument('input',
63 | help='File whose encoding we would like to determine.',
64 | type=argparse.FileType('rb'), nargs='*',
65 | default=[sys.stdin])
66 | parser.add_argument('--version', action='version',
67 | version='%(prog)s {0}'.format(__version__))
68 | args = parser.parse_args(argv)
69 |
70 | for f in args.input:
71 | if f.isatty():
72 | print("You are running chardetect interactively. Press " +
73 | "CTRL-D twice at the start of a blank line to signal the " +
74 | "end of your input. If you want help, run chardetect " +
75 | "--help\n", file=sys.stderr)
76 | print(description_of(f, f.name))
77 |
78 |
79 | if __name__ == '__main__':
80 | main()
81 |
--------------------------------------------------------------------------------
/salesforce/lib/dateutil/zoneinfo/__init__.py:
--------------------------------------------------------------------------------
1 | """
2 | Copyright (c) 2003-2005 Gustavo Niemeyer
3 |
4 | This module offers extensions to the standard python 2.3+
5 | datetime module.
6 | """
7 | from dateutil.tz import tzfile
8 | from tarfile import TarFile
9 | import os
10 |
11 | __author__ = "Gustavo Niemeyer "
12 | __license__ = "PSF License"
13 |
14 | __all__ = ["setcachesize", "gettz", "rebuild"]
15 |
16 | CACHE = []
17 | CACHESIZE = 10
18 |
19 | class tzfile(tzfile):
20 | def __reduce__(self):
21 | return (gettz, (self._filename,))
22 |
23 | def getzoneinfofile():
24 | filenames = sorted(os.listdir(os.path.join(os.path.dirname(__file__))))
25 | filenames.reverse()
26 | for entry in filenames:
27 | if entry.startswith("zoneinfo") and ".tar." in entry:
28 | return os.path.join(os.path.dirname(__file__), entry)
29 | return None
30 |
31 | ZONEINFOFILE = getzoneinfofile()
32 |
33 | del getzoneinfofile
34 |
35 | def setcachesize(size):
36 | global CACHESIZE, CACHE
37 | CACHESIZE = size
38 | del CACHE[size:]
39 |
40 | def gettz(name):
41 | tzinfo = None
42 | if ZONEINFOFILE:
43 | for cachedname, tzinfo in CACHE:
44 | if cachedname == name:
45 | break
46 | else:
47 | tf = TarFile.open(ZONEINFOFILE)
48 | try:
49 | zonefile = tf.extractfile(name)
50 | except KeyError:
51 | tzinfo = None
52 | else:
53 | tzinfo = tzfile(zonefile)
54 | tf.close()
55 | CACHE.insert(0, (name, tzinfo))
56 | del CACHE[CACHESIZE:]
57 | return tzinfo
58 |
59 | def rebuild(filename, tag=None, format="gz"):
60 | import tempfile, shutil
61 | tmpdir = tempfile.mkdtemp()
62 | zonedir = os.path.join(tmpdir, "zoneinfo")
63 | moduledir = os.path.dirname(__file__)
64 | if tag: tag = "-"+tag
65 | targetname = "zoneinfo%s.tar.%s" % (tag, format)
66 | try:
67 | tf = TarFile.open(filename)
68 | for name in tf.getnames():
69 | if not (name.endswith(".sh") or
70 | name.endswith(".tab") or
71 | name == "leapseconds"):
72 | tf.extract(name, tmpdir)
73 | filepath = os.path.join(tmpdir, name)
74 | os.system("zic -d %s %s" % (zonedir, filepath))
75 | tf.close()
76 | target = os.path.join(moduledir, targetname)
77 | for entry in os.listdir(moduledir):
78 | if entry.startswith("zoneinfo") and ".tar." in entry:
79 | os.unlink(os.path.join(moduledir, entry))
80 | tf = TarFile.open(target, "w:%s" % format)
81 | for entry in os.listdir(zonedir):
82 | entrypath = os.path.join(zonedir, entry)
83 | tf.add(entrypath, entry)
84 | tf.close()
85 | finally:
86 | shutil.rmtree(tmpdir)
87 |
--------------------------------------------------------------------------------
/requests/packages/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 | from . import constants
29 | from .charsetprober import CharSetProber
30 | from .codingstatemachine import CodingStateMachine
31 | from .mbcssm import UTF8SMModel
32 |
33 | ONE_CHAR_PROB = 0.5
34 |
35 |
36 | class UTF8Prober(CharSetProber):
37 | def __init__(self):
38 | CharSetProber.__init__(self)
39 | self._mCodingSM = CodingStateMachine(UTF8SMModel)
40 | self.reset()
41 |
42 | def reset(self):
43 | CharSetProber.reset(self)
44 | self._mCodingSM.reset()
45 | self._mNumOfMBChar = 0
46 |
47 | def get_charset_name(self):
48 | return "utf-8"
49 |
50 | def feed(self, aBuf):
51 | for c in aBuf:
52 | codingState = self._mCodingSM.next_state(c)
53 | if codingState == constants.eError:
54 | self._mState = constants.eNotMe
55 | break
56 | elif codingState == constants.eItsMe:
57 | self._mState = constants.eFoundIt
58 | break
59 | elif codingState == constants.eStart:
60 | if self._mCodingSM.get_current_charlen() >= 2:
61 | self._mNumOfMBChar += 1
62 |
63 | if self.get_state() == constants.eDetecting:
64 | if self.get_confidence() > constants.SHORTCUT_THRESHOLD:
65 | self._mState = constants.eFoundIt
66 |
67 | return self.get_state()
68 |
69 | def get_confidence(self):
70 | unlike = 0.99
71 | if self._mNumOfMBChar < 6:
72 | for i in range(0, self._mNumOfMBChar):
73 | unlike = unlike * ONE_CHAR_PROB
74 | return 1.0 - unlike
75 | else:
76 | return unlike
77 |
--------------------------------------------------------------------------------
/salesforce/lib/dateutil/easter.py:
--------------------------------------------------------------------------------
1 | """
2 | Copyright (c) 2003-2007 Gustavo Niemeyer
3 |
4 | This module offers extensions to the standard python 2.3+
5 | datetime module.
6 | """
7 | __author__ = "Gustavo Niemeyer "
8 | __license__ = "Simplified BSD"
9 |
10 | import datetime
11 |
12 | __all__ = ["easter", "EASTER_JULIAN", "EASTER_ORTHODOX", "EASTER_WESTERN"]
13 |
14 | EASTER_JULIAN = 1
15 | EASTER_ORTHODOX = 2
16 | EASTER_WESTERN = 3
17 |
18 | def easter(year, method=EASTER_WESTERN):
19 | """
20 | This method was ported from the work done by GM Arts,
21 | on top of the algorithm by Claus Tondering, which was
22 | based in part on the algorithm of Ouding (1940), as
23 | quoted in "Explanatory Supplement to the Astronomical
24 | Almanac", P. Kenneth Seidelmann, editor.
25 |
26 | This algorithm implements three different easter
27 | calculation methods:
28 |
29 | 1 - Original calculation in Julian calendar, valid in
30 | dates after 326 AD
31 | 2 - Original method, with date converted to Gregorian
32 | calendar, valid in years 1583 to 4099
33 | 3 - Revised method, in Gregorian calendar, valid in
34 | years 1583 to 4099 as well
35 |
36 | These methods are represented by the constants:
37 |
38 | EASTER_JULIAN = 1
39 | EASTER_ORTHODOX = 2
40 | EASTER_WESTERN = 3
41 |
42 | The default method is method 3.
43 |
44 | More about the algorithm may be found at:
45 |
46 | http://users.chariot.net.au/~gmarts/eastalg.htm
47 |
48 | and
49 |
50 | http://www.tondering.dk/claus/calendar.html
51 |
52 | """
53 |
54 | if not (1 <= method <= 3):
55 | raise ValueError("invalid method")
56 |
57 | # g - Golden year - 1
58 | # c - Century
59 | # h - (23 - Epact) mod 30
60 | # i - Number of days from March 21 to Paschal Full Moon
61 | # j - Weekday for PFM (0=Sunday, etc)
62 | # p - Number of days from March 21 to Sunday on or before PFM
63 | # (-6 to 28 methods 1 & 3, to 56 for method 2)
64 | # e - Extra days to add for method 2 (converting Julian
65 | # date to Gregorian date)
66 |
67 | y = year
68 | g = y % 19
69 | e = 0
70 | if method < 3:
71 | # Old method
72 | i = (19*g+15)%30
73 | j = (y+y//4+i)%7
74 | if method == 2:
75 | # Extra dates to convert Julian to Gregorian date
76 | e = 10
77 | if y > 1600:
78 | e = e+y//100-16-(y//100-16)//4
79 | else:
80 | # New method
81 | c = y//100
82 | h = (c-c//4-(8*c+13)//25+19*g+15)%30
83 | i = h-(h//28)*(1-(h//28)*(29//(h+1))*((21-g)//11))
84 | j = (y+y//4+i+2-c+c//4)%7
85 |
86 | # p can be from -6 to 56 corresponding to dates 22 March to 23 May
87 | # (later dates apply to method 2, although 23 May never actually occurs)
88 | p = i-j+e
89 | d = 1+(p+27+(p+6)//40)%31
90 | m = 3+(p+26)//30
91 | return datetime.date(int(y), int(m), int(d))
92 |
93 |
--------------------------------------------------------------------------------
/requests/packages/urllib3/__init__.py:
--------------------------------------------------------------------------------
1 | """
2 | urllib3 - Thread-safe connection pooling and re-using.
3 | """
4 |
5 | from __future__ import absolute_import
6 | import warnings
7 |
8 | from .connectionpool import (
9 | HTTPConnectionPool,
10 | HTTPSConnectionPool,
11 | connection_from_url
12 | )
13 |
14 | from . import exceptions
15 | from .filepost import encode_multipart_formdata
16 | from .poolmanager import PoolManager, ProxyManager, proxy_from_url
17 | from .response import HTTPResponse
18 | from .util.request import make_headers
19 | from .util.url import get_host
20 | from .util.timeout import Timeout
21 | from .util.retry import Retry
22 |
23 |
24 | # Set default logging handler to avoid "No handler found" warnings.
25 | import logging
26 | try: # Python 2.7+
27 | from logging import NullHandler
28 | except ImportError:
29 | class NullHandler(logging.Handler):
30 | def emit(self, record):
31 | pass
32 |
33 | __author__ = 'Andrey Petrov (andrey.petrov@shazow.net)'
34 | __license__ = 'MIT'
35 | __version__ = '1.13.1'
36 |
37 | __all__ = (
38 | 'HTTPConnectionPool',
39 | 'HTTPSConnectionPool',
40 | 'PoolManager',
41 | 'ProxyManager',
42 | 'HTTPResponse',
43 | 'Retry',
44 | 'Timeout',
45 | 'add_stderr_logger',
46 | 'connection_from_url',
47 | 'disable_warnings',
48 | 'encode_multipart_formdata',
49 | 'get_host',
50 | 'make_headers',
51 | 'proxy_from_url',
52 | )
53 |
54 | logging.getLogger(__name__).addHandler(NullHandler())
55 |
56 |
57 | def add_stderr_logger(level=logging.DEBUG):
58 | """
59 | Helper for quickly adding a StreamHandler to the logger. Useful for
60 | debugging.
61 |
62 | Returns the handler after adding it.
63 | """
64 | # This method needs to be in this __init__.py to get the __name__ correct
65 | # even if urllib3 is vendored within another package.
66 | logger = logging.getLogger(__name__)
67 | handler = logging.StreamHandler()
68 | handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s %(message)s'))
69 | logger.addHandler(handler)
70 | logger.setLevel(level)
71 | logger.debug('Added a stderr logging handler to logger: %s' % __name__)
72 | return handler
73 |
74 | # ... Clean up.
75 | del NullHandler
76 |
77 |
78 | # SecurityWarning's always go off by default.
79 | warnings.simplefilter('always', exceptions.SecurityWarning, append=True)
80 | # SubjectAltNameWarning's should go off once per host
81 | warnings.simplefilter('default', exceptions.SubjectAltNameWarning)
82 | # InsecurePlatformWarning's don't vary between requests, so we keep it default.
83 | warnings.simplefilter('default', exceptions.InsecurePlatformWarning,
84 | append=True)
85 | # SNIMissingWarnings should go off only once.
86 | warnings.simplefilter('default', exceptions.SNIMissingWarning)
87 |
88 |
89 | def disable_warnings(category=exceptions.HTTPWarning):
90 | """
91 | Helper for quickly disabling all urllib3 warnings.
92 | """
93 | warnings.simplefilter('ignore', category)
94 |
--------------------------------------------------------------------------------
/salesforce/lib/panel.py:
--------------------------------------------------------------------------------
1 | import sublime
2 | import time
3 | from datetime import date
4 |
5 | class Printer(object):
6 | """ Based on printer of Mavensmate
7 | """
8 | printers = {}
9 |
10 | def __init__(self, name):
11 | self.name = name
12 | self.visible = False
13 |
14 | @classmethod
15 | def get(cls, name, window_id=None):
16 | if not window_id: window_id = sublime.active_window().id()
17 | printer = cls.printers.get(str(window_id)+name)
18 | if not printer:
19 | printer = Printer(name)
20 | printer.window_id = window_id
21 | printer.init()
22 | cls.printers[str(window_id)+name] = printer
23 | package_info = sublime.load_settings("package.sublime-settings")
24 | version_info = "Copyright © 2013-%s By %s, Dev Channel, Build v%s\n" % (
25 | date.today().year,
26 | package_info.get("author"),
27 | package_info.get("version")
28 | )
29 | printer.write(version_info, False)
30 | return printer
31 |
32 | def init(self):
33 | if not hasattr(self, "panel"):
34 | self.window = sublime.active_window()
35 | self.panel = self.window.get_output_panel(self.name)
36 | self.panel.settings().set('syntax', 'Packages/Java/Java.tmLanguage')
37 | self.panel.settings().set('color_scheme', 'Packages/Color Scheme - Default/Monokai.tmTheme')
38 | self.panel.settings().set('word_wrap', True)
39 | self.panel.settings().set('gutter', True)
40 | self.panel.settings().set('line_numbers', True)
41 |
42 | def hide_panel(self):
43 | self.visible = False
44 | self.window.run_command('hide_panel', {
45 | 'panel': 'output.' + self.name
46 | })
47 |
48 | return self
49 |
50 | def show_panel(self):
51 | self.visible = True
52 | self.window.run_command('show_panel', {
53 | 'panel': 'output.' + self.name
54 | })
55 |
56 | return self
57 |
58 | def scroll_to_bottom(self):
59 | size = self.panel.size()
60 | sublime.set_timeout(lambda : self.panel.show(size, True), 2)
61 |
62 | def write_start(self, message="~"*100):
63 | return self.write(message, False)
64 |
65 | def write(self, message, prefix=True):
66 | # Show Panel
67 | self.show_panel()
68 |
69 | # Append message to panel
70 | from ...context import get_default_project_name
71 | panel_message = message + "\n" if not prefix else "%s: %s: %s\n" % (
72 | get_default_project_name(),
73 | time.strftime("%Y.%m.%d %H:%M:%S", time.localtime(time.time())),
74 | message
75 | )
76 |
77 | self.panel.run_command("append", {
78 | "characters": panel_message
79 | })
80 |
81 | # Scroll to bottom
82 | self.scroll_to_bottom()
83 |
84 | return self
85 |
86 | def write_end(self, message=None):
87 | return self.write(message, False)
88 |
--------------------------------------------------------------------------------
/docs/json2apex.md:
--------------------------------------------------------------------------------
1 | # Convert JSON to Apex Step by Step
2 | * Click ```Utilities``` > ```Convert JSON to Apex``` in the main menu
3 | * Default class name of main class is ```JSON2Apex```, after you input the JSON to be converted, plugin will ask you to input the class name, you can change the default name there.
4 | * In order to keep the accuracy of converted result, you should predefine the every value of every key in the input JSON
5 |
6 | ## Notes:
7 | + [x] If value is matched with ```\d{4}-\d{2}-\d{2}T[\d:Z.]+``` regress expression, data type will be thought as ```DateTime```
8 | + [x] If value is matched with ```\d{4}-\d{2}-\d{2}``` regress expression, data type will be thought as ```Date```
9 | + [x] If value is ```null```, data type will be thought as ```Object```
10 |
11 | ## Example:
12 | If the json string is as below,
13 | ```javascript
14 | {
15 | "name": "test",
16 | "birthday": "1982-01-19T09:58:13.190Z",
17 | "age": 32,
18 | "money": 12321.5,
19 | "createdDate": "2015-01-20",
20 | "children": [
21 | {
22 | "name": "son",
23 | "age": 2,
24 | "birthday": "2013-01-19T09:58:13.190Z",
25 | "money": 0,
26 | "toy": [{
27 | "name": "toy1"
28 | }]
29 | },
30 | {
31 | "name": "daughter",
32 | "age": 1,
33 | "birthday": "2014-01-19T09:58:13.190Z",
34 | "money": 0,
35 | "toy": [{
36 | "name": "toy2"
37 | }]
38 | }
39 | ],
40 | "father": {
41 | "name": "father",
42 | "age": 75,
43 | "birthday": "1940-01-19T09:58:13.190Z",
44 | "money": 0
45 | }
46 | }
47 | ```
48 |
49 | The converted apex will be as below:
50 | ```java
51 | global class Toy {
52 | global String name;
53 | }
54 |
55 | global class Children {
56 | global String name;
57 | global List toy;
58 | global Integer age;
59 | global Integer money;
60 | global DateTime birthday;
61 | }
62 |
63 | global class Father {
64 | global String name;
65 | global Integer age;
66 | global Integer money;
67 | global DateTime birthday;
68 | }
69 |
70 | global class JSON2Apex {
71 | global List children;
72 | global Date createdDate;
73 | global Integer age;
74 | global Decimal money;
75 | global String name;
76 | global Father father;
77 | global DateTime birthday;
78 | }
79 |
80 | global static JSON2Apex parse(String jsonStr) {
81 | return (JSON2Apex) JSON.deserialize(jsonStr, JSON2Apex.class);
82 | }
83 |
84 | static testMethod void testParse() {
85 | String json = '{"children": [{"name": "son", "toy": [{"name": "toy1"}], "age": 2, "money": 0, "birthday": "2013-01-19T09:58:13.190Z"}, {"name": "daughter", "toy": [{"name": "toy2"}], "age": 1, "money": 0, "birthday": "2014-01-19T09:58:13.190Z"}], "createdDate": "2015-01-20", "age": 32, "money": 12321.5, "name": "test", "father": {"name": "father", "age": 75, "money": 0, "birthday": "1940-01-19T09:58:13.190Z"}, "birthday": "1982-01-19T09:58:13.190Z"}';
86 | JSON2Apex obj = parse(json);
87 | System.assert(obj != null);
88 | }
89 | ```
--------------------------------------------------------------------------------
/requests/exceptions.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | """
4 | requests.exceptions
5 | ~~~~~~~~~~~~~~~~~~~
6 |
7 | This module contains the set of Requests' exceptions.
8 |
9 | """
10 | from .packages.urllib3.exceptions import HTTPError as BaseHTTPError
11 |
12 |
13 | class RequestException(IOError):
14 | """There was an ambiguous exception that occurred while handling your
15 | request."""
16 |
17 | def __init__(self, *args, **kwargs):
18 | """
19 | Initialize RequestException with `request` and `response` objects.
20 | """
21 | response = kwargs.pop('response', None)
22 | self.response = response
23 | self.request = kwargs.pop('request', None)
24 | if (response is not None and not self.request and
25 | hasattr(response, 'request')):
26 | self.request = self.response.request
27 | super(RequestException, self).__init__(*args, **kwargs)
28 |
29 |
30 | class HTTPError(RequestException):
31 | """An HTTP error occurred."""
32 |
33 |
34 | class ConnectionError(RequestException):
35 | """A Connection error occurred."""
36 |
37 |
38 | class ProxyError(ConnectionError):
39 | """A proxy error occurred."""
40 |
41 |
42 | class SSLError(ConnectionError):
43 | """An SSL error occurred."""
44 |
45 |
46 | class Timeout(RequestException):
47 | """The request timed out.
48 |
49 | Catching this error will catch both
50 | :exc:`~requests.exceptions.ConnectTimeout` and
51 | :exc:`~requests.exceptions.ReadTimeout` errors.
52 | """
53 |
54 |
55 | class ConnectTimeout(ConnectionError, Timeout):
56 | """The request timed out while trying to connect to the remote server.
57 |
58 | Requests that produced this error are safe to retry.
59 | """
60 |
61 |
62 | class ReadTimeout(Timeout):
63 | """The server did not send any data in the allotted amount of time."""
64 |
65 |
66 | class URLRequired(RequestException):
67 | """A valid URL is required to make a request."""
68 |
69 |
70 | class TooManyRedirects(RequestException):
71 | """Too many redirects."""
72 |
73 |
74 | class MissingSchema(RequestException, ValueError):
75 | """The URL schema (e.g. http or https) is missing."""
76 |
77 |
78 | class InvalidSchema(RequestException, ValueError):
79 | """See defaults.py for valid schemas."""
80 |
81 |
82 | class InvalidURL(RequestException, ValueError):
83 | """ The URL provided was somehow invalid. """
84 |
85 |
86 | class ChunkedEncodingError(RequestException):
87 | """The server declared chunked encoding but sent an invalid chunk."""
88 |
89 |
90 | class ContentDecodingError(RequestException, BaseHTTPError):
91 | """Failed to decode response content"""
92 |
93 |
94 | class StreamConsumedError(RequestException, TypeError):
95 | """The content for this response was already consumed"""
96 |
97 |
98 | class RetryError(RequestException):
99 | """Custom retries logic failed"""
100 |
101 |
102 | # Warnings
103 |
104 |
105 | class RequestsWarning(Warning):
106 | """Base warning for Requests."""
107 | pass
108 |
109 |
110 | class FileModeWarning(RequestsWarning, DeprecationWarning):
111 | """
112 | A file was opened in text mode, but Requests determined its binary length.
113 | """
114 | pass
115 |
--------------------------------------------------------------------------------
/docs/lwc.md:
--------------------------------------------------------------------------------
1 | # Lightning Web Component
2 | Lightning web components (`lwc`) are custom HTML elements built using HTML and modern JavaScript.
3 |
4 | **This feature works when api version is >= 45.0**
5 |
6 | ## Create Lightning Web Component
7 |
8 | Create `lwc` by clicking `HaoIDE -> New -> New Lightning Web Component` from the menu,
9 | and inputting the valid `lwc` name.
10 |
11 | For better convenience, will create the `lwc` as `LightningComponentBundle` with three `LwcResources`
12 | -- HTML file, JavaScript file and configuration file under the component's folder.
13 |
14 | ```
15 | myComponent
16 | ├──myComponent.html
17 | ├──myComponent.js
18 | └──myComponent.js-meta.xml
19 | ```
20 |
21 | ## Add CSS File
22 | From the component folder or file's sidebar context menu,
23 | click `HaoIDE -> Create Lwc Style`.
24 |
25 | ## Add SVG Icon
26 | From the component folder or file's sidebar context menu,
27 | click `HaoIDE -> Create Lwc SVG`.
28 |
29 | ## Add Additional JavaScript File(s)
30 |
31 | You can create Additional JavaScript files under the component's folder by yourself.
32 |
33 | Notice:
34 | >These additional JavaScript files must be ES6 modules and must have names that are unique within the component’s folder.
35 |
36 | ## Component Tests
37 |
38 | You can create Jest tests files following the official guide by yourself:
39 |
40 | >To create Jest tests for a component, create a folder called `__tests__` at the top level of the component’s folder.
41 | Save the tests inside the `__tests__` folder.
42 | Test files must have names that end in “.js”, and we recommend that tests end in “.test.js.
43 | >You can have a single test file with all of your component tests, or you can have multiple files to organize related tests. Test files can be placed in sub folders.
44 | ## Retrieve Bundle/File
45 | Two Approaches:
46 |
47 | 1. From the component folder or file's sidebar context menu,
48 | click `HaoIDE -> Retrieve Lightning From Server`.
49 | 2. From the opened component file's context menu, click `HaoIDE -> Retrieve From Server` or
50 | `HaoIDE -> Retrieve From This Server`.
51 |
52 | ## Deploy Bundle/File
53 | Two Approaches:
54 |
55 | 1. From the component folder or file's sidebar context menu,
56 | click `HaoIDE -> Deploy Lightning From Server`.
57 | 2. From the opened component file's context menu, click `HaoIDE -> Deploy To Server` or
58 | `HaoIDE -> Deploy To This Server`.
59 |
60 | ## Save Component File to Server
61 | `lwc`'s HTML markup, JavaScript code, CSS file, SVG resource, additional JS files
62 | can save to Salesforce as `LightningComponentResource` separately.
63 |
64 | From the opened component file's context menu, click `HaoIDE -> Deploy From Server` or
65 | `HaoIDE -> Save To Server`. or simply press `ctrl+alt+s`(Windows).
66 |
67 | If you cannot save certain file to server, try retrieving it from server first.
68 |
69 | **Notice:**
70 | XML configuration file (`js-meta.xml`) cannot save to server since the Metadata API does not support it.
71 |
72 | ## Destruct Component
73 | Two Approaches:
74 |
75 | 1. From the component folder or file's sidebar context menu,
76 | click `HaoIDE -> Destruct Lightning From Server`.
77 | 2. From the opened component file's context menu, click `HaoIDE -> Destruct From Server`.
78 |
79 | ## Reference
80 | [Lightning Web Components Developer Guide][1]
81 |
82 | [1]: https://developer.salesforce.com/docs/atlas.en-us.lwc.meta/lwc/lwc_intro.htm
--------------------------------------------------------------------------------
/docs/export.md:
--------------------------------------------------------------------------------
1 | # Export
2 | You can export somethings in your org to CSV by these features
3 |
4 | * Export CustomFields
5 | - Click ```HaoIDE``` > ```Export``` > ```Export CustomField```
6 | - ``CustomFields`` will be exported to ``Project/.export/CustomFields.csv``
7 |
8 | * Export Workflow Rules
9 | - Download metadata of ``sObjects and Workflow`` by clicking ```Metadata``` > ```Retrieve Sobject And Workflow``` in the main menu
10 | - Click ```Export``` > ```Export Workflow``` in the main menu to backup all workflows in your org to csv
11 | - ```workflow_rule_columns```, ``workflow_field_update_columns``, ``workflow_email_alert_columns``, ``workflow_outbound_message_columns`` and ``workflow_task_columns`` defines the columns of export CSV, you can adjust the sequence and columns by customizing your own value of this five settings
12 |
13 | * Export Validation Rules
14 | - Download metadata of ``sObjects and Workflow`` by clicking ```Metadata``` > ```Retrieve Sobject And Workflow``` in the main menu
15 | - Click ```Export``` > ```Export Validation Rule``` in the main menu
16 | - All ValidationRules in your org will be exported to ``Project/.export/ValidationRules.csv``
17 | - ```validation_rule_columns``` setting defines the columns of export CSV, you can adjust the sequence and columns by customizing your own value of this setting
18 |
19 | * Export Profile Workbook
20 | - Retrieve all metadata by clicking ``Metadata Migration`` > ``Retrieve All`` in the main menu to download all related components.
21 | - Click ``HaoIDE`` > ``Export`` > ``Export Profile`` in the main menu to export ``ObjectPermission``, ``TabVisibilities``, ``FieldLevelSecurity`` and ``UserPermissions`` of all profiles to four different CSV files, you can check below sample CSVs.
22 | - Exported profile csv from sample org
23 | + [FieldLevelSecurity.csv](https://github.com/xjsender/SublimeApexScreenshot/blob/master/CSV/Profile/FieldLevelSecurity.csv)
24 | + [ObjectPermissions.csv](https://github.com/xjsender/SublimeApexScreenshot/blob/master/CSV/Profile/ObjectPermissions.csv)
25 | + [TabVisibilities.csv](https://github.com/xjsender/SublimeApexScreenshot/blob/master/CSV/Profile/TabVisibilities.csv)
26 | + [UserPermissions.csv](https://github.com/xjsender/SublimeApexScreenshot/blob/master/CSV/Profile/UserPermissions.csv)
27 |
28 | * Export Role Hierarchy
29 | - Click ```HaoIDE``` > ```Export``` > ```Export Role Hierarchy```
30 | - ``Role Hierarchy`` will be exported to ``Project/.export/Role/hierarchy.csv``, see exported sample [hierarchy.csv](https://github.com/xjsender/SublimeApexScreenshot/blob/master/hierarchy.csv)
31 |
32 | * Export Workbook of sobjects
33 | - Click ``Export`` > ``Export Workbook`` in the main menu
34 | - Input * to export all sObject workbooks
35 | - Input sObject Names separated with semi-colon to export some
36 | - ``workbook_field_describe_columns`` setting define the columns
37 |
38 | * Export Data Template
39 | - Click ``Export`` > ``Export Data Template`` in the main menu
40 | - Waiting until ``sObject => RecordType`` quick panel is open
41 | - Choose one and press Enter and template will be exported
42 | - From the row 1 to row 6, they are,
43 | + [Field Label]...
44 | + [Field API]...
45 | + [Field Type]...
46 | + [Layout Required]...
47 | + [Picklist Label if has]...
48 | + [Picklist Value if has]
--------------------------------------------------------------------------------
/requests/structures.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | """
4 | requests.structures
5 | ~~~~~~~~~~~~~~~~~~~
6 |
7 | Data structures that power Requests.
8 |
9 | """
10 |
11 | import collections
12 |
13 |
14 | class CaseInsensitiveDict(collections.MutableMapping):
15 | """
16 | A case-insensitive ``dict``-like object.
17 |
18 | Implements all methods and operations of
19 | ``collections.MutableMapping`` as well as dict's ``copy``. Also
20 | provides ``lower_items``.
21 |
22 | All keys are expected to be strings. The structure remembers the
23 | case of the last key to be set, and ``iter(instance)``,
24 | ``keys()``, ``items()``, ``iterkeys()``, and ``iteritems()``
25 | will contain case-sensitive keys. However, querying and contains
26 | testing is case insensitive::
27 |
28 | cid = CaseInsensitiveDict()
29 | cid['Accept'] = 'application/json'
30 | cid['aCCEPT'] == 'application/json' # True
31 | list(cid) == ['Accept'] # True
32 |
33 | For example, ``headers['content-encoding']`` will return the
34 | value of a ``'Content-Encoding'`` response header, regardless
35 | of how the header name was originally stored.
36 |
37 | If the constructor, ``.update``, or equality comparison
38 | operations are given keys that have equal ``.lower()``s, the
39 | behavior is undefined.
40 |
41 | """
42 | def __init__(self, data=None, **kwargs):
43 | self._store = dict()
44 | if data is None:
45 | data = {}
46 | self.update(data, **kwargs)
47 |
48 | def __setitem__(self, key, value):
49 | # Use the lowercased key for lookups, but store the actual
50 | # key alongside the value.
51 | self._store[key.lower()] = (key, value)
52 |
53 | def __getitem__(self, key):
54 | return self._store[key.lower()][1]
55 |
56 | def __delitem__(self, key):
57 | del self._store[key.lower()]
58 |
59 | def __iter__(self):
60 | return (casedkey for casedkey, mappedvalue in self._store.values())
61 |
62 | def __len__(self):
63 | return len(self._store)
64 |
65 | def lower_items(self):
66 | """Like iteritems(), but with all lowercase keys."""
67 | return (
68 | (lowerkey, keyval[1])
69 | for (lowerkey, keyval)
70 | in self._store.items()
71 | )
72 |
73 | def __eq__(self, other):
74 | if isinstance(other, collections.Mapping):
75 | other = CaseInsensitiveDict(other)
76 | else:
77 | return NotImplemented
78 | # Compare insensitively
79 | return dict(self.lower_items()) == dict(other.lower_items())
80 |
81 | # Copy is required
82 | def copy(self):
83 | return CaseInsensitiveDict(self._store.values())
84 |
85 | def __repr__(self):
86 | return str(dict(self.items()))
87 |
88 | class LookupDict(dict):
89 | """Dictionary lookup object."""
90 |
91 | def __init__(self, name=None):
92 | self.name = name
93 | super(LookupDict, self).__init__()
94 |
95 | def __repr__(self):
96 | return '' % (self.name)
97 |
98 | def __getitem__(self, key):
99 | # We allow fall-through here, so values default to None
100 |
101 | return self.__dict__.get(key, None)
102 |
103 | def get(self, key, default=None):
104 | return self.__dict__.get(key, default)
105 |
--------------------------------------------------------------------------------
/libs/auth.py:
--------------------------------------------------------------------------------
1 | '''
2 | Inspired by requests_oauth2
3 | '''
4 |
5 | from .. import requests
6 | from urllib.parse import quote,urlencode
7 |
8 | import hmac
9 | import hashlib
10 | import base64
11 |
12 | class SalesforceOAuth2(object):
13 | authorization_url = '/services/oauth2/authorize'
14 | token_url = '/services/oauth2/token'
15 | revoke_url = '/services/oauth2/revoke'
16 |
17 | def __init__(self, client_id, client_secret, redirect_uri, login_url="https://test.salesforce.com", **kwargs):
18 | self.auth_site = login_url
19 | self.client_id = client_id
20 | self.client_secret = client_secret
21 | self.redirect_uri = redirect_uri
22 |
23 | def _request_token(self, data):
24 | url = "{site}{token_url}".format(
25 | site=self.auth_site, token_url=self.token_url)
26 | headers = {
27 | 'Content-Type': 'application/x-www-form-urlencoded'
28 | }
29 | post_data = {'client_id': self.client_id,
30 | 'client_secret': self.client_secret}
31 | post_data.update(data)
32 | result = requests.post(url, data=post_data, headers=headers, verify=False)
33 | return result, result.json()
34 |
35 | def authorize_url(self, username="", **kwargs):
36 | # Check below url for parameter detail
37 | # https://help.salesforce.com/articleView?id=remoteaccess_oauth_web_server_flow.htm&type=0
38 | fields = {
39 | 'response_type': 'token',
40 | 'client_id': self.client_id,
41 | 'redirect_uri': self.redirect_uri,
42 | 'prompt': 'login',
43 | 'login_hint': username,
44 | 'display': 'popup'
45 | }
46 | url = self.auth_site + self.authorization_url + '?' + urlencode(fields)
47 |
48 | return url
49 |
50 | def get_token(self, code):
51 | data = {
52 | 'grant_type': 'authorization_code',
53 | 'redirect_uri': self.redirect_uri,
54 | 'code': code
55 | }
56 | response, response_json = self._request_token(data)
57 | if 'access_token' in response_json:
58 | self.access_token = response_json['access_token']
59 | if 'refresh_token' in response_json:
60 | self.refresh_token = response_json['refresh_token']
61 | return response_json
62 |
63 | def refresh_token(self, refresh_token):
64 | data = {
65 | 'grant_type': 'refresh_token',
66 | 'refresh_token': refresh_token
67 | }
68 | response, response_json = self._request_token(data)
69 |
70 | if 'access_token' in response_json:
71 | self.access_token = response_json['access_token']
72 | return response_json
73 |
74 | def generate_signature(self, id, issued_at):
75 | data = "{id}{issued}".format(id=id, issued=issued_at)
76 | digest = hmac.new(
77 | self.client_secret, data, digestmod=hashlib.sha256).digest()
78 | return base64.b64encode(digest).decode()
79 |
80 | def revoke_token(self, current_token):
81 | # Perform a GET request, because that's by far the easiest way
82 | url = "{site}{revoke_url}".format(
83 | site=self.auth_site, revoke_url=self.revoke_url)
84 | data = {
85 | 'token': quote(current_token)
86 | }
87 | headers = {
88 | 'Content-Type': 'application/x-www-form-urlencoded'
89 | }
90 | return requests.post(url, data=data, headers=headers, verify=False)
91 |
--------------------------------------------------------------------------------
/requests/packages/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 | from . import constants
29 | from .escsm import (HZSMModel, ISO2022CNSMModel, ISO2022JPSMModel,
30 | ISO2022KRSMModel)
31 | from .charsetprober import CharSetProber
32 | from .codingstatemachine import CodingStateMachine
33 | from .compat import wrap_ord
34 |
35 |
36 | class EscCharSetProber(CharSetProber):
37 | def __init__(self):
38 | CharSetProber.__init__(self)
39 | self._mCodingSM = [
40 | CodingStateMachine(HZSMModel),
41 | CodingStateMachine(ISO2022CNSMModel),
42 | CodingStateMachine(ISO2022JPSMModel),
43 | CodingStateMachine(ISO2022KRSMModel)
44 | ]
45 | self.reset()
46 |
47 | def reset(self):
48 | CharSetProber.reset(self)
49 | for codingSM in self._mCodingSM:
50 | if not codingSM:
51 | continue
52 | codingSM.active = True
53 | codingSM.reset()
54 | self._mActiveSM = len(self._mCodingSM)
55 | self._mDetectedCharset = None
56 |
57 | def get_charset_name(self):
58 | return self._mDetectedCharset
59 |
60 | def get_confidence(self):
61 | if self._mDetectedCharset:
62 | return 0.99
63 | else:
64 | return 0.00
65 |
66 | def feed(self, aBuf):
67 | for c in aBuf:
68 | # PY3K: aBuf is a byte array, so c is an int, not a byte
69 | for codingSM in self._mCodingSM:
70 | if not codingSM:
71 | continue
72 | if not codingSM.active:
73 | continue
74 | codingState = codingSM.next_state(wrap_ord(c))
75 | if codingState == constants.eError:
76 | codingSM.active = False
77 | self._mActiveSM -= 1
78 | if self._mActiveSM <= 0:
79 | self._mState = constants.eNotMe
80 | return self.get_state()
81 | elif codingState == constants.eItsMe:
82 | self._mState = constants.eFoundIt
83 | self._mDetectedCharset = codingSM.get_coding_state_machine() # nopep8
84 | return self.get_state()
85 |
86 | return self.get_state()
87 |
--------------------------------------------------------------------------------
/requests/packages/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 | from .charsetgroupprober import CharSetGroupProber
30 | from .sbcharsetprober import SingleByteCharSetProber
31 | from .langcyrillicmodel import (Win1251CyrillicModel, Koi8rModel,
32 | Latin5CyrillicModel, MacCyrillicModel,
33 | 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 |
42 | class SBCSGroupProber(CharSetGroupProber):
43 | def __init__(self):
44 | CharSetGroupProber.__init__(self)
45 | self._mProbers = [
46 | SingleByteCharSetProber(Win1251CyrillicModel),
47 | SingleByteCharSetProber(Koi8rModel),
48 | SingleByteCharSetProber(Latin5CyrillicModel),
49 | SingleByteCharSetProber(MacCyrillicModel),
50 | SingleByteCharSetProber(Ibm866Model),
51 | SingleByteCharSetProber(Ibm855Model),
52 | SingleByteCharSetProber(Latin7GreekModel),
53 | SingleByteCharSetProber(Win1253GreekModel),
54 | SingleByteCharSetProber(Latin5BulgarianModel),
55 | SingleByteCharSetProber(Win1251BulgarianModel),
56 | SingleByteCharSetProber(Latin2HungarianModel),
57 | SingleByteCharSetProber(Win1250HungarianModel),
58 | SingleByteCharSetProber(TIS620ThaiModel),
59 | ]
60 | hebrewProber = HebrewProber()
61 | logicalHebrewProber = SingleByteCharSetProber(Win1255HebrewModel,
62 | False, hebrewProber)
63 | visualHebrewProber = SingleByteCharSetProber(Win1255HebrewModel, True,
64 | hebrewProber)
65 | hebrewProber.set_model_probers(logicalHebrewProber, visualHebrewProber)
66 | self._mProbers.extend([hebrewProber, logicalHebrewProber,
67 | visualHebrewProber])
68 |
69 | self.reset()
70 |
--------------------------------------------------------------------------------
/bulk.py:
--------------------------------------------------------------------------------
1 | import sublime
2 | import sublime_plugin
3 | import os
4 | from . import util
5 | from . import processor
6 | from .salesforce.lib.panel import Printer
7 |
8 | class CloseJobsCommand(sublime_plugin.WindowCommand):
9 | def __init__(self, *args, **kwargs):
10 | super(CloseJobsCommand, self).__init__(*args, **kwargs)
11 |
12 | def run(self):
13 | self.window.show_input_panel("Input JobId (Separated By ','): ", "", self.on_input, None, None)
14 |
15 | def on_input(self, input):
16 | if not input:
17 | Printer.get("error").write("Please input job ids that is separated by ','")
18 | return
19 |
20 | job_ids = input.split(",")
21 | processor.handle_close_jobs_thread(job_ids)
22 |
23 | class BulkExportSingleCommand(sublime_plugin.WindowCommand):
24 | def __init__(self, *args, **kwargs):
25 | super(BulkExportSingleCommand, self).__init__(*args, **kwargs)
26 |
27 | def run(self, export_soql=False):
28 | self.export_soql = export_soql
29 | sobjects_describe = util.populate_sobjects_describe()
30 | self.sobjects = sorted(sobjects_describe.keys())
31 | self.window.show_quick_panel(self.sobjects, self.on_done)
32 |
33 | def on_done(self, index):
34 | if index == -1: return
35 | self.chosen_sobject = self.sobjects[index]
36 | if not self.export_soql:
37 | processor.handle_backup_sobject_thread(self.chosen_sobject)
38 | else:
39 | self.window.show_input_panel("Input SOQL: ", "", self.on_input, None, None)
40 |
41 | def on_input(self, soql):
42 | if not soql or not soql.upper().startswith("SELECT"):
43 | Printer.get("error").write("Invalid SOQL")
44 | return
45 |
46 | processor.handle_backup_sobject_thread(self.chosen_sobject, soql)
47 |
48 | class BulkExportAllCommand(sublime_plugin.WindowCommand):
49 | def __init__(self, *args, **kwargs):
50 | super(BulkExportAllCommand, self).__init__(*args, **kwargs)
51 |
52 | def run(self):
53 | processor.handle_backup_all_sobjects_thread()
54 |
55 | class BulkOperationCommand(sublime_plugin.WindowCommand):
56 | def __init__(self, *args, **kwargs):
57 | super(BulkOperationCommand, self).__init__(*args, **kwargs)
58 |
59 | def run(self, operation=None):
60 | self.operation = operation
61 | sobjects_describe = util.populate_sobjects_describe()
62 | self.sobjects = sorted(sobjects_describe.keys())
63 | self.window.show_quick_panel(self.sobjects, self.on_done)
64 |
65 | def on_done(self, index):
66 | if index == -1: return
67 | self.sobject = self.sobjects[index]
68 | path = sublime.get_clipboard()
69 | if not os.path.isfile(path): path = ""
70 | self.window.show_input_panel("Input CSV Path: ",
71 | path, self.on_input, None, None)
72 |
73 | def on_input(self, file_path):
74 | if not file_path.endswith('csv'):
75 | Printer.get("error").write("Input file must be CSV")
76 | return
77 |
78 | if not os.path.exists(file_path):
79 | Printer.get("error").write(file_path + " is not valid file")
80 | return
81 |
82 | processor.handle_bulk_operation_thread(self.sobject, file_path, self.operation)
83 |
84 | class BulkUpsertCommand(sublime_plugin.WindowCommand):
85 | def __init__(self, *args, **kwargs):
86 | super(BulkUpsertCommand, self).__init__(*args, **kwargs)
87 |
88 | def run(self):
89 | sublime.message_dialog("This command is ongoing")
--------------------------------------------------------------------------------
/libs/cherrypy/wsgiserver/ssl_builtin.py:
--------------------------------------------------------------------------------
1 | """A library for integrating Python's builtin ``ssl`` library with CherryPy.
2 |
3 | The ssl module must be importable for SSL functionality.
4 |
5 | To use this module, set ``CherryPyWSGIServer.ssl_adapter`` to an instance of
6 | ``BuiltinSSLAdapter``.
7 | """
8 |
9 | try:
10 | import ssl
11 | except ImportError:
12 | ssl = None
13 |
14 | try:
15 | from _pyio import DEFAULT_BUFFER_SIZE
16 | except ImportError:
17 | try:
18 | from io import DEFAULT_BUFFER_SIZE
19 | except ImportError:
20 | DEFAULT_BUFFER_SIZE = -1
21 |
22 | import sys
23 |
24 | from cherrypy import wsgiserver
25 |
26 |
27 | class BuiltinSSLAdapter(wsgiserver.SSLAdapter):
28 | """A wrapper for integrating Python's builtin ssl module with CherryPy."""
29 |
30 | certificate = None
31 | """The filename of the server SSL certificate."""
32 |
33 | private_key = None
34 | """The filename of the server's private key file."""
35 |
36 | def __init__(self, certificate, private_key, certificate_chain=None):
37 | if ssl is None:
38 | raise ImportError("You must install the ssl module to use HTTPS.")
39 | self.certificate = certificate
40 | self.private_key = private_key
41 | self.certificate_chain = certificate_chain
42 |
43 | def bind(self, sock):
44 | """Wrap and return the given socket."""
45 | return sock
46 |
47 | def wrap(self, sock):
48 | """Wrap and return the given socket, plus WSGI environ entries."""
49 | try:
50 | s = ssl.wrap_socket(sock, do_handshake_on_connect=True,
51 | server_side=True, certfile=self.certificate,
52 | keyfile=self.private_key, ssl_version=ssl.PROTOCOL_SSLv23)
53 | except ssl.SSLError:
54 | e = sys.exc_info()[1]
55 | if e.errno == ssl.SSL_ERROR_EOF:
56 | # This is almost certainly due to the cherrypy engine
57 | # 'pinging' the socket to assert it's connectable;
58 | # the 'ping' isn't SSL.
59 | return None, {}
60 | elif e.errno == ssl.SSL_ERROR_SSL:
61 | if e.args[1].endswith('http request'):
62 | # The client is speaking HTTP to an HTTPS server.
63 | raise wsgiserver.NoSSLError
64 | elif e.args[1].endswith('unknown protocol'):
65 | # The client is speaking some non-HTTP protocol.
66 | # Drop the conn.
67 | return None, {}
68 | raise
69 | return s, self.get_environ(s)
70 |
71 | # TODO: fill this out more with mod ssl env
72 | def get_environ(self, sock):
73 | """Create WSGI environ entries to be merged into each request."""
74 | cipher = sock.cipher()
75 | ssl_environ = {
76 | "wsgi.url_scheme": "https",
77 | "HTTPS": "on",
78 | 'SSL_PROTOCOL': cipher[1],
79 | 'SSL_CIPHER': cipher[0]
80 | ## SSL_VERSION_INTERFACE string The mod_ssl program version
81 | ## SSL_VERSION_LIBRARY string The OpenSSL program version
82 | }
83 | return ssl_environ
84 |
85 | if sys.version_info >= (3, 0):
86 | def makefile(self, sock, mode='r', bufsize=DEFAULT_BUFFER_SIZE):
87 | return wsgiserver.CP_makefile(sock, mode, bufsize)
88 | else:
89 | def makefile(self, sock, mode='r', bufsize=DEFAULT_BUFFER_SIZE):
90 | return wsgiserver.CP_fileobject(sock, mode, bufsize)
91 |
92 |
--------------------------------------------------------------------------------
/requests/packages/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 .charsetprober import CharSetProber
33 |
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 == constants.eError:
58 | if constants._debug:
59 | sys.stderr.write(self.get_charset_name()
60 | + ' prober hit error at byte ' + str(i)
61 | + '\n')
62 | self._mState = constants.eNotMe
63 | break
64 | elif codingState == constants.eItsMe:
65 | self._mState = constants.eFoundIt
66 | break
67 | elif codingState == constants.eStart:
68 | charLen = self._mCodingSM.get_current_charlen()
69 | if i == 0:
70 | self._mLastChar[1] = aBuf[0]
71 | self._mDistributionAnalyzer.feed(self._mLastChar, charLen)
72 | else:
73 | self._mDistributionAnalyzer.feed(aBuf[i - 1:i + 1],
74 | charLen)
75 |
76 | self._mLastChar[0] = aBuf[aLen - 1]
77 |
78 | if self.get_state() == constants.eDetecting:
79 | if (self._mDistributionAnalyzer.got_enough_data() and
80 | (self.get_confidence() > constants.SHORTCUT_THRESHOLD)):
81 | self._mState = constants.eFoundIt
82 |
83 | return self.get_state()
84 |
85 | def get_confidence(self):
86 | return self._mDistributionAnalyzer.get_confidence()
87 |
--------------------------------------------------------------------------------
/requests/status_codes.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | from .structures import LookupDict
4 |
5 | _codes = {
6 |
7 | # Informational.
8 | 100: ('continue',),
9 | 101: ('switching_protocols',),
10 | 102: ('processing',),
11 | 103: ('checkpoint',),
12 | 122: ('uri_too_long', 'request_uri_too_long'),
13 | 200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/', '✓'),
14 | 201: ('created',),
15 | 202: ('accepted',),
16 | 203: ('non_authoritative_info', 'non_authoritative_information'),
17 | 204: ('no_content',),
18 | 205: ('reset_content', 'reset'),
19 | 206: ('partial_content', 'partial'),
20 | 207: ('multi_status', 'multiple_status', 'multi_stati', 'multiple_stati'),
21 | 208: ('already_reported',),
22 | 226: ('im_used',),
23 |
24 | # Redirection.
25 | 300: ('multiple_choices',),
26 | 301: ('moved_permanently', 'moved', '\\o-'),
27 | 302: ('found',),
28 | 303: ('see_other', 'other'),
29 | 304: ('not_modified',),
30 | 305: ('use_proxy',),
31 | 306: ('switch_proxy',),
32 | 307: ('temporary_redirect', 'temporary_moved', 'temporary'),
33 | 308: ('permanent_redirect',
34 | 'resume_incomplete', 'resume',), # These 2 to be removed in 3.0
35 |
36 | # Client Error.
37 | 400: ('bad_request', 'bad'),
38 | 401: ('unauthorized',),
39 | 402: ('payment_required', 'payment'),
40 | 403: ('forbidden',),
41 | 404: ('not_found', '-o-'),
42 | 405: ('method_not_allowed', 'not_allowed'),
43 | 406: ('not_acceptable',),
44 | 407: ('proxy_authentication_required', 'proxy_auth', 'proxy_authentication'),
45 | 408: ('request_timeout', 'timeout'),
46 | 409: ('conflict',),
47 | 410: ('gone',),
48 | 411: ('length_required',),
49 | 412: ('precondition_failed', 'precondition'),
50 | 413: ('request_entity_too_large',),
51 | 414: ('request_uri_too_large',),
52 | 415: ('unsupported_media_type', 'unsupported_media', 'media_type'),
53 | 416: ('requested_range_not_satisfiable', 'requested_range', 'range_not_satisfiable'),
54 | 417: ('expectation_failed',),
55 | 418: ('im_a_teapot', 'teapot', 'i_am_a_teapot'),
56 | 422: ('unprocessable_entity', 'unprocessable'),
57 | 423: ('locked',),
58 | 424: ('failed_dependency', 'dependency'),
59 | 425: ('unordered_collection', 'unordered'),
60 | 426: ('upgrade_required', 'upgrade'),
61 | 428: ('precondition_required', 'precondition'),
62 | 429: ('too_many_requests', 'too_many'),
63 | 431: ('header_fields_too_large', 'fields_too_large'),
64 | 444: ('no_response', 'none'),
65 | 449: ('retry_with', 'retry'),
66 | 450: ('blocked_by_windows_parental_controls', 'parental_controls'),
67 | 451: ('unavailable_for_legal_reasons', 'legal_reasons'),
68 | 499: ('client_closed_request',),
69 |
70 | # Server Error.
71 | 500: ('internal_server_error', 'server_error', '/o\\', '✗'),
72 | 501: ('not_implemented',),
73 | 502: ('bad_gateway',),
74 | 503: ('service_unavailable', 'unavailable'),
75 | 504: ('gateway_timeout',),
76 | 505: ('http_version_not_supported', 'http_version'),
77 | 506: ('variant_also_negotiates',),
78 | 507: ('insufficient_storage',),
79 | 509: ('bandwidth_limit_exceeded', 'bandwidth'),
80 | 510: ('not_extended',),
81 | 511: ('network_authentication_required', 'network_auth', 'network_authentication'),
82 | }
83 |
84 | codes = LookupDict(name='status_codes')
85 |
86 | for code, titles in _codes.items():
87 | for title in titles:
88 | setattr(codes, title, code)
89 | if not title.startswith('\\'):
90 | setattr(codes, title.upper(), code)
91 |
--------------------------------------------------------------------------------
/config/snippets/Apex/Class Body - roll up summary utility.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 | records,
5 | String parentLookupField,
6 | List fieldDefs,
7 | String filter) {
8 |
9 | Set parentIds = new Set();
10 | for (Sobject so : records) {
11 | if (so.get(parentLookupField) != null) {
12 | parentIds.add((Id)so.get(parentLookupField));
13 | }
14 | }
15 |
16 | // Combine Aggregate Fields
17 | // If you want to summary record count child object,
18 | // you should use Name field but not Id field
19 | List aggregateFields = new List();
20 | for (FieldDefinition fd : fieldDefs) {
21 | aggregateFields.add(String.format('{0}({1}) {1}', new List {
22 | fd.operation, fd.childField
23 | }));
24 | }
25 |
26 | // Build Aggregate Query
27 | String query = String.format(
28 | 'SELECT {0}, {1} FROM {2} WHERE {1} IN :parentIds {3} GROUP BY {1}',
29 | new List {
30 | String.join(aggregateFields, ', '),
31 | parentLookupField,
32 | records.getSObjectType().getDescribe().getName(),
33 | filter
34 | }
35 | );
36 |
37 | Map aggrResultsMap = new Map();
38 | for (AggregateResult aggr : Database.query(query)) {
39 | Id parentId = (Id)aggr.get(parentLookupField);
40 | aggrResultsMap.put(parentId, aggr);
41 | }
42 |
43 | // Assign summary value to parent records
44 | List parentsNeedToUpdate = new List();
45 | for (Id parentId : parentIds) {
46 | // Initiate sobject
47 | Sobject parent = parentId.getSObjectType().newSObject(parentId);
48 |
49 | // Get the AggregateResult by ParentLookupId
50 | AggregateResult aggrResult = aggrResultsMap.get(parent.Id);
51 |
52 | // If no aggrResult, it means Parent doesn't have child records
53 | // else, just assign the sum to the corresponding field
54 | for (FieldDefinition fd : fieldDefs) {
55 | String childField = fd.childField;
56 | String parentField = fd.parentField;
57 | Decimal summary = aggrResult == null ? 0 : (Decimal)aggrResult.get(childField);
58 | parent.put(parentField, summary.setScale(2));
59 | }
60 |
61 | parentsNeedToUpdate.add(parent);
62 | }
63 |
64 | // Update Parent
65 | try {
66 | update parentsNeedToUpdate;
67 | }
68 | catch (DMLException e) {
69 | for (Integer i = 0; i < e.getNumDml(); i++) {
70 | if (trigger.isDelete) {
71 | trigger.old[0].addError(e.getDMLMessage(i));
72 | }
73 | else {
74 | trigger.new[0].addError(e.getDMLMessage(i));
75 | }
76 | }
77 | }
78 | }
79 |
80 | public class FieldDefinition {
81 | public String childField;
82 | public String parentField;
83 | public String operation;
84 |
85 | public FieldDefinition(String o, String c, String p) {
86 | this.operation = o;
87 | this.childField = c;
88 | this.parentField = p;
89 | }
90 | }
91 | }
92 | ]]>
93 | rollu
94 | source.java, source.apex
95 | Rollup Summary Utility
96 |
97 |
--------------------------------------------------------------------------------
/requests/packages/urllib3/util/connection.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import
2 | import socket
3 | try:
4 | from select import poll, POLLIN
5 | except ImportError: # `poll` doesn't exist on OSX and other platforms
6 | poll = False
7 | try:
8 | from select import select
9 | except ImportError: # `select` doesn't exist on AppEngine.
10 | select = False
11 |
12 |
13 | def is_connection_dropped(conn): # Platform-specific
14 | """
15 | Returns True if the connection is dropped and should be closed.
16 |
17 | :param conn:
18 | :class:`httplib.HTTPConnection` object.
19 |
20 | Note: For platforms like AppEngine, this will always return ``False`` to
21 | let the platform handle connection recycling transparently for us.
22 | """
23 | sock = getattr(conn, 'sock', False)
24 | if sock is False: # Platform-specific: AppEngine
25 | return False
26 | if sock is None: # Connection already closed (such as by httplib).
27 | return True
28 |
29 | if not poll:
30 | if not select: # Platform-specific: AppEngine
31 | return False
32 |
33 | try:
34 | return select([sock], [], [], 0.0)[0]
35 | except socket.error:
36 | return True
37 |
38 | # This version is better on platforms that support it.
39 | p = poll()
40 | p.register(sock, POLLIN)
41 | for (fno, ev) in p.poll(0.0):
42 | if fno == sock.fileno():
43 | # Either data is buffered (bad), or the connection is dropped.
44 | return True
45 |
46 |
47 | # This function is copied from socket.py in the Python 2.7 standard
48 | # library test suite. Added to its signature is only `socket_options`.
49 | def create_connection(address, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
50 | source_address=None, socket_options=None):
51 | """Connect to *address* and return the socket object.
52 |
53 | Convenience function. Connect to *address* (a 2-tuple ``(host,
54 | port)``) and return the socket object. Passing the optional
55 | *timeout* parameter will set the timeout on the socket instance
56 | before attempting to connect. If no *timeout* is supplied, the
57 | global default timeout setting returned by :func:`getdefaulttimeout`
58 | is used. If *source_address* is set it must be a tuple of (host, port)
59 | for the socket to bind as a source address before making the connection.
60 | An host of '' or port 0 tells the OS to use the default.
61 | """
62 |
63 | host, port = address
64 | if host.startswith('['):
65 | host = host.strip('[]')
66 | err = None
67 | for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM):
68 | af, socktype, proto, canonname, sa = res
69 | sock = None
70 | try:
71 | sock = socket.socket(af, socktype, proto)
72 |
73 | # If provided, set socket level options before connecting.
74 | # This is the only addition urllib3 makes to this function.
75 | _set_socket_options(sock, socket_options)
76 |
77 | if timeout is not socket._GLOBAL_DEFAULT_TIMEOUT:
78 | sock.settimeout(timeout)
79 | if source_address:
80 | sock.bind(source_address)
81 | sock.connect(sa)
82 | return sock
83 |
84 | except socket.error as e:
85 | err = e
86 | if sock is not None:
87 | sock.close()
88 | sock = None
89 |
90 | if err is not None:
91 | raise err
92 |
93 | raise socket.error("getaddrinfo returns an empty list")
94 |
95 |
96 | def _set_socket_options(sock, options):
97 | if options is None:
98 | return
99 |
100 | for opt in options:
101 | sock.setsockopt(*opt)
102 |
--------------------------------------------------------------------------------
/docs/deploy.md:
--------------------------------------------------------------------------------
1 | # Deploy
2 | There has a setting ``switch_back_after_migration`` to control whether switch back to original project after deploy is finished, default value is ``true``
3 |
4 | * Deploy Package Zip Step by Step, [demo](https://raw.githubusercontent.com/xjsender/SublimeApexScreenshot/master/DeployZip.gif) is here
5 | - Click ```HaoIDE``` > ```Metadata Migration``` > ```Deploy Package.zip``` in the main menu
6 | - Input your zip file path and click Enter
7 | - Waiting and checking the progress message in the output panel
8 | - After operation is finished, you will see the deploy result
9 |
10 | * Refresh Folders Step by Step
11 | - Choose the folders to refresh in the side bar
12 | - Click ```HaoIDE > Refresh Folder`` in the sidebar menu
13 | - Waiting for operation is finished until retrieve is finished
14 |
15 | * Deploy Files to Server Step by Step
16 | - Choose the files to deploy in the sidebar menu or context menu
17 | - Click ```HaoIDE``` > ```Deploy File to Server``` in the context menu
18 | - Choose the target organization to deploy chosen files
19 | - Waiting and checking the progress message in the output panel
20 | - After operation is finished, you will see the deploy result
21 |
22 | * Deploy Open Files Step by Step
23 | - Sometimes, when you want to deploy class, page or somethings else, however, you didn't want to choose them in the sidebar when there are huge number of code files, you can open the files that you want to deploy to server and Click ```HaoIDE``` > ```Metadata Migration``` > ```Deploy Open Files``` in the main menu to deploy multiply files to target server.
24 |
25 | - Actually, you can even open code files in different orgs and deploy them to the same org, for example, there have three classes to be deployed, A and B are in UAT environment and they are newly developed feature, C in UAT environment is completely different with production environment and there is urgent bug needed to be fixed in production, so at this moment, you can open A and B classes in UAT and the fixed version of C class in production and click ```Deploy Open Files``` to deploy the three class from different orgs to production environment.
26 |
27 | - This command is just enabled when any one of open files is salesforce code files.
28 |
29 | * Deploy Package Folder Step by Step, [demo](https://raw.githubusercontent.com/xjsender/SublimeApexScreenshot/master/DeployPackageFolder.gif) is here, if you just want to run specified test, you can change your ``testLevel`` in the ``deploy_options`` setting.
30 | - Choose a valid package folder, for example, ``src`` folder or ``Project/src``, plugin will check whether ``src`` folder contains ``package.xml`` file, if yes, you will ``Deploy To Server`` command in the sidebar menu, otherwise, ``Deploy To Server`` will be hidden
31 | - Click the ```Deploy To Server`` command
32 | - Waiting and checking the progress message in the output panel
33 | - After operation is finished, you will see the deploy result
34 |
35 |
36 | * Deploy and destruct files at same time
37 | - There is a ``file_exclude_patterns`` in the default settings, which is used to hide file in the sidebar, remove the ``"*.*-meta.xml"`` from it and paste this setting to your ``User Settings``
38 | - After ```file_exclude_patterns``` is changed, click ``HaoIDE > Update > Update Project Pattern``, and then you will see the ``*-meta.xml`` files in the sidebar.
39 | - If you want to delete a class or trigger, you just need to update the ``*.-meta.xml`` file as below,
40 | ```xml
41 |
42 |
43 | 32.0
44 | deleted
45 |
46 | ```
47 | - Choose the file to delete, update or created into other org and click ```HaoIDE > Deploy Files To Server```
48 | - After deploy is finished, you will see the result.
49 |
--------------------------------------------------------------------------------
/requests/packages/chardet/eucjpprober.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 .mbcharsetprober import MultiByteCharSetProber
31 | from .codingstatemachine import CodingStateMachine
32 | from .chardistribution import EUCJPDistributionAnalysis
33 | from .jpcntx import EUCJPContextAnalysis
34 | from .mbcssm import EUCJPSMModel
35 |
36 |
37 | class EUCJPProber(MultiByteCharSetProber):
38 | def __init__(self):
39 | MultiByteCharSetProber.__init__(self)
40 | self._mCodingSM = CodingStateMachine(EUCJPSMModel)
41 | self._mDistributionAnalyzer = EUCJPDistributionAnalysis()
42 | self._mContextAnalyzer = EUCJPContextAnalysis()
43 | self.reset()
44 |
45 | def reset(self):
46 | MultiByteCharSetProber.reset(self)
47 | self._mContextAnalyzer.reset()
48 |
49 | def get_charset_name(self):
50 | return "EUC-JP"
51 |
52 | def feed(self, aBuf):
53 | aLen = len(aBuf)
54 | for i in range(0, aLen):
55 | # PY3K: aBuf is a byte array, so aBuf[i] is an int, not a byte
56 | codingState = self._mCodingSM.next_state(aBuf[i])
57 | if codingState == constants.eError:
58 | if constants._debug:
59 | sys.stderr.write(self.get_charset_name()
60 | + ' prober hit error at byte ' + str(i)
61 | + '\n')
62 | self._mState = constants.eNotMe
63 | break
64 | elif codingState == constants.eItsMe:
65 | self._mState = constants.eFoundIt
66 | break
67 | elif codingState == constants.eStart:
68 | charLen = self._mCodingSM.get_current_charlen()
69 | if i == 0:
70 | self._mLastChar[1] = aBuf[0]
71 | self._mContextAnalyzer.feed(self._mLastChar, charLen)
72 | self._mDistributionAnalyzer.feed(self._mLastChar, charLen)
73 | else:
74 | self._mContextAnalyzer.feed(aBuf[i - 1:i + 1], charLen)
75 | self._mDistributionAnalyzer.feed(aBuf[i - 1:i + 1],
76 | charLen)
77 |
78 | self._mLastChar[0] = aBuf[aLen - 1]
79 |
80 | if self.get_state() == constants.eDetecting:
81 | if (self._mContextAnalyzer.got_enough_data() and
82 | (self.get_confidence() > constants.SHORTCUT_THRESHOLD)):
83 | self._mState = constants.eFoundIt
84 |
85 | return self.get_state()
86 |
87 | def get_confidence(self):
88 | contxtCf = self._mContextAnalyzer.get_confidence()
89 | distribCf = self._mDistributionAnalyzer.get_confidence()
90 | return max(contxtCf, distribCf)
91 |
--------------------------------------------------------------------------------
/requests/packages/chardet/sjisprober.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 .mbcharsetprober import MultiByteCharSetProber
30 | from .codingstatemachine import CodingStateMachine
31 | from .chardistribution import SJISDistributionAnalysis
32 | from .jpcntx import SJISContextAnalysis
33 | from .mbcssm import SJISSMModel
34 | from . import constants
35 |
36 |
37 | class SJISProber(MultiByteCharSetProber):
38 | def __init__(self):
39 | MultiByteCharSetProber.__init__(self)
40 | self._mCodingSM = CodingStateMachine(SJISSMModel)
41 | self._mDistributionAnalyzer = SJISDistributionAnalysis()
42 | self._mContextAnalyzer = SJISContextAnalysis()
43 | self.reset()
44 |
45 | def reset(self):
46 | MultiByteCharSetProber.reset(self)
47 | self._mContextAnalyzer.reset()
48 |
49 | def get_charset_name(self):
50 | return self._mContextAnalyzer.get_charset_name()
51 |
52 | def feed(self, aBuf):
53 | aLen = len(aBuf)
54 | for i in range(0, aLen):
55 | codingState = self._mCodingSM.next_state(aBuf[i])
56 | if codingState == constants.eError:
57 | if constants._debug:
58 | sys.stderr.write(self.get_charset_name()
59 | + ' prober hit error at byte ' + str(i)
60 | + '\n')
61 | self._mState = constants.eNotMe
62 | break
63 | elif codingState == constants.eItsMe:
64 | self._mState = constants.eFoundIt
65 | break
66 | elif codingState == constants.eStart:
67 | charLen = self._mCodingSM.get_current_charlen()
68 | if i == 0:
69 | self._mLastChar[1] = aBuf[0]
70 | self._mContextAnalyzer.feed(self._mLastChar[2 - charLen:],
71 | charLen)
72 | self._mDistributionAnalyzer.feed(self._mLastChar, charLen)
73 | else:
74 | self._mContextAnalyzer.feed(aBuf[i + 1 - charLen:i + 3
75 | - charLen], charLen)
76 | self._mDistributionAnalyzer.feed(aBuf[i - 1:i + 1],
77 | charLen)
78 |
79 | self._mLastChar[0] = aBuf[aLen - 1]
80 |
81 | if self.get_state() == constants.eDetecting:
82 | if (self._mContextAnalyzer.got_enough_data() and
83 | (self.get_confidence() > constants.SHORTCUT_THRESHOLD)):
84 | self._mState = constants.eFoundIt
85 |
86 | return self.get_state()
87 |
88 | def get_confidence(self):
89 | contxtCf = self._mContextAnalyzer.get_confidence()
90 | distribCf = self._mDistributionAnalyzer.get_confidence()
91 | return max(contxtCf, distribCf)
92 |
--------------------------------------------------------------------------------