Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
4634cbc2
Kaydet (Commit)
4634cbc2
authored
Mar 07, 2012
tarafından
David Bolen
Kaydeden (comit)
Michael Stahl
Mar 07, 2012
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fdo#46859: adapt string type checks to work with both Python 2 and 3
(regression from
a09ce468
)
üst
73867da3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
uno.py
pyuno/source/module/uno.py
+10
-4
No files found.
pyuno/source/module/uno.py
Dosyayı görüntüle @
4634cbc2
...
@@ -35,6 +35,12 @@ try:
...
@@ -35,6 +35,12 @@ try:
except
ImportError
:
except
ImportError
:
import
builtins
as
__builtin__
import
builtins
as
__builtin__
try
:
unicode
except
NameError
:
# Python 3 compatibility
unicode
=
str
import
socket
# since on Windows sal3.dll no longer calls WSAStartup
import
socket
# since on Windows sal3.dll no longer calls WSAStartup
# all functions and variables starting with a underscore (_) must be considered private
# all functions and variables starting with a underscore (_) must be considered private
...
@@ -159,9 +165,9 @@ class Bool(object):
...
@@ -159,9 +165,9 @@ class Bool(object):
Note: This class is deprecated. Use python's True and False directly instead
Note: This class is deprecated. Use python's True and False directly instead
"""
"""
def
__new__
(
cls
,
value
):
def
__new__
(
cls
,
value
):
if
isinstance
(
value
,
str
)
and
value
==
"true"
:
if
isinstance
(
value
,
(
str
,
unicode
)
)
and
value
==
"true"
:
return
True
return
True
if
isinstance
(
value
,
str
)
and
value
==
"false"
:
if
isinstance
(
value
,
(
str
,
unicode
)
)
and
value
==
"false"
:
return
False
return
False
if
value
:
if
value
:
return
True
return
True
...
@@ -171,7 +177,7 @@ class Char:
...
@@ -171,7 +177,7 @@ class Char:
"Represents a UNO char, use an instance of this class to explicitly pass a char to UNO"
"Represents a UNO char, use an instance of this class to explicitly pass a char to UNO"
# @param value pass a Unicode string with length 1
# @param value pass a Unicode string with length 1
def
__init__
(
self
,
value
):
def
__init__
(
self
,
value
):
assert
isinstance
(
value
,
str
)
assert
isinstance
(
value
,
unicode
)
assert
len
(
value
)
==
1
assert
len
(
value
)
==
1
self
.
value
=
value
self
.
value
=
value
...
@@ -179,7 +185,7 @@ class Char:
...
@@ -179,7 +185,7 @@ class Char:
return
"<Char instance
%
s>"
%
(
self
.
value
,
)
return
"<Char instance
%
s>"
%
(
self
.
value
,
)
def
__eq__
(
self
,
that
):
def
__eq__
(
self
,
that
):
if
isinstance
(
that
,
str
):
if
isinstance
(
that
,
(
str
,
unicode
)
):
if
len
(
that
)
>
1
:
if
len
(
that
)
>
1
:
return
False
return
False
return
self
.
value
==
that
[
0
]
return
self
.
value
==
that
[
0
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment