예제 #1
0
 def test_6(self):
     sa = osax.ScriptingAddition(
         'Standardadditions',
         aemapp=aem.Application("/System/Library/CoreServices/Finder.app/"))
     self.assertEqual(65, sa.ASCII_number('A'))
     self.assertEqual(
         mactypes.Alias("/System/Library/CoreServices/Finder.app/"),
         sa.path_to(None))
예제 #2
0
 def test_5(self):
     pid = int(
         commands.getoutput("top -l1 | grep Finder | awk '{ print $1 }'"))
     sa = osax.ScriptingAddition('Standardadditions', pid=pid)
     self.assertEqual(
         mactypes.Alias("/System/Library/CoreServices/Finder.app/"),
         sa.path_to(None))
     self.assertEqual(65, sa.ASCII_number('A'))
예제 #3
0
 def init(self):
     self = super(ASDictionary, self).init()
     if self is None: return
     self._selectedFiles = []  # {'name': u'...', 'path': u'...'}
     self._canExport = False
     self._htmlOptionsEnabled = False
     self._itemName = u''
     self._progressBar = 0
     # Connect to StandardAdditions (see note at top of script)
     self.standardAdditions = osax.ScriptingAddition()
     return self
예제 #4
0
    def test_1(self):
        sa = osax.ScriptingAddition('Standardadditions')

        self.assertEqual(65, sa.ASCII_number('A'))

        self.assertEqual(mactypes.Alias("/Applications/"),
                         sa.path_to(osax.k.applications_folder))

        self.assertEqual(
            mactypes.Alias("/Library/Scripts/"),
            sa.path_to(osax.k.scripts_folder, from_=osax.k.local_domain))

        self.assertRaises(AttributeError, getattr, sa, 'non_existent_command')
예제 #5
0
 def test_4(self):
     sa = osax.ScriptingAddition('Standardadditions', id='com.apple.finder')
     self.assertEqual(65, sa.ASCII_number('A'))
     self.assertEqual(
         mactypes.Alias("/System/Library/CoreServices/Finder.app/"),
         sa.path_to(None))