Comments (4)
Sorry if this is short. I'm on mobile right now. The type for dataCoding.scheme is intended to be an enum, not a string so the "if" test is checking enum equality using the enum module.
I hope this makes sense. If not, can u give sample code or test where it fails?
Sent from my iPhone
On Aug 28, 2012, at 12:19 PM, Fourat Zouari [email protected] wrote:
at line 427:
def _encodeSchemeDataAsInt(self, dataCoding): if dataCoding.scheme == pdu_types.DataCodingScheme.GSM_MESSAGE_CLASS: return self._encodeGsmMsgSchemeDataAsInt(dataCoding) raise ValueError("Unknown data coding scheme %s" % scheme)
first, scheme is not defined so this code would lead to an error; second the test at line 425:
if dataCoding.scheme == pdu_types.DataCodingScheme.GSM_MESSAGE_CLASS:
should be fixed with casting values with str() to get the test working.
I didnt push a request with this correction because i didnt understand the difference between _encodeSchemeDataAsInt() method and this one (just on top of it):
def _encodeSchemeNameAsInt(self, dataCoding): schemeName = str(dataCoding.scheme) if schemeName not in constants.data_coding_scheme_name_map: raise ValueError("Unknown data_coding scheme name %s" % schemeName) return constants.data_coding_scheme_name_map[schemeName]
schemeName is casted before the "if" test the right way, so is there any reason why its implemented in a different way in _encodeSchemeDataAsInt()
—
Reply to this email directly or view it on GitHub.
from smpp.pdu.
Thank you, that make sense now.
What about the scheme variable at line 427 ?
from smpp.pdu.
That looks like a bug. Thanks.
from smpp.pdu.
Fixed. Thx.
from smpp.pdu.
Related Issues (15)
- interface_version is 1 octet, not 4 HOT 2
- README.markdown missing from package
- concatenated text message is not working with Arabic languag HOT 1
- Manifest update not deployed to PyPI HOT 1
- How to add optional parameters in a PDU HOT 2
- No module named pdu_encoding HOT 5
- KeyError while trying to encode PDU HOT 2
- Is this project open source? HOT 2
- Support for TLV is not complete ? HOT 1
- Received unparsable PDU
- datacoding error
- Character set support HOT 1
- Is it normal to send enquirelinks when not bound ? HOT 2
- The support for SubmitMulti is not complete HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smpp.pdu.