当前位置: 首页>>代码示例>>Python>>正文


Python Setup类代码示例

本文整理汇总了Python中Setup的典型用法代码示例。如果您正苦于以下问题:Python Setup类的具体用法?Python Setup怎么用?Python Setup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Setup类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: SetupUtils

def SetupUtils( env ):
	env.SharedLibrarySafe = SharedLibrarySafe
	if ( os.path.exists( 'sys/scons/SDK.py' ) ):
		import SDK
		sdk = SDK.idSDK()
		env.PreBuildSDK = sdk.PreBuildSDK
		env.BuildSDK = sdk.BuildSDK
	else:
		env.PreBuildSDK = NotImplementedStub
		env.BuildSDK = NotImplementedStub

	if ( os.path.exists( 'sys/scons/Setup.py' ) ):
		import Setup
		setup = Setup.idSetup()
		env.Prepare = setup.Prepare
		env.BuildSetup = setup.BuildSetup
		env.BuildGamePak = setup.BuildGamePak
	else:
		env.Prepare = NotImplementedStub
		env.BuildSetup = NotImplementedStub
		env.BuildGamePak = NotImplementedStub

	if ( os.path.exists( 'sys/scons/OSX.py' ) ):
		import OSX
		OSX = OSX.idOSX()
		env.BuildBundle = OSX.BuildBundle
	else:
		env.BuildBundle = NotImplementedStub
开发者ID:pdoughty,项目名称:Q4--Hardqore,代码行数:28,代码来源:scons_utils.py

示例2: SetupUtils

def SetupUtils( env ):
	env.SharedLibrarySafe = SharedLibrarySafe
	try:
		import SDK
		env.BuildSDK = SDK.BuildSDK
	except:
		env.BuildSDK = NotImplementedStub
	try:
		import Setup
		setup = Setup.idSetup()
		env.BuildSetup = setup.BuildSetup
	except:
		env.BuildSetup = NotImplementedStub
开发者ID:BulldogDrummond,项目名称:etpub,代码行数:13,代码来源:scons_utils.py

示例3: SetupUtils

def SetupUtils( env ):
	gamepaks = idGamePaks()
	env.BuildGamePak = gamepaks.BuildGamePak
	env.SharedLibrarySafe = SharedLibrarySafe
	try:
		import SDK
		sdk = SDK.idSDK()
		env.PreBuildSDK = sdk.PreBuildSDK
		env.BuildSDK = sdk.BuildSDK
	except:
		print 'SDK.py hookup failed'
		env.PreBuildSDK = NotImplementedStub
		env.BuildSDK = NotImplementedStub
	try:
		import Setup
		setup = Setup.idSetup()
		env.BuildSetup = setup.BuildSetup
	except:
		print 'Setup.py hookup failed'
		env.BuildSetup = NotImplementedStub
开发者ID:casey0102,项目名称:iodoom3,代码行数:20,代码来源:scons_utils.py

示例4: assert_object_type

# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

import xorn.storage, Setup

rev0, rev1, rev2, rev3, ob0, ob1a, ob1b = Setup.setup()

def assert_object_type(rev, ob, expected_type):
    if expected_type is not None:
        assert type(rev.get_object_data(ob)) == expected_type
        return

    try:
        rev.get_object_data(ob)
    except KeyError:
        pass
    else:
        raise AssertionError

assert_object_type(rev0, ob0, None)
assert_object_type(rev0, ob1a, None)
开发者ID:SayCV,项目名称:geda-gaf,代码行数:31,代码来源:get_obtype.py

示例5: create

def create(self, notebook):
	Setup.setup_profile_check(self)
	self.window.set_size_request(450,310)   # TODO Correct size

	# Frame - Select Profile Frame
	select_profile_frame = create_page(self, notebook, 'Select Profile', 100, 75)


		# Select Profile Window (scrolled)
	select_profile_window = gtk.ScrolledWindow()
	select_profile_window.set_border_width(10)
	select_profile_window.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
	select_profile_window.show()
	select_profile_frame.add(select_profile_window)
			# Select Profile ListStore
			  # Profile Name       = String
 	self.select_profile_liststore = gtk.ListStore(str,str)
	self.select_profile_treeview = gtk.TreeView(self.select_profile_liststore)
	select_profile_column_1 = gtk.TreeViewColumn('Profile')
	self.select_profile_treeview.append_column(select_profile_column_1)
	select_profile_window.add(self.select_profile_treeview)
	self.select_profile_treeview.show()

	for i in range(0,len(self.profiles)):
		self.select_profile_liststore.append([self.profiles[i],self.ini[i]])


		# Add Mouse Click event to select_profile_treeview
	self.select_profile_treeview.add_events(gtk.gdk.BUTTON_PRESS_MASK)
	self.select_profile_treeview.connect('event',profile_selection, self)

        	# create a CellRenderers to render the data
        self.cell1  = gtk.CellRendererText()

        	# set background color property
        self.cell1.set_property('cell-background', 'white')

        	# add the cells to the columns
	select_profile_column_1.pack_start(self.cell1, False)

        	# set the cell attributes to the appropriate liststore column
        select_profile_column_1.set_attributes(self.cell1, text=0)


	# INSTALL SETUP INFO
	if sys.platform != 'win32':
		install_types = GLOBAL.LINUX_INSTALL_TYPES
		install_types_default = GLOBAL.LINUX_INSTALL_TYPES_DEFAULT
	else:
		install_types = GLOBAL.WINDOWS_INSTALL_TYPES
		install_types_default = GLOBAL.WINDOWS_INSTALL_TYPES_DEFAULT


	# Frame - Create Profile Frame
	create_profile_frame = create_page(self, notebook, 'Create Profile', 100, 75)

		# Table
	create_profile_table = gtk.Table(rows=1,columns=1, homogeneous=False)
	create_profile_table.show()
	create_profile_frame.add(create_profile_table)

			# Profile Name
	profile_name_label = label_create("Profile Name")
	self.profile_name = gtk.Entry(max=0)
	self.profile_name.show()
	create_profile_table.attach(profile_name_label, 0,1,0,1, gtk.FILL,gtk.FILL,10,10)
	create_profile_table.attach(self.profile_name, 1,2,0,1, gtk.FILL,gtk.FILL,10,10)
			# Install Type
	install_type_label = label_create("Install Type")
	self.install_type_combobox = combobox_setup(None, None, None, install_types_default, install_types)
	self.install_type_combobox.connect("changed", install_type_selection, self)
	create_profile_table.attach(install_type_label, 0,1,1,2, gtk.FILL,gtk.FILL,10,10)
	create_profile_table.attach(self.install_type_combobox, 1,2,1,2, gtk.FILL,gtk.FILL,10,10)
			# Spring Binary
	spring_binary_label = label_create('Spring Binary')
	self.spring_binary = gtk.Entry(max=0)
	self.spring_binary.set_text('spring')
	self.spring_binary.show()
	create_profile_table.attach(spring_binary_label, 0,1,2,3, gtk.FILL,gtk.FILL,10,10)
	create_profile_table.attach(self.spring_binary, 1,2,2,3, gtk.FILL,gtk.FILL,10,10)
			# Datadir Location
	self.spring_datadir_label = label_create('Spring Datadir')
	self.spring_datadir = gtk.Entry(max=0)
	self.spring_datadir.show()
	create_profile_table.attach(self.spring_datadir_label, 0,1,3,4, gtk.FILL,gtk.FILL,10,10)
	create_profile_table.attach(self.spring_datadir, 1,2,3,4, gtk.FILL,gtk.FILL,10,10)
			# Spring-GUI Background
	background_label = label_create('Spring GUI Background')
	self.background = gtk.Entry(max=0)
	self.background.show()
	create_profile_table.attach(background_label, 0,1,4,5, gtk.FILL,gtk.FILL,10,10)
	create_profile_table.attach(self.background, 1,2,4,5, gtk.FILL,gtk.FILL,10,10)
				# Default -> Background
	if os.path.isfile (GLOBAL.SPRING_GUI_BACKGROUND):
		self.background.set_text(GLOBAL.SPRING_GUI_BACKGROUND)


			# Button -> Save
	save_button = gtk.Button(label=None, stock=gtk.STOCK_SAVE)
	save_button.connect("clicked", Setup.profile_save, self)
#.........这里部分代码省略.........
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:101,代码来源:GUI_Setup.py

示例6: Scheduler

from Server import server
from serial import SerialException


# The following while loop keeps restarting the program if there is an error
# It will stop if errors occur too frequently

FREQ_LIMIT = 4     # limit on frequency of errors in seconds

START = 0

DELTA = FREQ_LIMIT  # done so first error doesn't count towards limit

while DELTA >= FREQ_LIMIT:
    try:
        Setup.setup()
        try:
            Setup.serial_setup()
        except SerialException:
            print "serial error"
            time.sleep(2)
            if var.serial_start == 0:
                var.serial_start = 2
            elif var.serial_start ==2:
                var.serial_start = 0
            Setup.closedown()
            Setup.serial_setup()
        SCHED = Scheduler()
        SCHED.new(server(var.port))
        SCHED.mainloop()
        
开发者ID:frazzleuk,项目名称:Linckia-robot-controller-board,代码行数:30,代码来源:run.py

示例7: Scheduler

from serial import SerialException


# The following while loop keeps restarting the program if there is an error
# It will stop if errors occur too frequently

FREQ_LIMIT = 4     # limit on frequency of errors in seconds

START = 0

DELTA = FREQ_LIMIT  # done so first error doesn't count towards limit

while DELTA >= FREQ_LIMIT:
    try:
        try:
            Setup.setup()
            Setup.serial_setup()
        except StandardError:
            print "serial setup error"
            time.sleep(2)
            if var.serial_start == 0:
                var.serial_start = 1
            elif var.serial_start ==1:
                var.serial_start = 0
            Setup.setup()
            Setup.serial_setup()
        SCHED = Scheduler()
        SCHED.new(server(var.port))
        SCHED.mainloop()
        
    except StandardError:
开发者ID:kisdia,项目名称:Linckia-robot-controller-board,代码行数:31,代码来源:run.py


注:本文中的Setup类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。