public PythonParserInternal(IPythonRuntime runtime)
 {
     if (runtime == null)
     {
         throw new ArgumentNullException("runtime");
     }
     m_Runtime = runtime;
 }
		internal static PythonParserInternal GetParser (IPythonRuntime runtime)
		{
			if (runtime == null)
				throw new ArgumentNullException ("runtime");
			
			lock (s_syncRoot) {
				if (!s_parsers.ContainsKey (runtime.GetType ())) {
					s_parsers [runtime.GetType ()] = new PythonParserInternal (runtime);
				}
			}
			
			return s_parsers [runtime.GetType ()];
		}
Example #3
0
        internal static PythonParserInternal GetParser(IPythonRuntime runtime)
        {
            if (runtime == null)
            {
                throw new ArgumentNullException("runtime");
            }

            lock (s_syncRoot) {
                if (!s_parsers.ContainsKey(runtime.GetType()))
                {
                    s_parsers [runtime.GetType()] = new PythonParserInternal(runtime);
                }
            }

            return(s_parsers [runtime.GetType()]);
        }
Example #4
0
        public override void CopyFrom(ItemConfiguration config)
        {
            PythonConfiguration pyConfig = config as PythonConfiguration;

            if (pyConfig == null)
            {
                throw new ArgumentException("not a PythonConfiguration");
            }

            base.CopyFrom(config);

            this.m_Module        = pyConfig.Module;
            this.m_Runtime       = (IPythonRuntime)pyConfig.Runtime.Clone();
            this.m_Optimize      = pyConfig.Optimize;
            this.m_PythonOptions = pyConfig.PythonOptions;
        }
Example #5
0
        public PythonSiteImpl(IPythonRuntime runtime)
        {
            string name       = runtime.GetType().Name;
            string configPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
            string dbPath     = PathCombine(configPath, "MonoDevelop", "PyBinding", "Sites", name, "completion.db");

            m_pathsPath = PathCombine(configPath, "MonoDevelop", "PyBinding", "Sites", name, "paths");

            if (File.Exists(m_pathsPath))
            {
                foreach (var line in File.ReadAllLines(m_pathsPath))
                {
                    string trimmed = line.Trim();
                    if (!String.IsNullOrEmpty(line))
                    {
                        m_Paths.Add(trimmed);
                    }
                }
            }

            m_Database = new ParserDatabase(dbPath);
            m_Database.Open();
            m_parser = ParserManager.GetParser(runtime);
        }
Example #6
0
 public PythonParser() : base("Python", "text/x-python")
 {
     m_defaultRuntime = PythonHelper.FindPreferedRuntime();
 }
		public PythonParser () : base ("Python", "text/x-python")
		{
			m_defaultRuntime = PythonHelper.FindPreferedRuntime ();
		}
Example #8
0
 public PythonSite(IPythonRuntime runtime)
 {
     m_runtime     = runtime;
     m_runtimeType = runtime.GetType();
 }
Example #9
0
		public PythonParser ()
		{
			m_defaultRuntime = PythonHelper.FindPreferedRuntime ();
		}
		public PythonParserInternal (IPythonRuntime runtime)
		{
			if (runtime == null)
				throw new ArgumentNullException ("runtime");
			m_Runtime = runtime;
		}
Example #11
0
		public override void CopyFrom (ItemConfiguration config)
		{
			PythonConfiguration pyConfig = config as PythonConfiguration;
			
			if (pyConfig == null)
				throw new ArgumentException ("not a PythonConfiguration");
			
			base.CopyFrom (config);
			
			this.m_Module        = pyConfig.Module;
			this.m_Runtime       = (IPythonRuntime) pyConfig.Runtime.Clone ();
			this.m_Optimize      = pyConfig.Optimize;
			this.m_PythonOptions = pyConfig.PythonOptions;
		}
Example #12
0
		public PythonConfiguration ()
		{
			this.m_Runtime = PythonHelper.FindPreferedRuntime ();
			this.m_Module = s_DefaultModule;
		}
Example #13
0
		public PythonSite (IPythonRuntime runtime)
		{
			m_runtime = runtime;
			m_runtimeType = runtime.GetType ();
		}
Example #14
0
		public PythonSiteImpl (IPythonRuntime runtime)
		{
			string name = runtime.GetType ().Name;
			string configPath = Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData);
			string dbPath = PathCombine (configPath, "MonoDevelop", "PyBinding", "Sites", name, "completion.db");
			m_pathsPath = PathCombine (configPath, "MonoDevelop", "PyBinding", "Sites", name, "paths");
			
			if (File.Exists (m_pathsPath)) {
				foreach (var line in File.ReadAllLines (m_pathsPath)) {
					string trimmed = line.Trim ();
					if (!String.IsNullOrEmpty (line))
						m_Paths.Add (trimmed);
				}
			}
			
			m_Database = new ParserDatabase (dbPath);
			m_Database.Open ();
			m_parser = ParserManager.GetParser (runtime);
		}
Example #15
0
 public PythonParser()
 {
     m_defaultRuntime = PythonHelper.FindPreferedRuntime();
 }
Example #16
0
 public PythonConfiguration()
 {
     this.m_Runtime = PythonHelper.FindPreferedRuntime();
     this.m_Module  = s_DefaultModule;
 }